summaryrefslogtreecommitdiff
path: root/webcam/webcam/effects/mirror/LeftMirrorEffect.as
diff options
context:
space:
mode:
Diffstat (limited to 'webcam/webcam/effects/mirror/LeftMirrorEffect.as')
-rwxr-xr-xwebcam/webcam/effects/mirror/LeftMirrorEffect.as41
1 files changed, 41 insertions, 0 deletions
diff --git a/webcam/webcam/effects/mirror/LeftMirrorEffect.as b/webcam/webcam/effects/mirror/LeftMirrorEffect.as
new file mode 100755
index 0000000..31cc510
--- /dev/null
+++ b/webcam/webcam/effects/mirror/LeftMirrorEffect.as
@@ -0,0 +1,41 @@
+/**
+ * Neave Webcam // Left Mirror Effect
+ *
+ * Copyright (C) 2008 Paul Neave
+ * http://www.neave.com/
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation at http://www.gnu.org/licenses/gpl.html
+ */
+
+package com.neave.webcam.effects.mirror
+{
+ import flash.display.*;
+
+ public class LeftMirrorEffect extends AbstractMirrorEffect
+ {
+ /**
+ * Creates a mirror effect where the left side of the image is reflected into the right side (when using a flipped image)
+ *
+ * @param source The source object to use for the effect
+ * @param targetBitmap The target bitmap data to draw the resulting effect into
+ */
+ public function LeftMirrorEffect(source:IBitmapDrawable, targetBitmap:BitmapData)
+ {
+ super(source, targetBitmap, "Left Mirror");
+
+ createMirror();
+ }
+
+ /**
+ * Sets up the mirror effect
+ */
+ private function createMirror():void
+ {
+ mirrorMatrix.scale(-1, 1);
+ mirrorMatrix.translate(rect.width, 0);
+ mirrorBitmap = new BitmapData(Math.round(rect.width / 2), rect.height, false, 0xFF000000);
+ }
+ }
+} \ No newline at end of file