I have written the following structures.
struct RGB
{
unsigned short Red;
unsigned short Green;
unsigned short Blue;
};
struct ImageBase
{
std::string name;
RGB array[64][64];
};
I have got a file “Image.png”.How do I read the file(print the RGB values to the screen or file)?
You could use gil which is part of boost to read the image:
You would then create a view on the image to access the pixels, and iterate over the pixels to write them to standard out:
Docs for gil are here: http://www.boost.org/doc/libs/1_51_0/libs/gil/doc/index.html