13 #ifndef IMAGE_CROP_HPP
14 #define IMAGE_CROP_HPP
26 crop(
int row,
int column,
int height,
int width,
image *
L)
27 :
image(L), row(row), column(column), height(height), width(width) { }
29 virtual double get(
int i,
int j,
int k)
const
31 if (0 <= i && i < height &&
34 return L->
get(i + row, j + column, k);
42 virtual void doc(std::ostream& out)
const
44 out <<
"crop " << row <<
" " << column <<
" " << height <<
" " << width;
virtual double get(int i, int j, int k) const =0
Return the value of the sample at row i, column j, channel k.
Crop filter.
Definition: image_crop.hpp:20
image * L
Left child.
Definition: image.hpp:117
crop(int row, int column, int height, int width, image *L)
Crop image L to a size of height and width. Row and column give the location of the upper-left corner...
Definition: image_crop.hpp:26
Base class for all image sources, filters, and operators.
Definition: image.hpp:20
virtual int get_width() const
Return the height of this image.
Definition: image_crop.hpp:40
virtual int get_height() const
Return the height of this image.
Definition: image_crop.hpp:39
virtual void doc(std::ostream &out) const
Produce a string documenting the function of this object.
Definition: image_crop.hpp:42