69 if (im.in_range(i,j,p))
77 in_border(
const imT& im,
int i,
int j,
int p = 0)
const 84 if (i < 0) i = 0;
else if (i >= (
int)im.ni()) i = im.ni()-1;
85 if (j < 0) j = 0;
else if (j >= (
int)im.nj()) j = im.nj()-1;
86 if (p < 0) p = 0;
else if (p >= (
int)im.nplanes()) p = im.nplanes()-1;
89 if (i < 0) i = -i-1;
else if (i >= (
int)im.ni()) i = 2*im.ni()-i-1;
90 if (j < 0) j = -j-1;
else if (j >= (
int)im.nj()) j = 2*im.nj()-j-1;
91 if (p < 0) p = -p-1;
else if (p >= (
int)im.nplanes()) p = 2*im.nplanes()-p-1;
94 if (i < 0) i = im.ni()-((-i)%im.ni());
97 if (j < 0) j = im.nj()-((-j)%im.nj());
100 if (p < 0) p = im.nplanes()-((-p)%im.nplanes());
101 else p = p%im.nplanes();
190 #endif // vil_border_h_ Border pixels take the value of the closest image point.
const pixel_type & constant_value() const
If border kind is vil_border_constant, returns the border value.
const pixel_type & operator()(int i, int j, int p=0) const
Returns a const reference on the pixel (i,j,p).
Border pixels take the value of the image point which is its symmetric w.r.t. the closest image edge.
Border class. Makes pixel access outside image range transparent and configurable.
imT::pixel_type pixel_type
The image is seen as periodic, after the right (respectively bottom) edge comes the left (respectivel...
vil_border< imT > vil_border_create_periodic(const imT &)
Instantiate a reflect border whose type is derived from imT.
imT::pixel_type pixel_type
vil_border_mode
Vil border modes.
Provides a pixel accessor which is syntax-compatible with vil_image_view.
Border pixels are constant.
bool is_constant() const
True if border values are constant.
vil_border< imT > vil_border_create_geodesic(const imT &)
Instantiate a geodesic border whose type is derived from imT.
vil_border()
Default constructor, creates a constant border.
vil_border_mode kind() const
Get the current border kind.
vil_border< imT > vil_border_create_reflect(const imT &)
Instantiate a reflect border whose type is derived from imT.
vil_border_accessor< imT > vil_border_create_accessor(const imT &im, const vil_border< imT > &border)
Instantiates a border accessor, provided for convenience.
const pixel_type & operator()(const imT &im, int i, int j, int p=0) const
Return read-only reference to pixel at (i,j,p) on the given image.
vil_border_mode border_kind_
vil_border< imT > vil_border_create_constant(const imT &, typename imT::pixel_type constant_val=0)
Instantiate a constant border whose type is derived from imT.
vil_border_accessor(const imT &img, const vil_border< imT > &brdr)
Constructor.
pixel_type constant_value_
void set_kind(vil_border_mode brdr_kind)
Set the border kind.
void set_constant_value(const pixel_type &val)
Set the border value if the border kind is vil_border_constant.
const pixel_type & in_border(const imT &im, int i, int j, int p=0) const