import PixelSnapping from "./PixelSnapping"; import DisplayObject from "./DisplayObject"; import BitmapData from "./BitmapData"; declare namespace openfl.display { /** * The Bitmap class represents display objects that represent bitmap images. * These can be images that you load with the `openfl.Assets` or * `openfl.display.Loader` classes, or they can be images that you * create with the `Bitmap()` constructor. * * The `Bitmap()` constructor allows you to create a Bitmap * object that contains a reference to a BitmapData object. After you create a * Bitmap object, use the `addChild()` or `addChildAt()` * method of the parent DisplayObjectContainer instance to place the bitmap on * the display list. * * A Bitmap object can share its BitmapData reference among several Bitmap * objects, independent of translation or rotation properties. Because you can * create multiple Bitmap objects that reference the same BitmapData object, * multiple display objects can use the same complex BitmapData object without * incurring the memory overhead of a BitmapData object for each display * object instance. * * A BitmapData object can be drawn to the screen by a Bitmap object in one * of two ways: by using the default hardware renderer with a single hardware surface, * or by using the slower software renderer when 3D acceleration is not available. * * If you would prefer to perform a batch rendering command, rather than using a * single surface for each Bitmap object, you can also draw to the screen using the * `openfl.display.Tilemap` class. * * **Note:** The Bitmap class is not a subclass of the InteractiveObject * class, so it cannot dispatch mouse events. However, you can use the * `addEventListener()` method of the display object container that * contains the Bitmap object. * * @see [Working with bitmaps](https://books.openfl.org/openfl-developers-guide/working-with-bitmaps/) * @see [The Bitmap and BitmapData classes](https://books.openfl.org/openfl-developers-guide/working-with-bitmaps/the-bitmap-and-bitmapdata-classes.html) * @see [Manipulating pixels](https://books.openfl.org/openfl-developers-guide/working-with-bitmaps/manipulating-pixels.html) * @see [Copying bitmap data](https://books.openfl.org/openfl-developers-guide/working-with-bitmaps/copying-bitmap-data.html) * @see [Compressing bitmap data](https://books.openfl.org/openfl-developers-guide/working-with-bitmaps/compressing-bitmap-data.html) * @see [Making textures with noise functions](https://books.openfl.org/openfl-developers-guide/working-with-bitmaps/making-textures-with-noise-functions.html) * @see [Scrolling bitmaps](https://books.openfl.org/openfl-developers-guide/working-with-bitmaps/scrolling-bitmaps.html) * @see [Display programming](https://books.openfl.org/openfl-developers-guide/display-programming/) * @see [Basics of display programming](https://books.openfl.org/openfl-developers-guide/display-programming/basics-of-display-programming.html) * @see [Core display classes](https://books.openfl.org/openfl-developers-guide/display-programming/core-display-classes.html) * @see [Choosing a display object subclass](https://books.openfl.org/openfl-developers-guide/display-programming/working-with-display-objects/choosing-a-displayobject-subclass.html) * @see `openfl.display.BitmapData` * */ export class Bitmap extends DisplayObject { /** * Initializes a Bitmap object to refer to the specified BitmapData object. * * @param bitmapData The BitmapData object being referenced. * @param pixelSnapping Whether or not the Bitmap object is snapped to the nearest pixel. * @param smoothing Whether or not the bitmap is smoothed when scaled. For example, the following examples * show the same bitmap scaled by a factor of 3, with `smoothing` set to `false` (left) and `true` (right): * * ![A bitmap without smoothing.](/images/bitmap_smoothing_off.jpg) ![A bitmap with smoothing.](bitmap_smoothing_on.jpg) * */ constructor(bitmapData?: BitmapData, pixelSnapping?: PixelSnapping, smoothing?: boolean); /** * The BitmapData object being referenced. * */ get bitmapData(): BitmapData; set bitmapData(value: BitmapData) /** * Controls whether or not the Bitmap object is snapped to the nearest pixel. * This value is ignored in the native and HTML5 targets. * The PixelSnapping class includes possible values: * * * `PixelSnapping.NEVER` - No pixel snapping occurs. * * `PixelSnapping.ALWAYS` - The image is always snapped to * the nearest pixel, independent of transformation. * * `PixelSnapping.AUTO` - The image is snapped to the * nearest pixel if it is drawn with no rotation or skew and it is drawn at a * scale factor of 99.9% to 100.1%. If these conditions are satisfied, the * bitmap image is drawn at 100% scale, snapped to the nearest pixel. * When targeting Flash Player, this value allows the image to be drawn as fast * as possible using the internal vector renderer. * * */ pixelSnapping: PixelSnapping; /** * Controls whether or not the bitmap is smoothed when scaled. If * `true`, the bitmap is smoothed when scaled. If * `false`, the bitmap is not smoothed when scaled. * */ smoothing: boolean; } } export default openfl.display.Bitmap;