16 # include <vcl_msvc_warnings.h> 34 unsigned j0,
unsigned nj)
const 37 if (!vs)
return nullptr;
39 switch (vs->pixel_format())
41 #define macro( F , T ) \ 43 return new vil_image_view<T > (vil_plane(static_cast<const vil_image_view<T >&>(*vs), plane_)); 48 macro(VIL_PIXEL_FORMAT_UINT_64 , vxl_uint_64 )
49 macro(VIL_PIXEL_FORMAT_INT_64 , vxl_int_64 )
67 unsigned j0,
unsigned nj)
const 70 if (!vs)
return nullptr;
72 switch (vs->pixel_format())
74 #define macro( F , T ) \ 76 return new vil_image_view<T > (vil_plane(static_cast<const vil_image_view<T >&>(*vs), plane_)); 81 macro(VIL_PIXEL_FORMAT_UINT_64 , vxl_uint_64 )
82 macro(VIL_PIXEL_FORMAT_INT_64 , vxl_int_64 )
101 unsigned i0,
unsigned j0)
103 if (im.
nplanes() != 1)
return false;
105 if (!vs || im.
pixel_format() != vs->pixel_format())
return false;
107 switch (vs->pixel_format())
109 #define macro( F , T ) \ 111 const vil_image_view<T > view = static_cast<const vil_image_view<T >&>(im); \ 112 vil_image_view<T > plane = vil_plane(static_cast<vil_image_view<T >&>(*vs), plane_); \ 113 if (view == plane) return true; \ 114 for (unsigned j=0;j<view.nj();++j) \ 115 for (unsigned i=0;i<view.ni();++i) \ 116 plane(i,j) = view(i,j); \ 117 return src_->put_view(*vs, i0, j0); } 122 macro(VIL_PIXEL_FORMAT_UINT_64 , vxl_uint_64 )
123 macro(VIL_PIXEL_FORMAT_INT_64 , vxl_int_64 )
An abstract base class of smart pointers to actual image data in memory.
unsigned ni() const override
Dimensions: Planes x ni x nj.
unsigned nplanes() const override
Dimensions: Planes x ni x nj.
vil_image_resource_sptr src_
Reference to underlying image source.
unsigned nj() const override
Dimensions: Planes x ni x nj.
unsigned ni() const
Width.
unsigned nj() const
Height.
virtual enum vil_pixel_format pixel_format() const =0
Return a description of the concrete data pixel type.
bool put_view(const vil_image_view_base &im, unsigned i0, unsigned j0) override
Put the data in this view back into the image source.
A generic_image adaptor that behaves like a single plane version of its input.
vil_image_view_base_sptr get_copy_view() const
Create a read/write view of a copy of all the data.
vil_plane_image_resource(vil_image_resource_sptr const &, unsigned p)
vil_image_view< T > vil_plane(const vil_image_view< T > &im, unsigned p)
Return a view of im's plane p.
unsigned nplanes() const
Number of planes.
vil_image_view_base_sptr get_view() const
Create a read/write view of all the data.