[info-performer] 16 bit texture components

Date view Thread view Subject view Author view

From: Andreas Ekstrand (Andreas.Ekstrand++at++saab.se)
Date: 05/16/2003 00:28:15


Hi!

We are trying to load an SGI intensity image with 16 bits per component
into a pfTexture, but the result gets all messed up (as shown in the
attached result.jpg within images.tar.gz). We use the following code for
setting up the texture:

pfTexture *texture = new pfTexture();
texture->loadFile("testImage_16_2.int");
texture->setFormat(PFTEX_EXTERNAL_FORMAT, PFTEX_PACK_16);
texture->setFormat(PFTEX_INTERNAL_FORMAT, PFTEX_I_16);
texture->setFormat(PFTEX_IMAGE_FORMAT, PFTEX_LUMINANCE);
texture->setRepeat(PFTEX_WRAP, PFTEX_CLAMP);

We couldn't attach the 16 bit intensity image because of the
info-performer size limit. ipaste doesn't show it correctly but imgview
does.

Creating an intensity texture with 16 bit components with the following
code works fine. The result is shown in the attached
result2.jpg within images.tar.gz.

uint *image = (uint *)pfMalloc(sizeof(short)*1024*1024,
pfGetSharedArena());
for(int row=0; row<512; row++){
  for(int column=0; column<512; column++){
    ((short *)image)[512*row + column] = (512*row + column) % 65535;
  }
}
pfTexture *texture = new pfTexture();
texture->setImage(image, 1, 512, 512, 1);
texture->setFormat(PFTEX_EXTERNAL_FORMAT, PFTEX_PACK_16);
texture->setFormat(PFTEX_INTERNAL_FORMAT, PFTEX_I_16);
texture->setFormat(PFTEX_IMAGE_FORMAT, PFTEX_LUMINANCE);
texture->setRepeat(PFTEX_WRAP, PFTEX_CLAMP);

Doesn't the SGI image reader used by pfTexture::loadFile() handle 16 bit
components or have we missed something here? We'd appreciate any
solution or comment.

Regards,
Andreas Ekstrand

-- 
---------------------------------------------------------
FTM-AE Andreas Ekstrand |E-mail: Andreas.Ekstrand++at++saab.se
Saab AB                 |Phone:  +46 (0)13 - 18 40 42
SE-581 88 Linkoping     |Fax:    +46 (0)13 - 18 41 77
SWEDEN                  |
---------------------------------------------------------



Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Fri May 16 2003 - 00:35:47 PDT