org.apache.batik.ext.awt.image.rendered

Class ProfileRed

public class ProfileRed extends AbstractRed

This implementation of rendered image forces a color profile on its source
Constructor Summary
ProfileRed(CachableRed src, ICCColorSpaceExt colorSpace)
Method Summary
WritableRastercopyData(WritableRaster argbWR)
This method will turn the input image in an sRGB image as follows.
CachableRedgetSource()

Constructor Detail

ProfileRed

public ProfileRed(CachableRed src, ICCColorSpaceExt colorSpace)

Parameters: src Images on which the input ColorSpace should be forced colorSpace colorSpace that should be forced on the source

Method Detail

copyData

public WritableRaster copyData(WritableRaster argbWR)
This method will turn the input image in an sRGB image as follows. If there is no colorSpace defined, then the input image is simply converted to singlePixelPacked sRGB if needed. If there is a colorSpace defined, the the image data is 'interpreted' as being in that space, instead of that of the image's colorSpace. Here is how the input image is processed: a. It is converted to using a ComponentColorModel b. Its data is extracted, ignoring it's ColorSpace c. A new ComponentColorModel is built for the replacing colorSpace Note that if the number of components in the input image and the number of components in the replacing ColorSpace do not match, it is not possible to apply the conversion. d. A new BufferedImage is built, using the new ComponentColorModel and the data from the original image converted to the ComponentColorModel built in a. The alpha channel is excluded from that new BufferedImage. e. The BufferedImage created in d. is converted to sRGB using ColorConvertOp f. The alpha channel information is integrated back into the image. IMPORTANT NOTE: The code uses a BandedSampleModel in c.) and d.) and discard the alpha channel during the color conversions (it is restored in f.)), because of bugs in the interleaved model with alpha. The BandedSampleModel did not cause any bug as of JDK 1.3.

getSource

public CachableRed getSource()
Copyright B) 2008 Apache Software Foundation. All Rights Reserved.