// draw the source to the destination
// TODO: if better-than-bilinear-scaling is desired, add a shader here
to do bicubic or something
glBegin(GL_QUADS);
glTexCoord2f(0,0);
glVertex2f(0,0);
glTexCoord2f(1,0);
glVertex2f(width,0);
glTexCoord2f(1,1);
glVertex2f(width,height);
glTexCoord2f(0,1);
glVertex(0, height);
glEnd();
// done! scaledTexture now has the scaled contents using bilinear
scaling in hardware
// make sure to delete fbos and texture when done.
// ALSO: RESTORE ALL THE GL STATE! NOT DOING SO WILL BLOW UP!
Thank you for the hint.
Couple of questions though:
- having done 3d programming before, I seem to remember that any texture
sizes must be powers of 2?
I want some potential weird scalings, currently our test setup has for
instance 48 by 50 pixels. Could that be handled?
- also, great to have the scaled down version of my image, but now what?
How do I read out the pixeldata from scaledTexture?
What is it, by the way, a texture object?
My apologies for abusing your help - this is just all new to me.
Thanks again,
--
Christophe Leske
multimedial.de
----------------------------------------
www.multimedial.de - [email protected]
Hohler Strasse 17 - 51645 Gummersbach
+49(0)2261-99824540 // +49(0)177-2497031
----------------------------------------
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com
This email sent to [email protected]