【问题标题】:glReadPixels GL_RGBA returning ARGB pixels insteadglReadPixels GL_RGBA 返回 ARGB 像素
【发布时间】: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


    【解决方案1】:

    不应该,你读的帧缓冲是默认的吗?否则,从附加到 GL_COLOR_ATTACHMENT0 连接点的彩色图像中读取颜色分量。 顺便说一句,您设备的 GPU 供应商是什么?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-02-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-10
      • 2019-07-16
      • 1970-01-01
      相关资源
      最近更新 更多