【发布时间】:2012-08-18 11:07:14
【问题描述】:
在 NDK、Android 中。 调用下一条指令来获取视口像素。我期望像素为 RGBA 格式,但我得到的是 ARGB 像素。是不是有什么问题或者设置在 glReadPixels 之前??
void getViewPortPixels(const unsigned int x, const unsigned int y, const unsigned int width, const unsigned int height, unsigned int* output)
{
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glPixelStorei(GL_PACK_ALIGNMENT, 1);
glReadPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, (void*)output);
}
【问题讨论】:
标签: android pixels rgba glreadpixels argb