public class TLcdCropOp extends ALcdImageOperator
// Using the static method:
ALcdBasicImage inputImage = ...;
ALcdImage outputImage = TLcdCropOp.crop(inputImage, 600, 50, 200, 175);
// Using a data object:
ALcdBasicImage inputImage = ...;
TLcdCropOp op = new TLcdCropOp();
ILcdDataObject params = op.getParameterDataType().newInstance();
params.setValue(TLcdCropOp.INPUT_IMAGE, inputImage);
params.setValue(TLcdCropOp.CROP_X, 600);
params.setValue(TLcdCropOp.CROP_Y, 50);
params.setValue(TLcdCropOp.CROP_WIDTH, 200);
params.setValue(TLcdCropOp.CROP_HEIGHT, 175);
ALcdImage outputImage = op.apply(params);
ALcdImageOperator.ImageOperatorTypeBuilder
Modifier and Type | Field and Description |
---|---|
static TLcdDataType |
CROP_FILTER_TYPE
Input data type of the operator.
|
static TLcdDataProperty |
CROP_HEIGHT
Height of the cropped region.
|
static TLcdDataProperty |
CROP_WIDTH
Width of the cropped region.
|
static TLcdDataProperty |
CROP_X
X coordinate of the cropped region.
|
static TLcdDataProperty |
CROP_Y
Y coordinate of the cropped region.
|
static TLcdDataProperty |
INPUT_IMAGE
The input image.
|
static String |
NAME
Name of the operator.
|
INPUT_IMAGE_NAME
Constructor and Description |
---|
TLcdCropOp()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
ALcdImage |
apply(ILcdDataObject aParameters)
Applies this operator to the given input parameters.
|
static ALcdImage |
crop(ALcdBasicImage aSource,
int aCropX,
int aCropY,
int aCropWidth,
int aCropHeight)
Creates a crop 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 CROP_X
public static final TLcdDataProperty CROP_Y
public static final TLcdDataProperty CROP_WIDTH
public static final TLcdDataProperty CROP_HEIGHT
public static final TLcdDataType CROP_FILTER_TYPE
public ALcdImage apply(ILcdDataObject aParameters)
ALcdImageOperator
apply
in class ALcdImageOperator
aParameters
- the parameters for the operatorpublic static ALcdImage crop(ALcdBasicImage aSource, int aCropX, int aCropY, int aCropWidth, int aCropHeight)
aSource
- the image to be processedaCropX
- x coordinate of the cropped regionaCropY
- y coordinate of the cropped regionaCropWidth
- width of the cropped regionaCropHeight
- height of the cropped region