Functions
core/vil/vil_view_as.h File Reference

Various view conversion functions. More...

#include <vcl_complex.h>
#include <vil/vil_image_view.h>
#include <vil/vil_rgb.h>
#include <vil/vil_rgba.h>

Go to the source code of this file.

Functions

template<class T >
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.
template<class T >
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.
template<class T >
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.
template<class T >
vil_image_view< vcl_complex< T > > vil_view_as_complex (const vil_image_view< T > &v)
 Return a complex component view of a 2N-plane image.
template<class T >
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.
template<class T >
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.
template<class T >
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.

Detailed Description

Various view conversion functions.

vil_image_view<T>::operator=() can automatically perform these conversions for you.

Author:
Tim Cootes, Ian Scott - Manchester

Definition in file vil_view_as.h.


Function Documentation

template<class T >
vil_image_view< vcl_complex< T > > vil_view_as_complex ( const vil_image_view< T > &  v) [inline]

Return a complex component view of a 2N-plane image.

Returns:
an empty view if it can't do the conversion (e.g. planestep != 1) O(1).
Warning:
This view translation is a slight bodge. The underlying data is a still a component T. This means that consistency check between the view and the underlying data will fail. For example vsl_b_write(os, vil_view_as_complex(img); and vsl_b_read(...) will fail. Simply deep copy the view before checking (or saving) the image to avoid problems.

Definition at line 84 of file vil_view_as.h.

template<class T >
vil_image_view< typename T::value_type > vil_view_as_planes ( const vil_image_view< T > &  v) [inline]

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.

Class T must be a compound pixel type.

Returns:
an empty view if it can't do the conversion. O(1).

Definition at line 26 of file vil_view_as.h.

template<class T >
vil_image_view< vil_rgb< T > > vil_view_as_rgb ( const vil_image_view< T > &  v) [inline]

Return an RGB component view of a 3-plane image.

Returns:
an empty view if it can't do the conversion (e.g. planestep != 1) O(1).

Definition at line 47 of file vil_view_as.h.

template<class T >
vil_image_view< vil_rgba< T > > vil_view_as_rgba ( const vil_image_view< T > &  v) [inline]

Return an RGBA component view of a 4-plane image.

Returns:
an empty view if it can't do the conversion (e.g. planestep != 1) O(1).

Definition at line 63 of file vil_view_as.h.

template<class T >
vil_image_view< T > vil_view_imag_part ( vil_image_view< vcl_complex< T > >  img) [inline]

Return a view of the imaginary part of a complex image.

O(1).

Warning:
This view translation is a slight bodge. The underlying data is a still a scalar complex<T>. This means that consistency check between the view and the underlying data will fail. For example vsl_b_write(os, vil_view_imag_part(img, i); and vsl_b_read(...) will fail. Simply deep copy the view before checking (or saving) the image to avoid problems.

Definition at line 137 of file vil_view_as.h.

template<class T >
vil_image_view< T > vil_view_part ( vil_image_view< vcl_complex< T > >  img,
int  pt 
) [inline]

Base function to do the work for both vil_view_real/imag_part.

O(1).

Warning:
This view translation is a slight bodge. The underlying data is a still a scalar complex<T>. This means that consistency check between the view and the underlying data will fail. For example vsl_b_write(os, vil_view_part(img, i); and vsl_b_read(...) will fail. Simply deep copy the view before checking (or saving) the image to avoid problems.

Definition at line 105 of file vil_view_as.h.

template<class T >
vil_image_view< T > vil_view_real_part ( vil_image_view< vcl_complex< T > >  img) [inline]

Return a view of the real part of a complex image.

O(1).

Warning:
This view translation is a slight bodge. The underlying data is a still a scalar complex<T>. This means that consistency check between the view and the underlying data will fail. For example vsl_b_write(os, vil_view_real_part(img, i); and vsl_b_read(...) will fail. Simply deep copy the view before checking (or saving) the image to avoid problems.

Definition at line 123 of file vil_view_as.h.