diff options
Diffstat (limited to 'webcam/webcam/effects/mirror/AbstractMirrorEffect.as')
| -rw-r--r--[-rwxr-xr-x] | webcam/webcam/effects/mirror/AbstractMirrorEffect.as | 134 |
1 files changed, 67 insertions, 67 deletions
diff --git a/webcam/webcam/effects/mirror/AbstractMirrorEffect.as b/webcam/webcam/effects/mirror/AbstractMirrorEffect.as index 57008f7..decb011 100755..100644 --- a/webcam/webcam/effects/mirror/AbstractMirrorEffect.as +++ b/webcam/webcam/effects/mirror/AbstractMirrorEffect.as @@ -1,68 +1,68 @@ -/**
- * Neave Webcam // Abstract 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.*;
- import flash.geom.*;
- import com.neave.webcam.effects.*;
-
- internal class AbstractMirrorEffect extends AbstractEffect
- {
- protected var mirrorBitmap:BitmapData;
- protected var mirrorMatrix:Matrix;
- protected var mirrorPoint:Point;
-
- /**
- * An abstract mirror effect class, not to be instantiated
- *
- * @param source The source object to use for the effect
- * @param targetBitmap The target bitmap data to draw the resulting effect into
- * @param name The proper name of the effect
- */
- public function AbstractMirrorEffect(source:IBitmapDrawable, targetBitmap:BitmapData, name:String = "")
- {
- super(source, targetBitmap, name);
-
- createAbstractMirror();
- }
-
- /**
- * Sets up the mirror effect
- */
- private function createAbstractMirror():void
- {
- mirrorMatrix = new Matrix();
- mirrorPoint = new Point();
- }
-
- /**
- * Draws the mirror effect
- */
- override public function draw():void
- {
- super.draw();
- mirrorBitmap.draw(sourceBitmap, mirrorMatrix);
- targetBitmap.copyPixels(sourceBitmap, rect, point);
- targetBitmap.copyPixels(mirrorBitmap, rect, mirrorPoint);
- }
-
- /**
- * Removes the mirror effect and all other referenced objects
- */
- override public function destroy():void
- {
- super.destroy();
- mirrorBitmap.dispose();
- mirrorBitmap = null;
- }
- }
+/** + * Neave Webcam // Abstract 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.*; + import flash.geom.*; + import com.neave.webcam.effects.*; + + internal class AbstractMirrorEffect extends AbstractEffect + { + protected var mirrorBitmap:BitmapData; + protected var mirrorMatrix:Matrix; + protected var mirrorPoint:Point; + + /** + * An abstract mirror effect class, not to be instantiated + * + * @param source The source object to use for the effect + * @param targetBitmap The target bitmap data to draw the resulting effect into + * @param name The proper name of the effect + */ + public function AbstractMirrorEffect(source:IBitmapDrawable, targetBitmap:BitmapData, name:String = "") + { + super(source, targetBitmap, name); + + createAbstractMirror(); + } + + /** + * Sets up the mirror effect + */ + private function createAbstractMirror():void + { + mirrorMatrix = new Matrix(); + mirrorPoint = new Point(); + } + + /** + * Draws the mirror effect + */ + override public function draw():void + { + super.draw(); + mirrorBitmap.draw(sourceBitmap, mirrorMatrix); + targetBitmap.copyPixels(sourceBitmap, rect, point); + targetBitmap.copyPixels(mirrorBitmap, rect, mirrorPoint); + } + + /** + * Removes the mirror effect and all other referenced objects + */ + override public function destroy():void + { + super.destroy(); + mirrorBitmap.dispose(); + mirrorBitmap = null; + } + } }
\ No newline at end of file |
