import Texture from "./Texture"; import ByteArray from "openfl/utils/ByteArray"; import NetStream from "openfl/net/NetStream"; import TextureBase from "openfl/display3D/textures/TextureBase"; import BitmapData from "openfl/display/BitmapData"; import Bitmap from "openfl/display/Bitmap"; declare namespace starling.textures { /** * A ConcreteTexture wraps a Stage3D texture object, storing the properties of the texture * * and providing utility methods for data upload, etc. * * * *
This class cannot be instantiated directly; create instances using
* * Texture.fromTextureBase instead. However, that's only necessary when
* * you need to wrap a TextureBase object in a Starling texture;
* * the preferred way of creating textures is to use one of the other
* * Texture.from... factory methods in the Texture class.
Note that width and height are expected in pixels,
* * i.e. they do not take the scale factor into account.
Pass a callback function to attempt asynchronous texture upload. * * If the current platform or runtime version does not support asynchronous texture loading, * * the callback will still be executed.
* * * *This is the expected function definition:
* * function(texture:ConcreteTexture):Void;
*
*/
uploadBitmap(bitmap: Bitmap, async?: (arg0: ConcreteTexture) => void): void;
/**
* Uploads bitmap data to the texture. The existing contents will be replaced.
* * If the size of the bitmap does not match the size of the texture, the bitmap will be
* * cropped or filled up with transparent pixels.
* *
* *
Pass a callback function to attempt asynchronous texture upload. * * If the current platform or runtime version does not support asynchronous texture loading, * * the callback will still be executed.
* * * *This is the expected function definition:
* * function(texture:ConcreteTexture):Void;
*
*/
uploadBitmapData(data: BitmapData, async?: (arg0: ConcreteTexture) => void): void;
/**
* Uploads ATF data from a ByteArray to the texture. Note that the size of the
* * ATF-encoded data must be exactly the same as the original texture size.
* *
* *
The 'async' parameter is a callback function.
* * If it's null, the texture will be decoded synchronously and will be visible right away.
* * If it's a function, the data will be decoded asynchronously. The texture will remain unchanged until the
* * upload is complete, at which time the callback function will be executed. This is the
* * expected function definition: function(texture:ConcreteTexture):Void;
flash.display3D.textures.Texture.
*/
get isPotTexture(): boolean;
/**
* The function that you provide here will be called after a context loss.
* * On execution, a new base texture will already have been created; however,
* * it will be empty. Call one of the "upload..." methods from within the callback
* * to restore the actual texture data.
* *
* *