*/
//verify again pci32.pdf before changing below
PDColorSpace pcs = params.getColorSpace();
ColorModel colorModel = null;
if(pcs != null)
{
colorModel =
params.getColorSpace().createColorModel(
params.getBitsPerComponent() );
}
else
{
byte[] transparentColors = new
byte[]{(byte)0xFF,(byte)0xFF};
byte[] colors=new byte[]{0, (byte)0xFF};
colorModel = new IndexColorModel( 1, 2,
colors, colors, colors, transparentColors );
}
List filters = params.getFilters();
byte[] finalData = null;
if( filters == null )
{
finalData = getImageData();
}
else
{
ByteArrayInputStream in = new ByteArrayInputStream( getImageData() );
ByteArrayOutputStream out = new ByteArrayOutputStream(getImageData().length);
FilterManager filterManager = new FilterManager();
for( int i=0; i<filters.size(); i++ )
{
out.reset();
Filter filter = filterManager.getFilter( (String)filters.get( i ) );
filter.decode( in, out, params.getDictionary() );
in = new ByteArrayInputStream( out.toByteArray() );
}
finalData = out.toByteArray();
}
WritableRaster raster = colorModel.createCompatibleWritableRaster( params.getWidth(), params.getHeight() );
/* Raster.createPackedRaster(
buffer,
params.getWidth(),
params.getHeight(),
params.getBitsPerComponent(),