Reputation: 4904
I have a piece of code that uses glReadPixels to capture byte images from frame buffer (code below), now how do I save that into a jpeg file?
char* pdata = new char[width * height * 4]; // 4 is for RGBA
glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pdata);
Upvotes: 1
Views: 2830
Reputation: 474126
I would suggest downloading libjpeg. Or any one of a number of image processing libraries. DevIL (which hasn't been updated recently, but certainly works), FreeImage, etc.
Upvotes: 4