Add new comment

Hmm, It seems to me that

Hmm, It seems to me that processed data are not being scaled to the 0-65535 range. In fact the data that are not saturated fall into the range 0 - colour.maximum, only saturated values are larger than color.maximum.

Is there a way I can upload an image to the forum? I have generated a greyscale jpeg from the data vector in my code above using

std::vector<unsigned char> jpegData(data.size());
for(size_t i=0; i<data.size(); ++i)
	jpegData[i] = unsigned char((data[i]*255)/iProcessor.imgdata.color.maximum);

The ouput shows the buffer overrun from conversion to unsigned char very clearly.

Phil