My question is pretty simple, suppose I have an image and I want to load it into my program so that I can get the color of each pixel. How could I do that? In a nutshell I want a method that gives me the color of a pixel.
struct color{
double r, g, b;
color(){}
color(float red, float green, float blue){r = red; g = green; b = blue;}
};
color GetPixel(string imageName, int x, int y){
//if(x < 0 || x >= width of image) return color(0,0,0);
//if(y < 0 || y >= height of image) return color(0,0,0);
//do stuff
return colorForPixelXY;
}
Preferably I would like to do it natively, without using any external libs.