13 #ifndef IMAGE_REDUCE_HPP
14 #define IMAGE_REDUCE_HPP
30 virtual double get(
int i,
int j,
int k)
const
32 return (
L->
get(i * 2 + 0, j * 2 + 0, k) +
33 L->
get(i * 2 + 0, j * 2 + 1, k) +
34 L->
get(i * 2 + 1, j * 2 + 0, k) +
35 L->
get(i * 2 + 1, j * 2 + 1, k)) / 4.0;
41 virtual void doc(std::ostream& out)
const
virtual double get(int i, int j, int k) const =0
Return the value of the sample at row i, column j, channel k.
image * L
Left child.
Definition: image.hpp:117
Base class for all image sources, filters, and operators.
Definition: image.hpp:20
50% down-sample filter
Definition: image_reduce.hpp:20
virtual int get_height() const
Return the height of this image.
Definition: image.hpp:46
virtual int get_width() const
Return the height of this image.
Definition: image_reduce.hpp:39
reduce(image *L)
Apply a 2-by-2 box-filtered down-sampling to image L. The height and width of the result will be exac...
Definition: image_reduce.hpp:28
virtual int get_width() const
Return the height of this image.
Definition: image.hpp:56
virtual int get_height() const
Return the height of this image.
Definition: image_reduce.hpp:38
virtual void doc(std::ostream &out) const
Produce a string documenting the function of this object.
Definition: image_reduce.hpp:41