BitmapData.hx 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package flash.display;
  2. import flash.geom.Rectangle;
  3. import flash.geom.Point;
  4. extern class BitmapData {
  5. static function loadBitmap( id : String ) : BitmapData;
  6. var width : Int;
  7. var height : Int;
  8. var rectangle : Rectangle<Int>;
  9. var transparent : Bool;
  10. function new( width : Int, height : Int, ?transparent : Bool, ?fillcolor : Int ) : Void;
  11. function getPixel( x : Int, y : Int ) : Int;
  12. function setPixel( x : Int, y : Int, color : Int ) : Void;
  13. function getPixel32( x : Int, y : Int ) : Int;
  14. function setPixel32( x : Int, y : Int, color : Int ) : Void;
  15. function fillRect( r : Rectangle<Int>, color : Int ) : Void;
  16. function copyPixels( src : BitmapData, srcRect : Rectangle<Int>, dst : Point<Int>, ?alpha : BitmapData, ?alphaPos : Point<Int>, ?mergeAlpha : Bool ) : Void;
  17. function applyFilter( source : BitmapData, sourceRect : Rectangle<Int>, dest : Point<Int>, filter : flash.filters.BitmapFilter ) : Int;
  18. function scroll( dx : Int, dy : Int ) : Void;
  19. function threshold( src : BitmapData , srcRect : Rectangle<Int>, dstPoint : Point<Int>, op : String, threshold : Int, ?color : Int, ?mask : Int, ?copy : Bool ) : Int;
  20. function draw( source : Dynamic, ?matrix : flash.geom.Matrix, ?colortrans : flash.geom.ColorTransform, ?blendMode : Dynamic, ?clipRect : Rectangle<Int>, ?smooth : Bool) : Void;
  21. function pixelDissolve( src : BitmapData, srcRect : Rectangle<Int>, dst : Point<Int>, ?seed : Int, ?npixels : Int, ?fillColor : Int ) : Int;
  22. function floodFill( x : Int, y : Int, color : Int ) : Void;
  23. function getColorBoundsRect( mask : Int, color : Int, ?fillColor : Bool ) : Rectangle<Int>;
  24. function perlinNoise( x : Int, y : Int, num : Int, seed : Int, stitch : Bool, noise : Bool, ?channels : Int, ?gray : Bool, ?offsets : Array<Point<Float>> ) : Void;
  25. function colorTransform( r : Rectangle<Int>, trans : flash.geom.ColorTransform ) : Void;
  26. function hitTest( firstPoint : Point<Int>, firstAlpha : Int, object : Dynamic, ?secondPoint : Point<Int>, ?secondAlpha : Int ) : Bool;
  27. function paletteMap( source : BitmapData, srcRect : Rectangle<Int>, dst : Point<Int>, ?reds : Array<Dynamic>, ?greens : Array<Dynamic>, ?blues : Array<Dynamic>, ?alphas : Array<Dynamic> ) : Void;
  28. function merge( src : BitmapData, srcRect : Rectangle<Int>, dst : Point<Int>, redMult : Int, greenMult : Int, blueMult : Int, alphaMult : Int ) : Void;
  29. function noise( seed : Int, ?low : Int, ?high : Int, ?channels : Int, ?gray : Bool ) : Void;
  30. function copyChannel( source : BitmapData, sourceRect : Rectangle<Int>, dest : Point<Int>, sourceChannel : Int, destChannel : Int ) : Void;
  31. function clone() : BitmapData;
  32. function dispose() : Void;
  33. function generateFilterRect(sourceRect : Rectangle<Int>, filter : flash.filters.BitmapFilter ) : Rectangle<Int>;
  34. /** FP9 only **/
  35. function compare( b : BitmapData ) : BitmapData; // WTF ?
  36. }