修订版 2024.3703 版 关键字 iOS、Solar2D Native、C、CoronaGraphics.h、CoronaExternalBitmapFormat 另请参阅 CoronaGraphics.h Corona C 函数
描述位图像素格式的枚举类型。位图通道为
RGBA 格式使用预乘 Alpha。这意味着如果通道的“原始”值为 r、g、b 和 a,则红色通道将为 r*(a/255)。
此枚举提供以下常量
kExternalBitmapFormat_Undefined — 默认为 kExternalBitmapFormat_RGBA。kExternalBitmapFormat_Mask — Alpha;每像素 1 字节。具有这种格式的位图纹理只能用作蒙版。kExternalBitmapFormat_RGB — RGB;每像素 3 字节。kExternalBitmapFormat_RGBA — RGBA;每像素 4 字节。RGB 通道必须预乘 Alpha。kExternalBitmapFormat_Mask 和 kExternalBitmapFormat_RGB 位图的宽度必须是 4 的倍数。如果宽度不是 4 的倍数,则蒙版将创建视觉伪像,并且 RGB 将在 Windows 上视为 RGBA。
使用 kExternalBitmapFormat_RGBA 时,红色、绿色和蓝色通道必须预乘 Alpha。