I have an image that I get as follows:
glDrawPixels(image->width, image->height, GL_BGR, GL_UNSIGNED_BYTE, image->imageData);
Anyway, can I draw it in shades of gray (without loading it first into the texture)? I don't care if, say, the blue component is used for the gray value and not for the L2 norm or something else, I just need a quick and dirty output.
GL_LUMINANCE will be great, except that it will not work on a three-channel image.
@timday:
http://img164.imageshack.us/img164/3603/grayscale.png
A perverted idea for you to try, and I have no idea if this will work:
glPixelZoom(1.0f/3.0f,1.0f); glDrawPixels(3*width,height,GL_LUMINANCE,GL_UNSIGNED_BYTE,data);
.. 3- () 3 , x. , GL glDrawPixels, , .
Source: https://habr.com/ru/post/1706364/More articles:WebORB for Java or BlazeDS? - java-eeIs there a jQuery text list? - jqueryDoes each authenticated WCF connection require a CAL? - wcfHow to force type in SML (for example, casting) - smlAuto Pointer in VC2008 - copy-constructorUsing deferred execution using javascript - javascriptHow to create a screenshot of Flash SWF on a server? - flashHow do you use display specifications? - x11java string to convert date and time - javaJava screen capture application - javaAll Articles