CompVision once again, im working with jpeg images in my application. Just because i'm a bit familiar with MFC and ATL, i used CImage to access pixel values.
For my needs i calculate brightness matrix for the image during initialization. Function goes like this(Image is the name of my own class, unimportant, bright is float[][]):
void Image::fillBrightnessMatrix(){
COLORREF val;
for(int i=0;i<width;i++){
for(int j=0; j<height;j++){
val=src.GetPixel(i,j);
bright[i][j]=rgb_to_L(val);
}
}
}
Where src is an instance of CImage class, rgb_to_L - some function that calculates brightness of the color.
Examining the performance of my app, i discovered that GetPixel is the most expensive operation, and it significantly(really, ~700 times slower than any other operation) slows down the whole initializing of image. The question is, which library can you suggest for fast access to single pixel values? I dont need any other operations but loading jpeg image and accessing single pixels. Performance is important, because my application works with set of ~3000 images and i cant wait for hours to get results.