[vtkusers] RGB to RGBA
francesco caruso
guernika_devel at yahoo.it
Wed Sep 15 11:41:00 EDT 2004
Hello
I've got to "translate" an rgb unsigned char array into an RGBA image data.
I can translate it into an RGB image data in the way as follow:
void v4aDispImage(unsigned char* image)
{
vtkImageImport* imageImporter = vtkImageImport::New();
imageImporter->SetDataScalarTypeToUnsignedChar();
imageImporter->SetNumberOfScalarComponents( bpp );
imageImporter->SetDataSpacing( 1,1,1 );
imageImporter->SetWholeExtent(0,xsize-1,0,ysize-1,0,0);
imageImporter->SetDataOrigin(-xsize/2,-ysize/2,0);
imageImporter->SetImportVoidPointer( image );
imageActor->SetInput( imageImporter->GetOutput() );
[..]
}
How can I get an RGBA imagedata with A = 0 instead?
thanks in advance
More information about the vtkusers
mailing list