public class TLcdCurvesOp extends ALcdImageOperator
// 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);
Modifier and Type | Class and Description |
---|---|
static class |
TLcdCurvesOp.CurveType
Defines the types of curves that can be used to interpolate between
control points.
|
ALcdImageOperator.ImageOperatorTypeBuilder
Modifier and Type | Field and Description |
---|---|
static TLcdDataProperty |
CONTROL_POINTS
Control points for the curve.
|
static TLcdDataProperty |
CURVE_TYPE
Type of the curve.
|
static TLcdDataType |
CURVES_FILTER_TYPE
Input data type of the operator.
|
static TLcdDataProperty |
INPUT_IMAGE
The input image.
|
static String |
NAME
Name of the operator.
|
INPUT_IMAGE_NAME
Constructor and Description |
---|
TLcdCurvesOp()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
ALcdImage |
apply(ILcdDataObject aParameters)
Applies this operator to the given input parameters.
|
static ALcdImage |
curves(ALcdImage aInputImage,
ILcdPoint[][] aCurves,
TLcdCurvesOp.CurveType aCurveType)
Creates a curves operator for a given input image.
|
createTypeBuilder, createTypeBuilder, equals, getParameterDataType, hashCode, toString
public static final String NAME
public static final TLcdDataProperty INPUT_IMAGE
public static final TLcdDataProperty CONTROL_POINTS
public static final TLcdDataProperty CURVE_TYPE
public static final TLcdDataType CURVES_FILTER_TYPE
public ALcdImage apply(ILcdDataObject aParameters)
ALcdImageOperator
apply
in class ALcdImageOperator
aParameters
- the parameters for the operatorpublic static ALcdImage curves(ALcdImage aInputImage, ILcdPoint[][] aCurves, TLcdCurvesOp.CurveType aCurveType)
aInputImage
- the image to be processedaCurves
- the control points for each defined curveaCurveType
- the type of curve used to interpolate between the control points