student-ar-org-libspark-flartoolkit-core-raster-rgb-PixelReader.ax [swf] flex
*
author: Saqoosha */ public class @ax-student-ar-org-libspark-flartoolkit-core-raster-rgb-PixelReader implements IFLARRgb@ax-student-ar-org-libspark-flartoolkit-core-raster-rgb-PixelReader { private var _parent:FLARRgbRaster_BGRA; public function @ax-student-ar-org-libspark-flartoolkit-core-raster-rgb-PixelReader(i_parent:FLARRgbRaster_BGRA) { this._parent = i_parent; } /** * @param o_rgb int[] */ public function getPixel(i_x:int, i_y:int, o_rgb:Array):void { var ref_buf:Array = this._parent.refBuf;// byte[] var bp:int = (i_x + i_y * this._parent.getWidth()) * 4; o_rgb[0] = (ref_buf[bp + 2] & 0xff);// R o_rgb[1] = (ref_buf[bp + 1] & 0xff);// G o_rgb[2] = (ref_buf[bp + 0] & 0xff);// B return; } /** * @param i_x int[] * @param i_y int[] * @param i_num int * @param o_rgb int[] */ public function getPixelSet(i_x:Array, i_y:Array, i_num:int, o_rgb:Array):void { var width:int = _parent.getWidth(); var ref_buf:Array = _parent.refBuf; // var bp:int; for (var i:int = i_num - 1; i >= 0; i--) { bp = (i_x[i] + i_y[i] * width) * 4; o_rgb[i * 3 + 0] = (ref_buf[bp + 2] & 0xff);// R o_rgb[i * 3 + 1] = (ref_buf[bp + 1] & 0xff);// G o_rgb[i * 3 + 2] = (ref_buf[bp + 0] & 0xff);// B } } } }
[]readme course(s) prefaceI 1 2II 3 4III 5 6 7IV 8 9 10V 11 12 afterthought(s)appendix reference(s) example(s)resource(s) _![]()
(C) Æliens 04/09/2009
You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.