auto-scaling grayscale image possible?
How can I display a grayscale *floating point* image without clamping it myself to the [0,1] region? So for example, when the maximum pixel value is 135.6f, this value should be displayed as full white and when the minimum pixel is 5.1f this value will be displayed as full black, whilst everything in between will be scaled as a grayscale value linearly with respect to [5.1, 135.6].
(similarly to the "imagesc" function in Matlab).
Can this be done in OpenGL?
Currently I work with PBO's and I create a texture as follows:
glTexImage2D(GL_TEXTURE_2D, 0, 1, width, height, 0, GL_LUMINANCE, GL_FLOAT, NULL);
and update the texture in my display() function with:
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height,GL_DEPTH_COMPONENT, GL_FLOAT,0);
If it can be done with these lines, how should I modify the internalformat, type,... parameters?
Thanks in advance!