Sign in to follow this  
Rumbert78

gluScaleImage() too slow :-(

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this