GDAL community,
 
Is is plausible to contain a RGB image array (as pixel interleaved, 
rgbrgbrgbrgb) in a single MEMRasterBand to generate a color file via 
GDALCreateCopy()?
My application performs the following sequence:
 
1. Read a color image into an image buffer in pixel interleaved (rgbrgbrgb) 
format.
2. Setup MEM Driver to contain the recently read in image from step 1 above via 
AddBand().
3. Call GDALCreateCopy() on the specific output of my desire.
 
I have a question on Step 2 above (AddBand()).  Do I have to create 3 seperate 
bands to contain individual color component?  That would mean I have to take my 
RGB image buffer and seperate it into three new arrays of size (imageWidth * 
imageHeight) and call AddBands() on each one.
 
I am trying to adviod that step as I find it as an extra step.  However, I 
understand if I have to because for a given color image GDAL always represents 
the file with 3 or 4 bands.  
 
My answer is I will probably have to.  My application can write out a valid 
file, but the resulting file is in Greyscale.
 
Robert
_______________________________________________
gdal-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to