    package components.Bitmap
    {
        import mx.core.UIComponent;
        import components.Tools.SpriteCanvas;
        import flash.display.BitmapData;
        import flash.display.Bitmap;
        import flash.events.Event;

        public dynamic class Picture extends UIComponent{
            //private var mainCanvas:MainCanvas;
            private var mainMask:SpriteCanvas;
            private var bmpData:BitmapData;
            private var bmpRaw:Bitmap;

            public var mainBitmap:SpriteCanvas;
            public var cnvSharp:SpriteCanvas;
            public var cnvBlur:SpriteCanvas;
            public var cnvColor:SpriteCanvas;
            public var colors:Object;
            public var sharpness:Boolean;
            public var blurness:Boolean;

            public function Picture(){
                new SpriteCanvas();
                initClass();
            }
            private function initClass():void{
                mainBitmap = new SpriteCanvas();
                mainMask = new SpriteCanvas();
                colors = new Object();
                colors = {bright:0, contrast:0, saturation:0, hue:0};
                cnvColor = new SpriteCanvas();
                cnvSharp = new SpriteCanvas();
                cnvBlur = new SpriteCanvas();
                sharpness = false;
                blurness = false;

                addChild(mainMask);
                addChild(cnvColor);
                cnvColor.addChild(cnvSharp);
                cnvSharp.addChild(cnvBlur);
                cnvBlur.addChild(mainBitmap);
                addEventListener("resize", sizeHandler);
            }
            private function sizeHandler(eventObj:Event):void{
                bmpRaw.width = width;
                bmpRaw.height = height;
            }
            public function drawBitmap(bmp:Bitmap):void{
                bmpRaw = new Bitmap();
                bmpRaw = bmp;
                mainBitmap.addChild(bmpRaw);
                bmpData = bmpRaw.bitmapData;
                bmp = null;
            }
        }
    }