vil_image_view< T > Class Template Reference

#include <vil_image_view.h>

Inheritance diagram for vil_image_view< T >:

vil_image_view_base List of all members.

Detailed Description

template<class T>
class vil_image_view< T >

Concrete view of image data of type T held in memory.

Views nplanes() planes of data each of size ni() x nj(). The (i,j) element of the p'th plane is given by im.top_left_ptr()[i*im.istep() + j*im.jstep() + p*im.planestep] The actual image data is either allocated by the class (using set_size), in which case it is deleted only when it has no views observing it, or is allocated outside (and is not deleted on destruction). This allows external images to be accessed without a deep copy.

Note that copying one vil_image_view<T> to another takes a shallow copy by default - it copies the view, not the raw image data. Use the explicit deep_copy() call to take a deep copy.

Definition at line 40 of file vil_image_view.h.

Public Types

typedef T pixel_type
 The pixel type of this image.
typedef T * iterator
typedef T const * const_iterator

Public Member Functions

 vil_image_view ()
 Dflt ctor.
 vil_image_view (unsigned ni, unsigned nj, unsigned n_planes=1, unsigned n_interleaved_planes=1)
 Create an image of ni x nj pixels in (n_planes * n_interleaved_planes) planes.
 vil_image_view (const T *top_left, unsigned ni, unsigned nj, unsigned nplanes, vcl_ptrdiff_t i_step, vcl_ptrdiff_t j_step, vcl_ptrdiff_t plane_step)
 Set this view to look at someone else's memory data.
 vil_image_view (const vil_memory_chunk_sptr &mem_chunk, const T *top_left, unsigned ni, unsigned nj, unsigned nplanes, vcl_ptrdiff_t i_step, vcl_ptrdiff_t j_step, vcl_ptrdiff_t plane_step)
 Set this view to look at another view's data.
 vil_image_view (const vil_image_view< T > &rhs)
 Copy construct.
 vil_image_view (const vil_image_view_base &rhs)
 Construct from various vil_image_view types.
 vil_image_view (const vil_image_view_base_sptr &rhs)
 Construct from various vil_image_view types.
virtual ~vil_image_view ()
bool is_contiguous () const
 True if data all in one unbroken block and top_left_ptr() is lowest data address.
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const
T * top_left_ptr ()
 Pointer to the first (top left in plane 0) pixel.
const T * top_left_ptr () const
 Pointer to the first (top left in plane 0) pixel.
vcl_ptrdiff_t istep () const
 Add this to your pixel pointer to get next i pixel.
vcl_ptrdiff_t jstep () const
 Add this to your pixel pointer to get next j pixel.
vcl_ptrdiff_t planestep () const
 Add this to your pixel pointer to get pixel on next plane.
 operator safe_bool () const
 Cast to bool is true if pointing at some data.
bool operator! () const
 Return false if pointing at some data.
unsigned size_bytes () const
 The number of bytes in the data.
const vil_memory_chunk_sptrmemory_chunk () const
 Smart pointer to the object holding the data for this view.
vil_memory_chunk_sptrmemory_chunk ()
 Smart pointer to the object holding the data for this view.
bool in_range (int i, int j) const
 Return true if (i,j) is a valid index into this buffer.
bool in_range (int i, int j, int p) const
 Return true if (i,j,p) is a valid index into this buffer.
const T & operator() (unsigned i, unsigned j) const
 Return read-only reference to pixel at (i,j) in plane 0.
T & operator() (unsigned i, unsigned j)
 Return read/write reference to pixel at (i,j) in plane 0.
const T & operator() (unsigned i, unsigned j, unsigned p) const
 Return read-only reference to pixel at (i,j) in plane p.
T & operator() (unsigned i, unsigned j, unsigned p)
 Return read-only reference to pixel at (i,j) in plane p.
virtual void set_size (unsigned ni, unsigned nj)
 resize current planes to ni x nj.
virtual void set_size (unsigned ni, unsigned nj, unsigned nplanes)
 resize to ni x nj x nplanes.
void deep_copy (const vil_image_view< T > &src)
 Make a copy of the data in src and set this to view it.
void clear ()
 Make empty.
void set_to_memory (const T *top_left, unsigned ni, unsigned nj, unsigned nplanes, vcl_ptrdiff_t i_step, vcl_ptrdiff_t j_step, vcl_ptrdiff_t plane_step)
 Set this view to look at someone else's memory data.
void fill (T value)
 Fill view with given value.
virtual void print (vcl_ostream &) const
 Print a 1-line summary of contents.
virtual vcl_string is_a () const
 Return class name.
virtual bool is_class (vcl_string const &s) const
 True if this is (or is derived from) class s.
vil_pixel_format pixel_format () const
 Return a description of the concrete data pixel type.
bool operator== (const vil_image_view_base &other) const
 True if they share same view of same image data.
bool operator!= (const vil_image_view_base &rhs) const
 True if they do not share same view of same image data.
bool operator< (const vil_image_view_base &rhs) const
 Provides an ordering.
bool operator>= (const vil_image_view_base &rhs) const
 Provides an ordering.
bool operator> (const vil_image_view_base &rhs) const
 Provides an ordering.
bool operator<= (const vil_image_view_base &rhs) const
 Provides an ordering.
const vil_image_view< T > & operator= (const vil_image_view< T > &rhs)
 Copy a view. The rhs and lhs will point to the same image data.
const vil_image_view< T > & operator= (const vil_image_view_base &rhs)
 Copy a view. The rhs and lhs will point to the same image data.
const vil_image_view< T > & operator= (const vil_image_view_base_sptr &rhs)
 Copy a view. The rhs and lhs will point to the same image data.
unsigned ni () const
 Width.
unsigned nj () const
 Height.
unsigned nplanes () const
 Number of planes.
unsigned long size () const
 The number of pixels.

Protected Member Functions

void release_memory ()
 Disconnect this view from the underlying data,.

Protected Attributes

T * top_left_
 Pointer to pixel at origin.
vcl_ptrdiff_t istep_
 Add this to a pixel pointer to move one column left.
vcl_ptrdiff_t jstep_
 Add this to a pixel pointer to move one row down.
vcl_ptrdiff_t planestep_
 Add this to a pixel pointer to move one plane back.
vil_memory_chunk_sptr ptr_
 Reference to actual image data.
unsigned ni_
 Number of columns.
unsigned nj_
 Number of rasters.
unsigned nplanes_
 Number of planes.

Private Attributes

 VCL_SAFE_BOOL_DEFINE

Related Functions

(Note that these are not member functions.)

void vil_convolve_1d (const vil_image_view< srcT > &src_im, vil_image_view< destT > &dest_im, const kernelT *kernel, vcl_ptrdiff_t k_lo, vcl_ptrdiff_t k_hi, accumT ac, vil_convolve_boundary_option start_option, vil_convolve_boundary_option end_option)
 Convolve kernel[i] (i in [k_lo,k_hi]) with srcT in i-direction.
void vil_convolve_2d (const vil_image_view< srcT > &src_im, vil_image_view< destT > &dest_im, const vil_image_view< kernelT > &kernel, accumT ac)
 Convolve kernel with srcT.
void vil_corners (const vil_image_view< float > &grad_i, const vil_image_view< float > &grad_j, vil_image_view< float > &dest, double k)
 Compute Forstner/Harris corner strength function given gradient images.
void vil_corners_rohr (const vil_image_view< float > &grad_i, const vil_image_view< float > &grad_j, vil_image_view< float > &dest)
 Compute corner strength using Rohr's recommended method.
void vil_corners (const vil_image_view< T > &src, vil_image_view< float > &dest, double k=0.04)
 Compute Harris corner strength function.
void vil_corners_rohr (const vil_image_view< T > &src, vil_image_view< float > &dest)
 Compute corner strength using Karl Rohr's recommended method.
void vil_correlate_1d (const vil_image_view< srcT > &src_im, vil_image_view< destT > &dest_im, const kernelT *kernel, vcl_ptrdiff_t k_lo, vcl_ptrdiff_t k_hi, accumT ac, vil_convolve_boundary_option start_option, vil_convolve_boundary_option end_option)
 correlate kernel[i] (i in [k_lo,k_hi]) with srcT in i-direction.
void vil_correlate_2d (const vil_image_view< srcT > &src_im, vil_image_view< destT > &dest_im, const vil_image_view< kernelT > &kernel, accumT ac)
 Correlate kernel with srcT.
void vil_exp_filter_i (const vil_image_view< srcT > &src_im, vil_image_view< destT > &dest_im, accumT k)
 Apply exponential filter along i to src_im to produce dest_im.
void vil_exp_filter_j (const vil_image_view< srcT > &src_im, vil_image_view< destT > &dest_im, accumT k)
 Apply exponential filter along j to src_im to produce dest_im.
void vil_exp_filter_2d (const vil_image_view< srcT > &src_im, vil_image_view< destT > &dest_im, accumT ki, accumT kj)
 Apply exponential filter along i and j to src_im to produce dest_im.
void vil_exp_grad_filter_i (const vil_image_view< srcT > &src_im, vil_image_view< destT > &dest_im, accumT k)
 Apply exponential gradient filter to src_im (along i direction).
void vil_exp_grad_filter_j (const vil_image_view< srcT > &src_im, vil_image_view< destT > &dest_im, accumT k)
 Apply exponential gradient filter to src_im (along j direction).
void vil_gauss_reduce (const vil_image_view< T > &src, vil_image_view< T > &dest, vil_image_view< T > &work_im)
 Smooth and subsample src_im to produce dest_im.
void vil_gauss_reduce_2_3 (const vil_image_view< T > &src_im, vil_image_view< T > &dest_im, vil_image_view< T > &work_im)
 Smooth and subsample src_im to produce dest_im (2/3 size).
void vil_gauss_reduce_121 (const vil_image_view< T > &src, vil_image_view< T > &dest)
 Smooth and subsample src_im to produce dest_im.
void vil_gauss_reduce_general (const vil_image_view< T > &src_im, vil_image_view< T > &dest_im, const vil_gauss_reduce_params &params)
 Smooth and subsample src_im by an arbitrary factor to produce dest_im.
accumT vil_norm_corr_2d_at_pt (const srcT *src_im, vcl_ptrdiff_t s_istep, vcl_ptrdiff_t s_jstep, vcl_ptrdiff_t s_pstep, const vil_image_view< kernelT > &kernel, accumT)
 Evaluate dot product between kernel and src_im.
void vil_normalised_correlation_2d (const vil_image_view< srcT > &src_im, vil_image_view< destT > &dest_im, const vil_image_view< kernelT > &kernel, accumT ac)
 Normalised cross-correlation of (pre-normalised) kernel with srcT.
void vil_sobel_1x3 (const vil_image_view< srcT > &src, vil_image_view< destT > &grad_i, vil_image_view< destT > &grad_j)
 Compute gradients of an image using 1x3 Sobel filters.
void vil_sobel_1x3 (const vil_image_view< srcT > &src, vil_image_view< destT > &grad_ij)
 Compute gradients of an image using 1x3 Sobel filters.
void vil_sobel_3x3 (const vil_image_view< srcT > &src, vil_image_view< destT > &grad_i, vil_image_view< destT > &grad_j)
 Compute gradients of an image using 3x3 Sobel filters.
void vil_sobel_3x3 (const vil_image_view< srcT > &src, vil_image_view< destT > &grad_ij)
 Compute gradients of an image using 3x3 Sobel filters.
double vil_bicub_interp_safe (const vil_image_view< T > &view, double x, double y, unsigned p=0)
 Compute bicubic interpolation at (x,y), with bound checks.
double vil_bicub_interp (const vil_image_view< T > &view, double x, double y, unsigned p=0)
 Compute bicubic interpolation at (x,y), with minimal bound checks.
double vil_bicub_interp_safe_extend (const vil_image_view< T > &view, double x, double y, unsigned p=0)
 Compute bicubic interpolation at (x,y), with bound checks.
double vil_bilin_interp_safe (const vil_image_view< T > &view, double x, double y, unsigned p=0)
 Compute bilinear interpolation at (x,y), with bound checks.
double vil_bilin_interp (const vil_image_view< T > &view, double x, double y, unsigned p=0)
 Compute bilinear interpolation at (x,y), with minimal bound checks.
double vil_bilin_interp_safe_extend (const vil_image_view< T > &view, double x, double y, unsigned p=0)
 Compute bilinear interpolation at (x,y), with bound checks.
void vil_clamp (vil_image_view< T > &src, vil_image_view< T > &dest, T lo, T hi)
 Clamp an image view between two values.
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.
void vil_clamp_below (vil_image_view< T > &src, T t)
 Clamp an image view above a given value t, setting it to this t if below t.
void vil_convert_cast (const vil_image_view< inP > &src, vil_image_view< outP > &dest)
 Cast one pixel type to another (with rounding).
void vil_convert_round (const vil_image_view< inP > &src, vil_image_view< outP > &dest)
 Convert one pixel type to another with rounding.
void vil_convert_stretch_range (const vil_image_view< T > &src, vil_image_view< vxl_byte > &dest)
 Convert src to byte image dest by stretching to range [0,255].
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.
void vil_copy_to_window (const vil_image_view< T > &src, vil_image_view< T > &dest, unsigned i0, unsigned j0)
 Copy src to window in dest.
void vil_copy_deep (const vil_image_view< T > &src, vil_image_view< T > &dest)
 Deep copy src to dest.
vil_image_view< T > vil_copy_deep (const vil_image_view< T > &src)
 Create a deep copy of an image, with completely new underlying memory.
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.
vil_image_view< T > vil_decimate (const vil_image_view< T > &im, unsigned i_factor, unsigned j_factor=0)
 Create a view which is a decimated version of src.
void vil_fill (vil_image_view< T > &view, T value)
 Fill view with given value.
void vil_fill_line (T *data, unsigned n, vcl_ptrdiff_t step, T value)
 Fill data[i*step] (i=0.
void vil_fill_line (vil_image_view< T > &im, int ai, int aj, int bi, int bj, T value)
 Fill line from (ai,aj) to (bi,bj) using Bresenham's algorithm.
void vil_fill_row (vil_image_view< T > &view, unsigned j, T value)
 Fill row j in view with given value.
void vil_fill_col (vil_image_view< T > &view, unsigned i, T value)
 Fill column i in view with given value.
vil_image_view< T > vil_flip_lr (const vil_image_view< T > &v)
 Create a reflected view in which i -> ni-1-i.
vil_image_view< T > vil_flip_ud (const vil_image_view< T > &v)
 Create a reflected view in which y -> nj-1-j.
bool vil_image_view_deep_equality (const vil_image_view< T > &lhs, const vil_image_view< T > &rhs)
 True if the actual images are identical.
vil_image_view_base_sptr vil_load (const char *)
 Convenience function for loading an image into an image view.
void vil_math_value_range_percentiles (const vil_image_view< T > &im, const vcl_vector< double > &fraction, vcl_vector< T > &value)
 Compute the values corresponding to several percentiles of the range of im.
void vil_math_value_range_percentile (const vil_image_view< T > &im, const double fraction, T &value)
 Compute the value corresponding to a percentile of the range of im.
sumT vil_math_ssd (const vil_image_view< imT > &imA, const vil_image_view< imT > &imB, sumT)
 Sum of squared differences between two images.
sumT vil_math_ssd_complex (const vil_image_view< vcl_complex< imT > > &imA, const vil_image_view< vcl_complex< imT > > &imB, sumT)
 Sum squared magnitude differences between two complex images.
void vil_math_mean_over_planes (const vil_image_view< aT > &src, vil_image_view< sumT > &dest)
 Calc the mean of each pixel over all the planes.
void vil_math_mean_over_planes (const vil_image_view< inT > &src, vil_image_view< outT > &dest, sumT)
 Calc the mean of each pixel over all the planes.
void vil_math_sum (sumT &sum, const vil_image_view< imT > &im, unsigned p)
 Sum of elements in plane p of image.
void vil_math_mean (sumT &mean, const vil_image_view< imT > &im, unsigned p)
 Mean of elements in plane p of image.
void vil_math_median (imT &median, const vil_image_view< imT > &im, unsigned p)
 Median of elements in plane p of an image.
void vil_math_sum_squares (sumT &sum, sumT &sum_sq, const vil_image_view< imT > &im, unsigned p)
 Sum of squares of elements in plane p of image.
void vil_math_mean_and_variance (sumT &mean, sumT &var, const vil_image_view< imT > &im, unsigned p)
 Mean and variance of elements in plane p of image.
void vil_math_sqrt (vil_image_view< T > &image)
 Compute square-root of each pixel element (or zero if negative).
void vil_math_truncate_range (vil_image_view< T > &image, T min_v, T max_v)
 Truncate each pixel value so it fits into range [min_v,max_v].
void vil_math_scale_values (vil_image_view< T > &image, double scale)
 Multiply values in-place in image view by scale.
void vil_math_scale_and_offset_values (vil_image_view< imT > &image, double scale, offsetT offset)
 Multiply values in-place in image view by scale and add offset.
void vil_math_image_sum (const vil_image_view< aT > &imA, const vil_image_view< bT > &imB, vil_image_view< sumT > &im_sum)
 Compute sum of two images (im_sum = imA+imB).
void vil_math_image_product (const vil_image_view< aT > &imA, const vil_image_view< bT > &imB, vil_image_view< sumT > &im_product)
 Compute pixel-wise product of two images (im_prod(i,j) = imA(i,j)*imB(i,j).
void vil_math_image_max (const vil_image_view< aT > &imA, const vil_image_view< bT > &imB, vil_image_view< maxT > &im_max)
 Compute the max of two images (im_max = max(imA, imB)).
void vil_math_image_min (const vil_image_view< aT > &imA, const vil_image_view< bT > &imB, vil_image_view< minT > &im_min)
 Compute the min of two images (im_min = min(imA, imB)).
void vil_math_image_ratio (const vil_image_view< aT > &imA, const vil_image_view< bT > &imB, vil_image_view< sumT > &im_ratio)
 Compute pixel-wise ratio of two images : im_ratio(i,j) = imA(i,j)/imB(i,j).
void vil_math_image_difference (const vil_image_view< aT > &imA, const vil_image_view< bT > &imB, vil_image_view< sumT > &im_sum)
 Compute difference of two images (im_sum = imA-imB).
void vil_math_image_abs_difference (const vil_image_view< aT > &imA, const vil_image_view< bT > &imB, vil_image_view< sumT > &im_sum)
 Compute absolute difference of two images (im_sum = |imA-imB|).
void vil_math_image_vector_mag (const vil_image_view< aT > &imA, const vil_image_view< bT > &imB, vil_image_view< magT > &im_mag)
 Compute magnitude of two images taken as vector components, sqrt(A^2 + B^2).
void vil_math_add_image_fraction (vil_image_view< aT > &imA, scaleT fa, const vil_image_view< bT > &imB, scaleT fb)
 imA = fa*imA + fb*imB (Useful for moving averages!).
void vil_math_integral_image (const vil_image_view< aT > &imA, vil_image_view< sumT > &im_sum)
 Compute integral image im_sum(i+1,j+1) = sum (x<=i,y<=j) imA(x,y).
void vil_math_integral_sqr_image (const vil_image_view< aT > &imA, vil_image_view< sumT > &im_sum, vil_image_view< sumT > &im_sum_sq)
 Compute integral image im_sum_sq(i+1,j+1) = sum (x<=i,y<=j) imA(x,y)^2.
vil_nearest_neighbour_interp_safe (const vil_image_view< T > &view, double x, double y, unsigned p=0)
 Compute nearest neighbour interpolation at (x,y), with bound checks.
vil_nearest_neighbour_interp_safe_extend (const vil_image_view< T > &view, double x, double y, unsigned p=0)
 Compute nearest_neighbourear interpolation at (x,y), with bound checks.
vil_image_view< T > vil_plane (const vil_image_view< T > &im, unsigned p)
 Return a view of im's plane p.
void vil_print_value (vcl_ostream &s, const T &value)
 How to print value in vil_print_all(image_view).
void vil_print_all (vcl_ostream &os, const vil_image_view< T > &view)
 Print all image data to os in a grid (rounds output to int).
void vil_print_all (vcl_ostream &os, vil_image_view_base_sptr const &view)
 Print all image data to os in a grid.
void vil_resample_bicub (const vil_image_view< sType > &src_image, vil_image_view< dType > &dest_image, double x0, double y0, double dx1, double dy1, double dx2, double dy2, int n1, int n2)
 Sample grid of points in one image and place in another, using bicubic interpolation.
void vil_resample_bilin (const vil_image_view< sType > &src_image, vil_image_view< dType > &dest_image, double x0, double y0, double dx1, double dy1, double dx2, double dy2, int n1, int n2)
 Sample grid of points in one image and place in another, using bilinear interpolation.
void vil_resample_bilin_edge_extend (const vil_image_view< sType > &src_image, vil_image_view< dType > &dest_image, double x0, double y0, double dx1, double dy1, double dx2, double dy2, int n1, int n2)
 Sample grid of points in one image and place in another, using bilinear interpolation.
void vil_sample_grid_bicub (vecType *v, const vil_image_view< imType > &image, double x0, double y0, double dx1, double dy1, double dx2, double dy2, int n1, int n2)
 Sample grid from image, using bicubic interpolation.
void vil_sample_grid_bilin (vecType *v, const vil_image_view< imType > &image, double x0, double y0, double dx1, double dy1, double dx2, double dy2, int n1, int n2)
 Sample grid from image, using bilinear interpolation.
void vil_sample_profile_bicub (vecType *v, const vil_image_view< imType > &image, double x0, double y0, double dx, double dy, int n)
 Sample along profile, using bicubic interpolation.
void vil_sample_profile_bilin (vecType *v, const vil_image_view< imType > &image, double x0, double y0, double dx, double dy, int n)
 Sample along profile, using bilinear interpolation.
bool vil_save (const vil_image_view_base &, char const *filename)
 Send a vil_image_view to disk, deducing format from filename.
bool vil_save (const vil_image_view_base &, char const *filename, char const *file_format)
 Send a vil_image_view to disk, given filename.
vil_image_view< T > vil_transpose (const vil_image_view< T > &v)
 Create a view which appears as the transpose of this view.
vil_image_view< typename T::value_type > vil_view_as_planes (const vil_image_view< T > &v)
 Return a 3-plane view of an RGB image, or a 4-plane view of an RGBA, or a 2-plane view of a complex image.
vil_image_view< vil_rgb< T > > vil_view_as_rgb (const vil_image_view< T > &v)
 Return an RGB component view of a 3-plane image.
vil_image_view< vil_rgba<
T > > 
vil_view_as_rgba (const vil_image_view< T > &v)
 Return an RGBA component view of a 4-plane image.
vil_image_view< vcl_complex<
T > > 
vil_view_as_complex (const vil_image_view< T > &v)
 Return an complex component view of a 2N-plane image.
vil_image_view< T > vil_view_part (vil_image_view< vcl_complex< T > > img, int pt)
 Base function to do the work for both vil_view_real/imag_part.
vil_image_view< T > vil_view_real_part (vil_image_view< vcl_complex< T > > img)
 Return a view of the real part of a complex image.
vil_image_view< T > vil_view_imag_part (vil_image_view< vcl_complex< T > > img)
 Return a view of the imaginary part of a complex image.


Member Typedef Documentation

template<class T>
typedef T vil_image_view< T >::pixel_type

The pixel type of this image.

Definition at line 121 of file vil_image_view.h.

template<class T>
typedef T* vil_image_view< T >::iterator

Definition at line 127 of file vil_image_view.h.

template<class T>
typedef T const* vil_image_view< T >::const_iterator

Definition at line 131 of file vil_image_view.h.


Constructor & Destructor Documentation

template<class T>
vil_image_view< T >::vil_image_view (  )  [inline]

Dflt ctor.

Creates an empty one-plane image.

Definition at line 64 of file vil_image_view.h.

template<class T>
vil_image_view< T >::vil_image_view ( unsigned  ni,
unsigned  nj,
unsigned  n_planes = 1,
unsigned  n_interleaved_planes = 1 
)

Create an image of ni x nj pixels in (n_planes * n_interleaved_planes) planes.

If n_interleaved_planes > 1, the planes are interleaved. If n_planes > 1, each plane of pixels is stored contiguously. n_planes and n_components should not be both different from 1. n_planes * n_interleaved_planes should be 1 unless T is scalar.

template<class T>
vil_image_view< T >::vil_image_view ( const T *  top_left,
unsigned  ni,
unsigned  nj,
unsigned  nplanes,
vcl_ptrdiff_t  i_step,
vcl_ptrdiff_t  j_step,
vcl_ptrdiff_t  plane_step 
)

Set this view to look at someone else's memory data.

If the data goes out of scope then this view could be invalid, and there's no way of knowing until its too late - so take care!

template<class T>
vil_image_view< T >::vil_image_view ( const vil_memory_chunk_sptr mem_chunk,
const T *  top_left,
unsigned  ni,
unsigned  nj,
unsigned  nplanes,
vcl_ptrdiff_t  i_step,
vcl_ptrdiff_t  j_step,
vcl_ptrdiff_t  plane_step 
)

Set this view to look at another view's data.

Typically used by functions which generate a manipulated view of another's image data. Need to pass the memory chunk to set up the internal smart ptr appropriately

template<class T>
vil_image_view< T >::vil_image_view ( const vil_image_view< T > &  rhs  ) 

Copy construct.

The new object will point to the same underlying image as the rhs.

template<class T>
vil_image_view< T >::vil_image_view ( const vil_image_view_base rhs  ) 

Construct from various vil_image_view types.

The new object will point to the same underlying image as the rhs You can assign a vil_image_view<compound_type<T>> to a vil_image_view<T> in all reasonable cases - the lhs will have as many planes as the rhs has components. You can assign a vil_image_view<T> to a vil_image_view<compound_type<T>> when the underlying data is formatted appropriately and the lhs has as many components as the rhs has planes. O(1). If the view types are not compatible this object will be set to empty.

template<class T>
vil_image_view< T >::vil_image_view ( const vil_image_view_base_sptr rhs  ) 

Construct from various vil_image_view types.

The new object will point to the same underlying image as the rhs.

You can assign a vil_image_view<compound_type<T>> to a vil_image_view<T> in all reasonable cases - the lhs will have as many planes as the rhs has components. You can assign a vil_image_view<T> to a vil_image_view<compound_type<T>> when the underlying data is formatted appropriately and the lhs has as many components as the rhs has planes. O(1).

Exceptions:
vil_exception_pixel_formats_incompatible if view types are not compatible. Or returns a null image if exceptions are disabled.

template<class T>
virtual vil_image_view< T >::~vil_image_view (  )  [inline, virtual]

Definition at line 114 of file vil_image_view.h.


Member Function Documentation

template<class T>
void vil_image_view< T >::release_memory (  )  [inline, protected]

Disconnect this view from the underlying data,.

Definition at line 58 of file vil_image_view.h.

template<class T>
bool vil_image_view< T >::is_contiguous (  )  const

True if data all in one unbroken block and top_left_ptr() is lowest data address.

template<class T>
iterator vil_image_view< T >::begin (  )  [inline]

Definition at line 128 of file vil_image_view.h.

template<class T>
iterator vil_image_view< T >::end (  )  [inline]

Definition at line 129 of file vil_image_view.h.

template<class T>
const_iterator vil_image_view< T >::begin (  )  const [inline]

Definition at line 132 of file vil_image_view.h.

template<class T>
const_iterator vil_image_view< T >::end (  )  const [inline]

Definition at line 133 of file vil_image_view.h.

template<class T>
T* vil_image_view< T >::top_left_ptr (  )  [inline]

Pointer to the first (top left in plane 0) pixel.

Note that this is not necessarily the lowest data memory address.

Definition at line 139 of file vil_image_view.h.

template<class T>
const T* vil_image_view< T >::top_left_ptr (  )  const [inline]

Pointer to the first (top left in plane 0) pixel.

Note that this is not necessarily the lowest data memory address.

Definition at line 142 of file vil_image_view.h.

template<class T>
vcl_ptrdiff_t vil_image_view< T >::istep (  )  const [inline]

Add this to your pixel pointer to get next i pixel.

Note that istep() may well be negative; see e.g. vil_flip_lr

Definition at line 146 of file vil_image_view.h.

template<class T>
vcl_ptrdiff_t vil_image_view< T >::jstep (  )  const [inline]

Add this to your pixel pointer to get next j pixel.

Note that jstep() may well be negative; see e.g. vil_flip_ud

Definition at line 149 of file vil_image_view.h.

template<class T>
vcl_ptrdiff_t vil_image_view< T >::planestep (  )  const [inline]

Add this to your pixel pointer to get pixel on next plane.

Note that planestep() may well be negative, e.g. with BMP file images

Definition at line 152 of file vil_image_view.h.

template<class T>
vil_image_view< T >::operator safe_bool (  )  const [inline]

Cast to bool is true if pointing at some data.

Definition at line 155 of file vil_image_view.h.

template<class T>
bool vil_image_view< T >::operator! (  )  const [inline]

Return false if pointing at some data.

Definition at line 159 of file vil_image_view.h.

template<class T>
unsigned vil_image_view< T >::size_bytes (  )  const [inline]

The number of bytes in the data.

Definition at line 163 of file vil_image_view.h.

template<class T>
const vil_memory_chunk_sptr& vil_image_view< T >::memory_chunk (  )  const [inline]

Smart pointer to the object holding the data for this view.

Will be a null pointer if this view looks at `third-party' data, e.g. using set_to_memory.

Typically used when creating new views of the data

Definition at line 170 of file vil_image_view.h.

template<class T>
vil_memory_chunk_sptr& vil_image_view< T >::memory_chunk (  )  [inline]

Smart pointer to the object holding the data for this view.

Will be a null pointer if this view looks at `third-party' data, e.g. using set_to_memory

Typically used when creating new views of the data

Definition at line 177 of file vil_image_view.h.

template<class T>
bool vil_image_view< T >::in_range ( int  i,
int  j 
) const [inline]

Return true if (i,j) is a valid index into this buffer.

Definition at line 182 of file vil_image_view.h.

template<class T>
bool vil_image_view< T >::in_range ( int  i,
int  j,
int  p 
) const [inline]

Return true if (i,j,p) is a valid index into this buffer.

Definition at line 186 of file vil_image_view.h.

template<class T>
const T& vil_image_view< T >::operator() ( unsigned  i,
unsigned  j 
) const [inline]

Return read-only reference to pixel at (i,j) in plane 0.

Definition at line 191 of file vil_image_view.h.

template<class T>
T& vil_image_view< T >::operator() ( unsigned  i,
unsigned  j 
) [inline]

Return read/write reference to pixel at (i,j) in plane 0.

Definition at line 196 of file vil_image_view.h.

template<class T>
const T& vil_image_view< T >::operator() ( unsigned  i,
unsigned  j,
unsigned  p 
) const [inline]

Return read-only reference to pixel at (i,j) in plane p.

Definition at line 201 of file vil_image_view.h.

template<class T>