From: Angus Dorbie (dorbie++at++sgi.com)
Date: 08/30/2000 16:06:00
The key thing to note here is that the source image may be a different
size form the destination image. In addition the image being subloaded
may not occupy the full width of the source image and may not be
positioned at the origin of the source image.
If you consider this problem it becomes clear that you need to specify
the location of the subload in the destination image, the overall width
of the source image and the width and height of the subload from the
source image, and the position of the origin of the subload in the
source image.
The height of the source image isn't needed because the image is stored
column minor, row major in OpenGL, but in order to properly address
height you need to know the image width for the stored source image
unless you are subloading a full width image in which case xsize is all
you need.
So, srcwid is needed to support source images of widths which do not
match the width of the image in texture memory, xsrc and ysrc is the
origin of the download in the source image (which doesn't have to be the
same as the origin in the destination image).
There is a degree of redundancy because an application could simply
adjust the pointer to address the appropriate pixel of the source image
and zero the xsrc and ysrc values, but that's more tricky for the
application to code for I suppose.
Strictly speaking the manual description is wrong w.r.t. srcwidth.
Cheers,Angus.
Satheesh Ganapathi Subramanian wrote:
>
> Hi Performers,
>
> I'm trying to use pfTexture::subload or pfSubLoadTex and I'm not able to
> understand the meaning of - srcwidth, xsrc, ysrc - in the list of
> paramenters to that function. I'm creating an image buffer (unsigned
> int*), the data in which keeps changing every frame. I would like to load
> this into texture memory using pfTexture::subload. It would be great if
> someone can tell me what each parameter of the function call means. I'm
> not able to get much out of the man pages.
>
> If anyone has some sample code that they can share, explaining how to use
> this function, it would be of immense use.
>
> Thanks
> Satheesh
>
> -----------------------------------------------------------------------
> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
-- For Performer+OpenGL tutorials http://www.dorbie.com/"In the middle of difficulty lies opportunity." --Albert Einstein
This archive was generated by hypermail 2b29 : Wed Aug 30 2000 - 16:06:12 PDT