Revision Release 2022.3683 Keywords iOS, Solar2D Native, C, CoronaGraphics.h, CoronaExternalBitmapFormat See also CoronaGraphics.h Corona C Functions
Enumerated type describing the pixel format of the bitmap. Bitmap channels are
RGBA format uses premultiplied alpha. This means that if the "raw" values of the channels are r
, g
, b
, and a
, the red channel will be r*(a/255)
.
This enum provides the following constants:
kExternalBitmapFormat_Undefined
— Defaults to kExternalBitmapFormat_RGBA
.kExternalBitmapFormat_Mask
— Alpha; 1 byte per pixel. Textures with bitmaps of this format can be used only as masks.kExternalBitmapFormat_RGB
— RGB; 3 bytes per pixel.kExternalBitmapFormat_RGBA
— RGBA; 4 bytes per pixel. RGB channels must be premultiplied with alpha.The width of kExternalBitmapFormat_Mask
and kExternalBitmapFormat_RGB
bitmaps must be a multiple of 4. If the width is not a multiple of 4, the mask will create visual artifacts, and RGB will be treated as RGBA on Windows.
When using kExternalBitmapFormat_RGBA
, the red, green, and blue channels must have premultiplied alpha.