Class TLcdColorConvertOp

java.lang.Object
com.luciad.imaging.operator.ALcdImageOperator
com.luciad.imaging.operator.TLcdColorConvertOp

public final class TLcdColorConvertOp extends ALcdImageOperator
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
  • Field Details

    • NAME

      public static final String NAME
      Name of the operator.
      See Also:
    • INPUT_IMAGE

      public static final TLcdDataProperty INPUT_IMAGE
      The input image.
    • COLOR_MODEL

      public static final TLcdDataProperty COLOR_MODEL
      Target color model.
    • COLOR_CONVERT_FILTER_TYPE

      public static final TLcdDataType COLOR_CONVERT_FILTER_TYPE
      Input data type of the operator.
  • Constructor Details

    • TLcdColorConvertOp

      public TLcdColorConvertOp()
      Default constructor.
  • Method Details

    • apply

      public ALcdImage apply(ILcdDataObject aParameters)
      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 class ALcdImageOperator
      Parameters:
      aParameters - the parameters for the operator
      Returns:
      the image produced by the operator
    • colorConvert

      public static ALcdImage colorConvert(ALcdImage aSource, ColorModel aColorModel)
      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.