What is PixelFormat.RGBX_888

左心房为你撑大大i 提交于 2019-12-05 10:02:17

RGBX means, that the pixel format still has an alpha channel, but it is ignored, and is always set to 255.

Some reference:

Blackberry PixelFormat (It is not android, however I guess that the naming conventions stay same across platforms.)

The RGBX 32 bit RGB format is stored in memory as 8 red bits, 8 green bits, 8 blue bits, and 8 ignored bits.

Android 4.1.2 source code (texture.cpp) Line 80

There is a function called PointSample, where it samples based on a template format, and the passed parameters. You can see, that at pixelformat RGBX_8888, the alpha channel is ignored and set to 255, while at RGBA_8888, it is normally sampled.

if (GGL_PIXEL_FORMAT_RGBA_8888 == format)
    *sample = *(data + index);
else if (GGL_PIXEL_FORMAT_RGBX_8888 == format)
{
    *sample = *(data + index);
    *sample |= 0xff000000;
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!