[PATCH] Adds a transparent color index for handling empty CADRG subblocks
Currently, NITFRasterBand::IReadBlock returns a block with color index 0 if there is no noDataValue (see code below). Unfortunatelly a lot of CADRG products (no to say all of them) do not define a transparent color. My patch consists in adding an extra color index for transparency if there is none in the product. Thus, empty subblocks will be displayed with this transparent color.
else /* nBlockResult == BLKREAD_NULL */
{
if( psImage->bNoDataSet )
memset( pImage, psImage->nNoDataValue,
psImage->nWordSize*psImage->nBlockWidth*psImage->nBlockHeight);
else
memset( pImage, 0,
psImage->nWordSize*psImage->nBlockWidth*psImage->nBlockHeight);
return CE_None;
}
Even,
This patch looks ok. Go ahead and apply it, but only in trunk. I don't want risky behavior changes in 1.4.3.
PS. please include "nitf" in keywords for all nitf driver bugs.