openexr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Openexr-devel] Invert lines during reading process ?


From: Peter N
Subject: Re: [Openexr-devel] Invert lines during reading process ?
Date: Mon, 5 Dec 2005 23:59:26 +1100

Bob, that'll flip your geometry in the Y axis but what Gernot is talking about is flipping the image data before uploading it as a texture to OpenGL with glTexImage2D (or similar).

I personally would suggest flipping it in main memory. This is what I'm doing, and loading the EXR is already long enough that I pretty much didnt notice the flipping I'm doing afterwards. I would suggest trying to call memcpy instead of working per byte and all that, but it should be quite fast for even a several mb image!

Good luck

-Peter



On 12/5/05, Bob Friesenhahn <address@hidden> wrote:
The example at
http://www-h.eng.cam.ac.uk/help/tpl/graphics/using_glut.html seems to
include some clues.  It includes.

   glScalef(1, -1, 1);           /* Invert Y axis so increasing Y goes down. */
   glTranslatef(0, -h, 0);       /* Shift origin up to upper-left corner. */

Now I just need to try this out in my own little test program. :-)

Bob

On Sun, 4 Dec 2005, Gernot Ziegler wrote:

> Hej !
>
> OpenGL convention requires me to upload images upside down into the
> texture data buffer, that is, I need to read the EXR image from the bottom
> up - is there a way to do this more efficiently than to read the lines one
> by one (the headers lineorder attribute is only changeable for writing
> files, correct ?) ?
>
> If only the line-by-line reading remains:
> Should I maybe y-flip the data in main memory instead ? (Main memory is
> not an issue :-) )
>
> Servus,
>  Gernot
>
> --
> T----------------------------W-E-L-C-O-M-E------------------------------T
> O  The Austria <=> Sweden <=> Germany <=> Netherlands connection.....   H
> |   http://www.mpi-sb.mpg.de/~gziegler | http://www.lysator.liu.se/~gz   E
> \-----------------------------F-U-T-U-R-E-------------------------------/
>
>
> _______________________________________________
> Openexr-devel mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/openexr-devel
>

======================================
Bob Friesenhahn
address@hidden, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/


_______________________________________________
Openexr-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/openexr-devel


reply via email to

[Prev in Thread] Current Thread [Next in Thread]