Class TLcdCurvesOp

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

public class TLcdCurvesOp extends ALcdImageOperator
Remaps the values in an image using curves which can be specified by the user. The curves represent functions which map an input level to an output level, and can be used to selectively brighten or darken parts of the spectrum.

Example


 // Using the static method:
 ALcdImage inputImage = ...;
 TLcdCurvesOp.CurveType curveType = TLcdCurvesOp.CurveType.CATMULL_ROM;
 ILcdPoint[][] controlPoints = {{new TLcdXYPoint(0, 0), new TLcdXYPoint(0.5, 0.5), new TLcdXYPoint(1, 1)},
                          {new TLcdXYPoint(0, 0), new TLcdXYPoint(0.25, 0.25), new TLcdXYPoint(0.5, 0.5), new TLcdXYPoint(1, 1)},
                          {new TLcdXYPoint(0, 0), new TLcdXYPoint(0.25, 0.1),
                          new TLcdXYPoint(0.5, 1), new TLcdXYPoint(0.75, 0.1), new TLcdXYPoint(1, 0)},
                          {new TLcdXYPoint(0, 0), new TLcdXYPoint(0.5, 0.5), new TLcdXYPoint(1, 1)}};

 ALcdImage outputImage = TLcdCurvesOp.curves(inputImage,controlPoints,curveType);

 // Using a data object:
 ALcdImage inputImage = ...;
 TLcdCurvesOp op = new TLcdCurvesOp();
 ILcdPoint[][] controlPoints = {{new TLcdXYPoint(0, 0), new TLcdXYPoint(0.5, 0.5), new TLcdXYPoint(1, 1)},
                          {new TLcdXYPoint(0, 0), new TLcdXYPoint(0.25, 0.25), new TLcdXYPoint(0.5, 0.5), new TLcdXYPoint(1, 1)},
                          {new TLcdXYPoint(0, 0), new TLcdXYPoint(0.25, 0.1),
                          new TLcdXYPoint(0.5, 1), new TLcdXYPoint(0.75, 0.1), new TLcdXYPoint(1, 0)},
                          {new TLcdXYPoint(0, 0), new TLcdXYPoint(0.5, 0.5), new TLcdXYPoint(1, 1)}};

 ILcdDataObject params = op.getParameterDataType().newInstance();
 params.setValue(TLcdCurvesOp.INPUT_IMAGE,inputImage);
 params.setValue(TLcdCurvesOp.CURVE_TYPE,TLcdCurvesOp.CurveType.CATMULL_ROM);
 params.setValue(TLcdCurvesOp.CONTROL_POINTS,controlPoints);
 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.
    • CONTROL_POINTS

      public static final TLcdDataProperty CONTROL_POINTS
      Control points for the curve.
    • CURVE_TYPE

      public static final TLcdDataProperty CURVE_TYPE
      Type of the curve.
    • CURVES_FILTER_TYPE

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

    • TLcdCurvesOp

      public TLcdCurvesOp()
      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
    • curves

      public static ALcdImage curves(ALcdImage aInputImage, ILcdPoint[][] aCurves, TLcdCurvesOp.CurveType aCurveType)
      Creates a curves operator for a given input image. The operator takes a list of lists containing the control points. It is required that either one curve is defined or one curve per channel. If only one curve is defined, this curve will be used for all channels. If there are less curves than channels, the first curve will be used for all channels. The curve type can also be configured.
      Parameters:
      aInputImage - the image to be processed
      aCurves - the control points for each defined curve
      aCurveType - the type of curve used to interpolate between the control points
      Returns:
      the curves operator