fast::ImageCropper class

Process object from cropping an image.

Uses Image::crop

Base classes

class ProcessObject
Abstract base class for all process objects.

Public functions

auto create(VectorXi size, VectorXi offset) -> std::shared_ptr<ImageCropper>
Create instance.
auto create(float cropBottom, float cropTop) -> std::shared_ptr<ImageCropper>
Create instance.
void setOffset(VectorXi offset)
void setSize(VectorXi size)
void allowOutOfBoundsCropping(bool allow)
void setCropBottom(float fraction)
void setCropTop(float fraction)

Private functions

void execute() virtual

Function documentation

std::shared_ptr<ImageCropper> fast::ImageCropper::create(VectorXi size, VectorXi offset)

Create instance.

size Cropping size
offset Offset for cropping
Returns instance

std::shared_ptr<ImageCropper> fast::ImageCropper::create(float cropBottom, float cropTop)

Create instance.

cropBottom Percent of bottom to remove
cropTop Percent of top to remove
Returns instance

void fast::ImageCropper::allowOutOfBoundsCropping(bool allow)

If out of bounds cropping is allowed, offset can be negative and size can be larger than image. Any pixels outside of image will be replaced with 0.