<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.3059" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hello everyone,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>does anyone know a possibility to convert 
RGBA-vtkImageData to RGB-vtkImageData?</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>I have to connect an OpenGL-application with a 
VTK-client. </FONT></DIV>
<DIV> </DIV><FONT face=Arial size=2>
<DIV><BR>On OpenGL-side:<BR>unsigned char pdata = new unsigned 
char[width*height*4];<BR>glReadPixels(0,0,width,height,GL_RGBA,GL_UNSIGNED_BYTE,pdata);</DIV>
<DIV> </DIV>
<DIV>The pdata-array holds the pixel-data as RGBA.</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><BR>The VTK-application-side:<BR>vtkImageImport *imageImport = 
vtkImageImport::New();<BR>    
imageImport->SetNumberOfScalarComponents(4);<BR>    
imageImport->SetWholeExtent(0,width-1,0,height-1,0,0);<BR>    
imageImport->SetDataExtentToWholeExtent();<BR>    
imageImport->SetDataScalarTypeToUnsignedChar();<BR>    
imageImport->SetImportVoidPointer(pdata);</DIV>
<DIV> </DIV>
<DIV><BR>imageImport->GetOutput() delivers RGBA-vtkImageData but the 
VTK-client is only able to handle RGB vtkImageData. </DIV>
<DIV> </DIV>
<DIV>The client-application is supposed to work in real time, so a simple 
reorganisation of the data-array<BR>is impossible because it takes to much 
time.</DIV>
<DIV> </DIV>
<DIV>Does VTK provide a method to get rid of the Alpha-part?</DIV>
<DIV> </DIV>
<DIV><BR>Thanks,<BR>Andreas</FONT></DIV></BODY></HTML>