javax.media.jai.operator
Class ColorConvertDescriptor

java.lang.Object
  extended byjavax.media.jai.OperationDescriptorImpl
      extended byjavax.media.jai.operator.ColorConvertDescriptor
All Implemented Interfaces:
OperationDescriptor, RegistryElementDescriptor, Serializable

public class ColorConvertDescriptor
extends OperationDescriptorImpl

An OperationDescriptor describing the "ColorConvert" operation.

The "ColorConvert" operation performs a pixel-by-pixel color conversion of the data in a rendered or renderable source image.

The data are treated as having no alpha channel, i.e., all bands are color bands. The color space of the source image is specified by the ColorSpace object of the source image ColorModel which must not be null. The color space of the destination image is specified by the ColorSpace of the "colorModel" parameter which must be a ColorModel. If a ColorModel is suggested via the RenderingHints it is ignored.

The calculation pathway is selected to optimize performance and accuracy based on which ColorSpace subclasses are used to represent the source and destination color spaces. The subclass categories are ICC_ColorSpace, ColorSpaceJAI, and generic ColorSpace, i.e., one which is not an instance of either the two aforementioned subclasses. Note that in the Sun Microsystems implementation, an ICC_ColorSpace instance is what is returned by ColorSpace.getInstance().

Integral data are assumed to occupy the full range of the respective data type; floating point data are assumed to be normalized to the range [0.0,1.0].

By default, the destination image bounds, data type, and number of bands are the same as those of the source image.

Resource List
Name Value
GlobalName ColorConvert
LocalName ColorConvert
Vendor com.sun.media.jai
Description Convert the color space of an image.
DocURL http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/operator/ColorConvertDescriptor.html
Version 1.0
arg0Desc The destination ColorModel.

Parameter List
Name Class Type Default Value
colorModel java.awt.image.ColorModel NO_PARAMETER_DEFAULT

See Also:
OperationDescriptor, ColorSpace, ICC_ColorSpace, ColorModel, ColorSpaceJAI, IHSColorSpace, Serialized Form

Field Summary
 
Fields inherited from class javax.media.jai.OperationDescriptorImpl
sourceNames, supportedModes
 
Fields inherited from interface javax.media.jai.OperationDescriptor
NO_PARAMETER_DEFAULT
 
Constructor Summary
ColorConvertDescriptor()
          Constructor.
 
Method Summary
static RenderedOp create(RenderedImage source0, ColorModel colorModel, RenderingHints hints)
          Convert the color space of an image.
static RenderableOp createRenderable(RenderableImage source0, ColorModel colorModel, RenderingHints hints)
          Convert the color space of an image.
 boolean isRenderableSupported()
          Returns true since renderable operation is supported.
 
Methods inherited from class javax.media.jai.OperationDescriptorImpl
arePropertiesSupported, getDefaultSourceClass, getDestClass, getDestClass, getInvalidRegion, getName, getNumParameters, getNumSources, getParamClasses, getParamDefaults, getParamDefaultValue, getParameterListDescriptor, getParamMaxValue, getParamMinValue, getParamNames, getPropertyGenerators, getPropertyGenerators, getRenderableDestClass, getRenderableSourceClasses, getResourceBundle, getResources, getSourceClasses, getSourceClasses, getSourceNames, getSupportedModes, isImmediate, isModeSupported, isRenderedSupported, makeDefaultSourceClassList, validateArguments, validateArguments, validateParameters, validateParameters, validateRenderableArguments, validateRenderableSources, validateSources, validateSources
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColorConvertDescriptor

public ColorConvertDescriptor()
Constructor.

Method Detail

isRenderableSupported

public boolean isRenderableSupported()
Returns true since renderable operation is supported.

Specified by:
isRenderableSupported in interface OperationDescriptor
Overrides:
isRenderableSupported in class OperationDescriptorImpl
See Also:
OperationDescriptorImpl.isModeSupported(java.lang.String)

create

public static RenderedOp create(RenderedImage source0,
                                ColorModel colorModel,
                                RenderingHints hints)
Convert the color space of an image.

Creates a ParameterBlockJAI from all supplied arguments except hints and invokes JAI.create(String,ParameterBlock,RenderingHints).

Parameters:
source0 - RenderedImage source 0.
colorModel - The destination color space.
hints - The RenderingHints to use. May be null.
Returns:
The RenderedOp destination.
Throws:
IllegalArgumentException - if source0 is null.
IllegalArgumentException - if colorModel is null.
See Also:
JAI, ParameterBlockJAI, RenderedOp

createRenderable

public static RenderableOp createRenderable(RenderableImage source0,
                                            ColorModel colorModel,
                                            RenderingHints hints)
Convert the color space of an image.

Creates a ParameterBlockJAI from all supplied arguments except hints and invokes JAI.createRenderable(String,ParameterBlock,RenderingHints).

Parameters:
source0 - RenderableImage source 0.
colorModel - The destination color space.
hints - The RenderingHints to use. May be null.
Returns:
The RenderableOp destination.
Throws:
IllegalArgumentException - if source0 is null.
IllegalArgumentException - if colorModel is null.
See Also:
JAI, ParameterBlockJAI, RenderableOp