From: Marcin Romaszewicz (marcin++at++sgi.com)
Date: 02/27/2002 16:26:42
On Wed, 27 Feb 2002, Boris Mansencal wrote:
> Hi,
>
> I have a texture that I want to modify.
> I load an rgb file (not compressed). I do a pfTexture->getImage()
> and I want to access the RGBA values of each pixel.
>
> I do the following :
>
>
> tex = new pfTexture;
> tex->loadFile("test.rgb");
>
> tex->setFormat(PFTEX_EXTERNAL_FORMAT, GL_RGBA8);
You should not be setting the external format. The loadFile function does
this. You should call getFormat to query the current external format and
then use that for your computations. I think that if you are not packing
data, each components will be encoded as a ushort. You also have to make
accomodations for the presence of an alpha channel.
-- Marcin
This archive was generated by hypermail 2b29 : Wed Feb 27 2002 - 16:26:49 PST