View Full Version : image rgb values into an array
06-13-2002, 04:33 AM
Anyone got any ideas how to read the rgb values of an image into an array.
Ive done plenty of file input and ouput programs before, but I dont know how to access the rgb values of each pixel.
06-13-2002, 04:43 AM
Are you talking about reading from the framebuffer ?, in that case you use glReadPixels(), if you are talking about image files like bmp, png or what ever, then OpenGL does not support this, but there are lots of libraries out there that can help you (google)
06-13-2002, 06:26 AM
Thanks for reply
im looking to read from an image NOT the framebuffer
06-13-2002, 06:32 AM
It depends entirely on the image format. www.wotsit.org (http://www.wotsit.org) has the file spec for many, many different file formats. Generally, in an uncompressed image format, somewhere in there is an array of RGB values.
There are also libraries like SDL_image that you can use for reading in various image formats.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.