BitmapData.hx 2.8 KB

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