17 # include <vcl_msvc_warnings.h> 27 src.
nj() == dest.
nj() &&
28 src.
ni() == dest.
ni());
29 for (
unsigned p = 0; p < src.
nplanes(); ++p)
30 for (
unsigned j = 0; j < src.
nj(); ++j)
31 for (
unsigned i = 0; i < src.
ni(); ++i)
33 const T
v = src(i,j,p);
34 dest(i,j,p) =
v<lo?lo:(
v>hi?hi:
v);
53 unsigned ni()
const override {
return src_->ni(); }
54 unsigned nj()
const override {
return src_->nj(); }
60 unsigned j0,
unsigned nj)
const override;
63 unsigned j0,
unsigned nj)
const override {
71 bool get_property(
char const* tag,
void* property_value =
nullptr)
const override;
89 for (
unsigned int p=0; p<src.
nplanes(); ++p,planeA+=pstepA)
92 for (
unsigned int j=0; j<src.
nj(); ++j,rowA+=jstepA)
95 for (
unsigned int i=0; i<src.
ni(); ++i,pixelA+=istepA)
109 for (
unsigned int p=0; p<src.
nplanes(); ++p,planeA+=pstepA)
112 for (
unsigned int j=0; j<src.
nj(); ++j,rowA+=jstepA)
115 for (
unsigned int i=0; i<src.
ni(); ++i,pixelA+=istepA)
139 #endif // vil_clamp_h_ An abstract base class of smart pointers to actual image data in memory.
unsigned nplanes() const override
Dimensions: Planes x ni x nj.
void vil_clamp(const vil_image_view< T > &src, vil_image_view< T > &dest, T lo, T hi)
Clamp an image view between two values.
double hi_
Upper clamp value.
Concrete view of image data of type T held in memory.
unsigned ni() const override
Dimensions: Planes x ni x nj.
friend vil_image_resource_sptr vil_clamp(const vil_image_resource_sptr &src, double low, double hi)
Clamp an image resource between two values.
void vil_clamp_above(vil_image_view< T > &src, T t, T v)
Clamp an image view below a given value t, setting it to v if above or on t.
A generic_image adaptor that behaves like a clamped version of its input.
std::ptrdiff_t jstep() const
Add this to your pixel pointer to get next j pixel.
unsigned ni() const
Width.
unsigned nj() const
Height.
std::ptrdiff_t planestep() const
Add this to your pixel pointer to get pixel on next plane.
unsigned nj() const override
Dimensions: Planes x ni x nj.
bool put_view(const vil_image_view_base &, unsigned, unsigned) override
Put the data in this view back into the image source.
double lo_
Lower clamp value.
Abstract representation of an image source or image destination.
vil_image_view_base_sptr get_view(unsigned i0, unsigned ni, unsigned j0, unsigned nj) const override
Create a read/write view of the data.
vil_image_view_base_sptr get_copy_view() const
Create a read/write view of a copy of all the data.
A base class reference-counting view of some image data.
T * top_left_ptr()
Pointer to the first (top left in plane 0) pixel.
vil_image_resource_sptr src_
Reference to underlying image source.
unsigned nplanes() const
Number of planes.
void vil_clamp_below(vil_image_view< T > &src, T t, T v)
Clamp an image view above a given value t, setting it to v if below or on t.
enum vil_pixel_format pixel_format() const override
Pixel Format.
Representation of a generic image source or destination.
std::ptrdiff_t istep() const
Add this to your pixel pointer to get next i pixel.
vil_clamp_image_resource(vil_image_resource_sptr const &, double low, double high)
bool get_property(char const *tag, void *property_value=nullptr) const override
Extra property information.