If the source is a BufferedImage with premultiplied alpha, the color components are divided by the alpha component before color conversion. If the destination is a BufferedImage with premultiplied alpha, the color components are multiplied by the alpha component after conversion. Rasters are treated as having no alpha channel, i.e. all bands are color bands.
If a RenderingHints object is specified in the constructor, the color rendering hint and the dithering hint may be used to control color conversion.
Note that Source and Destination may be the same object.
java.awt.RenderingHints#KEY_COLOR_RENDERING
, java.awt.RenderingHints#KEY_DITHERING
Modifier and Type | Field and Description |
---|---|
pack-priv ColorSpace[] | |
pack-priv float[] | |
pack-priv float[] | |
pack-priv boolean | |
pack-priv RenderingHints | |
pack-priv ICC_Profile[] | |
pack-priv float[] | |
pack-priv float[] | |
pack-priv ICC_Profile | |
pack-priv ColorTransform | |
pack-priv ICC_Profile | |
pack-priv ColorTransform |
Access | Constructor and Description |
---|---|
public | ColorConvertOp(RenderingHints
the hints)RenderingHints object used to control
the color conversion, or null Constructs a new ColorConvertOp which will convert from a source color space to a destination color space. |
public | ColorConvertOp(ColorSpace
defines the destination cspace, RenderingHints ColorSpace or an
intermediate ColorSpace the hints)RenderingHints object used to control
the color conversion, or null Constructs a new ColorConvertOp from a ColorSpace object. |
public | ColorConvertOp(ColorSpace
the source srcCspace, ColorSpace ColorSpace the destination dstCspace, RenderingHints ColorSpace the hints)RenderingHints object used to control
the color conversion, or null Constructs a new ColorConvertOp from two ColorSpace objects. |
public | ColorConvertOp(ICC_Profile[]
the array of profiles, RenderingHints ICC_Profile objectsthe hints)RenderingHints object used to control
the color conversion, or null Constructs a new ColorConvertOp from an array of ICC_Profiles. |
Modifier and Type | Method and Description |
---|---|
private static ColorSpace | |
public BufferedImage | Returns: aBufferedImage with the correct size and
number of bands from the specified src .Source image for the filter operation. src, ColorModel ColorModel of the destination. If null, an
appropriate ColorModel will be used. destCM)Implements java. |
private BufferedImage | |
public WritableRaster | Returns: aWritableRaster with the correct size and number
of bands from the specified src the specified src)Raster Implements java. |
public final BufferedImage | Returns: dest color converted from src
or a new, converted BufferedImage
if dest is null the source src, BufferedImage BufferedImage to be convertedthe destination dest)BufferedImage ,
or null Implements java. |
public final WritableRaster | Returns: dest color converted from src
or a new, converted WritableRaster
if dest is null the source src, WritableRaster Raster to be convertedthe destination dest)WritableRaster ,
or null Implements java. |
public final Rectangle2D | Returns: aRectangle2D that is the bounding box
of the destination, given the specified src the source src)BufferedImage Implements java. |
public final Rectangle2D | Returns: aRectangle2D that is the bounding box
of the destination, given the specified src the source src)Raster Implements java. |
public final ICC_Profile[] | Returns: the array ofICC_Profile objects of this
ColorConvertOp , or null if this
ColorConvertOp was not constructed with an
array of ICC_Profile objects.Returns the array of ICC_Profiles used to construct this ColorConvertOp. |
private void | |
private void | |
public final Point2D | Returns: dstPt after setting its location to be
the same as srcPt the specified source srcPt, Point2D Point2D the destination dstPt)Point2D Implements java. |
public final RenderingHints | Returns: theRenderingHints object of this
ColorConvertOp Implements java. |
private int | |
private BufferedImage | ICCBIFilter(BufferedImage src, ColorSpace srcColorSpace, BufferedImage dest, ColorSpace destColorSpace)
|
private BufferedImage | nonICCBIFilter(BufferedImage src, ColorSpace srcColorSpace, BufferedImage dst, ColorSpace dstColorSpace)
|
private WritableRaster | |
private void | |
private void |
CSList | back to summary |
---|---|
pack-priv ColorSpace[] CSList |
dstMaxVals | back to summary |
---|---|
pack-priv float[] dstMaxVals |
dstMinVals | back to summary |
---|---|
pack-priv float[] dstMinVals |
gotProfiles | back to summary |
---|---|
pack-priv boolean gotProfiles |
hints | back to summary |
---|---|
pack-priv RenderingHints hints |
profileList | back to summary |
---|---|
pack-priv ICC_Profile[] profileList |
srcMaxVals | back to summary |
---|---|
pack-priv float[] srcMaxVals |
srcMinVals | back to summary |
---|---|
pack-priv float[] srcMinVals |
thisDestProfile | back to summary |
---|---|
pack-priv ICC_Profile thisDestProfile |
thisRasterTransform | back to summary |
---|---|
pack-priv ColorTransform thisRasterTransform |
thisSrcProfile | back to summary |
---|---|
pack-priv ICC_Profile thisSrcProfile |
thisTransform | back to summary |
---|---|
pack-priv ColorTransform thisTransform |
ColorConvertOp | back to summary |
---|---|
public ColorConvertOp(RenderingHints hints) Constructs a new ColorConvertOp which will convert from a source color space to a destination color space. The RenderingHints argument may be null. This Op can be used only with BufferedImages, and will convert directly from the ColorSpace of the source image to that of the destination. The destination argument of the filter method cannot be specified as null.
|
ColorConvertOp | back to summary |
---|---|
public ColorConvertOp(ColorSpace cspace, RenderingHints hints) Constructs a new ColorConvertOp from a ColorSpace object.
The RenderingHints argument may be null. This
Op can be used only with BufferedImages, and is primarily useful
when the
|
ColorConvertOp | back to summary |
---|---|
public ColorConvertOp(ColorSpace srcCspace, ColorSpace dstCspace, RenderingHints hints) Constructs a new ColorConvertOp from two ColorSpace objects. The RenderingHints argument may be null. This Op is primarily useful for calling the filter method on Rasters, in which case the two ColorSpaces define the operation to be performed on the Rasters. In that case, the number of bands in the source Raster must match the number of components in srcCspace, and the number of bands in the destination Raster must match the number of components in dstCspace. For BufferedImages, the two ColorSpaces define intermediate spaces through which the source is converted before being converted to the destination space.
|
ColorConvertOp | back to summary |
---|---|
public ColorConvertOp(ICC_Profile[] profiles, RenderingHints hints) Constructs a new ColorConvertOp from an array of ICC_Profiles. The RenderingHints argument may be null. The sequence of profiles may include profiles that represent color spaces, profiles that represent effects, etc. If the whole sequence does not represent a well-defined color conversion, an exception is thrown. For BufferedImages, if the ColorSpace of the source BufferedImage does not match the requirements of the first profile in the array, the first conversion is to an appropriate ColorSpace. If the requirements of the last profile in the array are not met by the ColorSpace of the destination BufferedImage, the last conversion is to the destination's ColorSpace. For Rasters, the number of bands in the source Raster must match the requirements of the first profile in the array, and the number of bands in the destination Raster must match the requirements of the last profile in the array. The array must have at least two elements or calling the filter method for Rasters will throw an IllegalArgumentException.
|
createCompatibleColorSpace | back to summary |
---|---|
private static ColorSpace createCompatibleColorSpace(ICC_Profile profile) |
createCompatibleDestImage | back to summary |
---|---|
public BufferedImage createCompatibleDestImage(BufferedImage src, ColorModel destCM) Implements java. Creates a zeroed destination image with the correct size and number of bands, given this source.
|
createCompatibleDestImage | back to summary |
---|---|
private BufferedImage createCompatibleDestImage(BufferedImage src, ColorModel destCM, ColorSpace destCS) |
createCompatibleDestRaster | back to summary |
---|---|
public WritableRaster createCompatibleDestRaster(Raster src) Implements java. Creates a zeroed destination Raster with the correct size and number of bands, given this source.
|
filter | back to summary |
---|---|
public final BufferedImage filter(BufferedImage src, BufferedImage dest) Implements java. ColorConverts the source BufferedImage. If the destination image is null, a BufferedImage will be created with an appropriate ColorModel.
|
filter | back to summary |
---|---|
public final WritableRaster filter(Raster src, WritableRaster dest) Implements java. ColorConverts the image data in the source Raster. If the destination Raster is null, a new Raster will be created. The number of bands in the source and destination Rasters must meet the requirements explained above. The constructor used to create this ColorConvertOp must have provided enough information to define both source and destination color spaces. See above. Otherwise, an exception is thrown.
|
getBounds2D | back to summary |
---|---|
public final Rectangle2D getBounds2D(BufferedImage src) Implements java. Returns the bounding box of the destination, given this source. Note that this will be the same as the bounding box of the source.
|
getBounds2D | back to summary |
---|---|
public final Rectangle2D getBounds2D(Raster src) Implements java. Returns the bounding box of the destination, given this source. Note that this will be the same as the bounding box of the source.
|
getICC_Profiles | back to summary |
---|---|
public final ICC_Profile[] getICC_Profiles() Returns the array of ICC_Profiles used to construct this ColorConvertOp. Returns null if the ColorConvertOp was not constructed from such an array.
|
getMinMaxValsFromColorSpaces | back to summary |
---|---|
private void getMinMaxValsFromColorSpaces(ColorSpace srcCspace, ColorSpace dstCspace) |
getMinMaxValsFromProfiles | back to summary |
---|---|
private void getMinMaxValsFromProfiles(ICC_Profile srcProfile, ICC_Profile dstProfile) |
getPoint2D | back to summary |
---|---|
public final Point2D getPoint2D(Point2D srcPt, Point2D dstPt) Implements java. Returns the location of the destination point given a
point in the source. If |
getRenderingHints | back to summary |
---|---|
public final RenderingHints getRenderingHints() Implements java. Returns the rendering hints used by this op.
|
getRenderingIntent | back to summary |
---|---|
private int getRenderingIntent(ICC_Profile profile) Returns the RenderingIntent from the specified ICC Profile. |
ICCBIFilter | back to summary |
---|---|
private BufferedImage ICCBIFilter(BufferedImage src, ColorSpace srcColorSpace, BufferedImage dest, ColorSpace destColorSpace) |
nonICCBIFilter | back to summary |
---|---|
private BufferedImage nonICCBIFilter(BufferedImage src, ColorSpace srcColorSpace, BufferedImage dst, ColorSpace dstColorSpace) |
nonICCRasterFilter | back to summary |
---|---|
private WritableRaster nonICCRasterFilter(Raster src, WritableRaster dst) |
setMinMax | back to summary |
---|---|
private void setMinMax(int type, int nc, float[] minVals, float[] maxVals) |
updateBITransform | back to summary |
---|---|
private void updateBITransform(ICC_Profile srcProfile, ICC_Profile destProfile) |