简体   繁体   中英

compressing already compressed image in android open gl

I want to compress already compressed images and pass the final double compressed data to glCompressedTexImage2D. For this I have followed below steps:

glGenTextures(1, textureID);
glBindTexture(GL_TEXTURE_2D, textureID);
glTexImage2D(GL_TEXTURE_2D, level, internalformat, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0,GL_TEXTURE_COMPRESSED_IMAGE_SIZE,
&compressedSize );
if (compressedSize > 0){
/* call glCompressedTexImage2D to render this double compressed image.*/
}

But I am getting only 0 in compressedSize. Seems the data is not getting compressed.

GL_TEXTURE_COMPRESSED_IMAGE_SIZE不是OpenGLES 2规范(甚至是OpenGLES 3.0或3.1)的一部分

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM