HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
image_view< T > Class Template Reference

#include <image_view.h>

Public Types

typedef T value_type
 
typedef Treference
 
typedef const Tconst_reference
 
typedef int64_t stride_t
 

Public Member Functions

 image_view ()
 Default ctr – points to nothing. More...
 
 image_view (const image_view &copy)
 Copy constructor. More...
 
 image_view (T *data, int nchannels, int width, int height, int depth=1, stride_t chanstride=AutoStride, stride_t xstride=AutoStride, stride_t ystride=AutoStride, stride_t zstride=AutoStride)
 
image_viewoperator= (const image_view &copy)
 
strided_ptr< T, 1 > operator() (int x, int y, int z=0)
 
int nchannels () const
 
int width () const
 
int height () const
 
int depth () const
 
stride_t chanstride () const
 
stride_t xstride () const
 
stride_t ystride () const
 
stride_t zstride () const
 
const Tdata () const
 
void clear ()
 

Static Public Attributes

static const stride_t AutoStride = (-9223372036854775807LL - 1)
 

Detailed Description

template<typename T>
class image_view< T >

image_view : a non-owning reference to an image-like array (indexed by x, y, z, and channel) with known dimensions and optionally non-default strides (expressed in bytes) through the data. An image_view<T> is mutable (the values in the image may be modified), whereas an image_view<const T> is not mutable.

Definition at line 42 of file image_view.h.

Member Typedef Documentation

template<typename T >
typedef const T& image_view< T >::const_reference

Definition at line 46 of file image_view.h.

template<typename T >
typedef T& image_view< T >::reference

Definition at line 45 of file image_view.h.

template<typename T >
typedef int64_t image_view< T >::stride_t

Definition at line 47 of file image_view.h.

template<typename T >
typedef T image_view< T >::value_type

Definition at line 44 of file image_view.h.

Constructor & Destructor Documentation

template<typename T >
image_view< T >::image_view ( )
inline

Default ctr – points to nothing.

Definition at line 56 of file image_view.h.

template<typename T >
image_view< T >::image_view ( const image_view< T > &  copy)
inline

Copy constructor.

Definition at line 59 of file image_view.h.

template<typename T >
image_view< T >::image_view ( T data,
int  nchannels,
int  width,
int  height,
int  depth = 1,
stride_t  chanstride = AutoStride,
stride_t  xstride = AutoStride,
stride_t  ystride = AutoStride,
stride_t  zstride = AutoStride 
)
inline

Construct from T*, dimensions, and (possibly default) strides (in bytes).

Definition at line 68 of file image_view.h.

Member Function Documentation

template<typename T >
stride_t image_view< T >::chanstride ( ) const
inline

Definition at line 101 of file image_view.h.

template<typename T >
void image_view< T >::clear ( )
inline

Definition at line 108 of file image_view.h.

template<typename T >
const T* image_view< T >::data ( ) const
inline

Definition at line 106 of file image_view.h.

template<typename T >
int image_view< T >::depth ( ) const
inline

Definition at line 99 of file image_view.h.

template<typename T >
int image_view< T >::height ( void  ) const
inline

Definition at line 98 of file image_view.h.

template<typename T >
int image_view< T >::nchannels ( ) const
inline

Definition at line 96 of file image_view.h.

template<typename T >
strided_ptr<T, 1> image_view< T >::operator() ( int  x,
int  y,
int  z = 0 
)
inline

iav(x,y,z)returns a strided_ptr<T,1> for the pixel (x,y,z). The z can be omitted for 2D images. Note than the resulting strided_ptr can then have individual channels accessed with operator[]. This particular strided pointer has stride multiplier 1, because this class uses bytes as strides, not sizeof(T).

Definition at line 91 of file image_view.h.

template<typename T >
image_view& image_view< T >::operator= ( const image_view< T > &  copy)
inline

assignments – not a deep copy, just make this image_view point to the same data as the operand.

Definition at line 78 of file image_view.h.

template<typename T >
int image_view< T >::width ( void  ) const
inline

Definition at line 97 of file image_view.h.

template<typename T >
stride_t image_view< T >::xstride ( ) const
inline

Definition at line 102 of file image_view.h.

template<typename T >
stride_t image_view< T >::ystride ( ) const
inline

Definition at line 103 of file image_view.h.

template<typename T >
stride_t image_view< T >::zstride ( ) const
inline

Definition at line 104 of file image_view.h.

Member Data Documentation

template<typename T >
const stride_t image_view< T >::AutoStride = (-9223372036854775807LL - 1)
static

Definition at line 52 of file image_view.h.


The documentation for this class was generated from the following file: