image reducing

is there a way to reduce the resolution of image using openGL functions???

Thanks.

No. But the glu can do that.

First, you need to include the glu header and lib into your project (just like you did with gl.h and opengl32.lib).

Then you can use this function:

3.1 Image Scaling
The following routine magnifies or shrinks an image:
int gluScaleImage(format,widthin,heightin,typein,*datain,widthout,heightout,typeout,*dataout );

gluScaleImage will scale an image using the appropriate pixel store
modes to unpack data from the input image and pack the result into the
output image. format speci
es the image format used by both images. The
input image is described by widthin, heightin, typein, and datain, where
widthin and heightin specify the size of the image, typein speci
es the data
type used, and datain is a pointer to the image data in memory. The output
image is similarly described by widthout, heightout, typeout, and dataout,
where widthout and heightout specify the desired size of the image, typeout
speci
es the desired data type, and dataout points to the memory location
where the image is to be stored. The pixel formats and types supported are the same as those supported by glDrawPixels for the underlying OpenGL
implementation.

Looks a little overwhelming at first, but all the pixel storage stuff is very similar to what you need for texturing, so it shouldn’t be so hard to figure it out.

The complete glu spec is here .

edit Aargh, stupid Acrobat Reader mangled the text!

[This message has been edited by zeckensack (edited 03-12-2002).]

Please, how can i reduce the image size using openGL or glu???
(i´m trying to reduce a 28X28 image to 4X4)
Thanks.

Originally posted by zeckensack:
No. But the glu can do that.

Originally posted by rogersilva:
[b]Please, how can i reduce the image size using openGL or glu???
(i´m trying to reduce a 28X28 image to 4X4)
Thanks.

[/b]

For 24bit rgb stuff, use this:
gluScaleImage(GL_RGB,28,28,GL_UNSIGNED_BYTE,pointer_to_input_data,4,4,GL_UNSIGNED_BYTE,pointer_to_output_data);