Catalano.Imaging.Filters
Class RotateNearestNeighbor
- java.lang.Object
-
- Catalano.Imaging.Filters.RotateNearestNeighbor
-
- All Implemented Interfaces:
- IApply, IApplyInPlace
public class RotateNearestNeighbor extends java.lang.Object implements IApply, IApplyInPlace
Rotate image using nearest neighbor algorithm.The class implements image rotation filter using nearest neighbor algorithm, which does not assume any interpolation. Rotation is performed in counterclockwise direction.
-
-
Constructor Summary
Constructors Constructor and Description RotateNearestNeighbor(double angle)Initialize a new instance of the RotateNearestNeighbor class.RotateNearestNeighbor(double angle, boolean keepSize)Initialize a new instance of the RotateNearestNeighbor class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description FastBitmapapply(FastBitmap fastBitmap)Apply the filtervoidapplyInPlace(FastBitmap fastBitmap)Apply filter to an image.doublegetAngle()Get Angle.booleanisKeepSize()Keep original size.voidsetAngle(double angle)Set Angle.voidsetFillColor(int gray)Set Fill color.voidsetFillColor(int red, int green, int blue)Set Fill color.voidsetKeepSize(boolean keepSize)Set keep original size.
-
-
-
Constructor Detail
-
RotateNearestNeighbor
public RotateNearestNeighbor(double angle)
Initialize a new instance of the RotateNearestNeighbor class.- Parameters:
angle- Angle [0..360].
-
RotateNearestNeighbor
public RotateNearestNeighbor(double angle, boolean keepSize)Initialize a new instance of the RotateNearestNeighbor class.- Parameters:
angle- Angle [0..360].keepSize- Keep original size.
-
-
Method Detail
-
getAngle
public double getAngle()
Get Angle.- Returns:
- Angle.
-
setAngle
public void setAngle(double angle)
Set Angle.- Parameters:
angle- Angle.
-
isKeepSize
public boolean isKeepSize()
Keep original size.- Returns:
- True if keep the original image size, otherwise false.
-
setKeepSize
public void setKeepSize(boolean keepSize)
Set keep original size.- Parameters:
keepSize- True if keep the original image size, otherwise false.
-
setFillColor
public void setFillColor(int red, int green, int blue)Set Fill color.- Parameters:
red- Red channel's value.green- Green channel's value.blue- Blue channel's value.
-
setFillColor
public void setFillColor(int gray)
Set Fill color.- Parameters:
gray- Gray channel's value.
-
apply
public FastBitmap apply(FastBitmap fastBitmap)
Description copied from interface:IApplyApply the filter
-
applyInPlace
public void applyInPlace(FastBitmap fastBitmap)
Description copied from interface:IApplyInPlaceApply filter to an image.- Specified by:
applyInPlacein interfaceIApplyInPlace- Parameters:
fastBitmap- Image to be processed.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG