## org.apache.batik.ext.awt.image.rendered
Class ProfileRed

    java.lang.Object
      org.apache.batik.ext.awt.image.rendered.AbstractRed
          org.apache.batik.ext.awt.image.rendered.ProfileRed

All Implemented Interfaces:
  CachableRed, java.awt.image.RenderedImage

public class ProfileRed
extends AbstractRed

This implementation of rendered image forces a color profile on its source

Field Summary

Fields inherited from class org.apache.batik.ext.awt.image.rendered.AbstractRed
`bounds, cm, minTileX, minTileY, numXTiles, numYTiles, props, sm, srcs, tileGridXOff, tileGridYOff, tileHeight, tileWidth`

Constructor Summary
`ProfileRed(CachableRed src, ICCColorSpaceExt colorSpace)`

Method Summary
`java.awt.image.WritableRaster` `copyData(java.awt.image.WritableRaster argbWR)` This method will turn the input image in an sRGB image as follows.
`CachableRed` `getSource()`

Methods inherited from class org.apache.batik.ext.awt.image.rendered.AbstractRed
`copyBand, copyToRaster, getBounds, getColorModel, getData, getData, getDependencyRegion, getDirtyRegion, getHeight, getMinTileX, getMinTileY, getMinX, getMinY, getNumXTiles, getNumYTiles, getProperty, getPropertyNames, getSampleModel, getSources, getTile, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileWidth, getWidth, getXTile, getYTile, init, init, makeTile, updateTileGridInfo`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

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

### getSource

    public CachableRed getSource()

### copyData

    public java.awt.image.WritableRaster copyData(java.awt.image.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.

Copyright © 2004 Apache Software Foundation. All Rights Reserved.