20 if (im.
nplanes() == 1)
return im;
30 for (
unsigned p=0, n=im.
nplanes(); p<n; ++p)
39 #endif // vil_flatten_h_ Concrete view of image data of type T held in memory.
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.
vil_image_view< T > vil_flatten_planes(const vil_image_view< T > &im)
Rearrange multiple planes into a multiple tiles of a single-plane image.
void vil_copy_reformat(const vil_image_view< T > &src, vil_image_view< T > &dest)
Copy src to dest, without changing dest's view parameters.
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_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.
const vil_memory_chunk_sptr & memory_chunk() const
Smart pointer to the object holding the data for this view.
vil_image_view< T > vil_crop(const vil_image_view< T > &im, unsigned i0, unsigned n_i, unsigned j0, unsigned n_j)
Create a view which is a cropped version of src.
std::ptrdiff_t istep() const
Add this to your pixel pointer to get next i pixel.