Jump to content
  • Advertisement
Sign in to follow this  
Rumbert78

gluScaleImage() too slow :-(

This topic is 3789 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, at the moment I am using gluScaleImage(...) to resize an image data. Unfortunately this method is too slow. Is there a hardware accelerated possibility to do this task. Might be that my approach is not the best :-) so I can give you some background information: What I want is to resize/scale each frame captured from the webcam to a specified resolution. This scaled imagedata is used as a texture. There for I need to resize the frames from 320 x 240 to e.g. 512 x 512 (any kind of 2^n). May be there is a better way, than using gluScaleImage(...)? Regards André

Share this post


Link to post
Share on other sites
Advertisement
Well if you don't care about image quality, gluBuild2DMipmaps will resize the texture to the nearest POT texture size... What hardware are you on?

Share this post


Link to post
Share on other sites
Thank you for this hint, I will try gluBuild2DMipmaps().
My Hardware is a P4 @ 3GHz and a GeForce 6800. Running WinXP and developing C++ with VisualStudio 2008.

Regards André

Share this post


Link to post
Share on other sites
Hi,

I have some Problems in using the glhScaleImage_asm386 method. I can compile and run my application, but no texture is rendered :-(

When I am using:
gluScaleImage (GL_RGB, res_x, res_y, GL_UNSIGNED_BYTE, pFileDataIn, 512, 512,
GL_UNSIGNED_BYTE, pFileDataOut);
everything works (but very slow).

Do I use:
glhScaleImage_asm386 (GL_RGB, true, GL_UNSIGNED_BYTE, res_x, res_y,
pFileDataIn, 512, 512, pFileDataOut);
I can start my app, but see no texture (just a gray quad). The method returns allways a -5.

The manual says:
GLint GLHLIB_API glhScaleImage_asm386(GLenum format,
GLboolean isUseLinearOrPointSample,
GLint dataAlignment,
GLint widthin, GLint heightin,
GLubyte *datain,
GLint widthout, GLint heightout,
GLubyte *dataout);

Any idea?
Regards André

[Edited by - Rumbert78 on May 8, 2008 3:31:18 AM]

Share this post


Link to post
Share on other sites
The 3rd param is wrong. It should be 1 or 4 (data alignment).
If each row of your texture is a multiple of 4

(width * 3) % 4 == 0
alignment ==4
else
alignment ==1

glhScaleImage_asm386(GL_RGB, true, 1 or 4, res_x, res_y,
pFileDataIn, 512, 512, pFileDataOut);

I recommend using GL_RGBA and having alignment as 4 for the highest performance.
For more performance, set the second param to FALSE but it might look a little ugly.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!