Package com.luciad.imaging.operator
Class TLcdColorConvertOp
java.lang.Object
com.luciad.imaging.operator.ALcdImageOperator
com.luciad.imaging.operator.TLcdColorConvertOp
Performs a color space conversion.
The supported conversions are:
indexed -> indexed
indexed -> RGB + alpha
gray scale -> gray scale
gray scale -> RGB (+ alpha)
gray scale + alpha -> sRGB (+ alpha)
RGB (+alpha) -> RGB (+ alpha)
Example
Convert to RGB default
// Using the static method:
ColorModel destinationColorModel = ColorModel.getRGBdefault();
ALcdImage inputImage = ...;
ALcdImage outputImage = TLcdColorConvertOp.colorConvert(inputImage, destinationColorModel);
// Using a data object:
ColorModel destinationColorModel = ColorModel.getRGBdefault();
ALcdImage inputImage = ...;
TLcdColorConvertOp op = new TLcdColorConvertOp();
ILcdDataObject params = op.getParameterDataType().newInstance();
params.setValue(TLcdColorConvertOp.INPUT_IMAGE, inputImage);
params.setValue(TLcdColorConvertOp.COLOR_MODEL, destinationColorModel);
ALcdImage outputImage = op.apply(params);
Input
Output
- Since:
- 2014.0
-
Nested Class Summary
Nested classes/interfaces inherited from class com.luciad.imaging.operator.ALcdImageOperator
ALcdImageOperator.ImageOperatorTypeBuilder
-
Field Summary
Modifier and TypeFieldDescriptionstatic final TLcdDataType
Input data type of the operator.static final TLcdDataProperty
Target color model.static final TLcdDataProperty
The input image.static final String
Name of the operator.Fields inherited from class com.luciad.imaging.operator.ALcdImageOperator
INPUT_IMAGE_NAME
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionapply
(ILcdDataObject aParameters) Applies this operator to the given input parameters.static ALcdImage
colorConvert
(ALcdImage aSource, ColorModel aColorModel) Perform a color conversion on an image.Methods inherited from class com.luciad.imaging.operator.ALcdImageOperator
createTypeBuilder, createTypeBuilder, equals, getParameterDataType, hashCode, toString
-
Field Details
-
NAME
Name of the operator.- See Also:
-
INPUT_IMAGE
The input image. -
COLOR_MODEL
Target color model. -
COLOR_CONVERT_FILTER_TYPE
Input data type of the operator.
-
-
Constructor Details
-
TLcdColorConvertOp
public TLcdColorConvertOp()Default constructor.
-
-
Method Details
-
apply
Description copied from class:ALcdImageOperator
Applies this operator to the given input parameters. The parameters are stored in a data object which must be of the type given by ALcdImageOperator.getParameterDataType().- Specified by:
apply
in classALcdImageOperator
- Parameters:
aParameters
- the parameters for the operator- Returns:
- the image produced by the operator
-
colorConvert
Perform a color conversion on an image.- Parameters:
aSource
- the input image.aColorModel
- the target color model.- Returns:
- an image equivalent to the input image with the specified color model.
-