Image< T, N > Class Template Reference

#include <image.h>

Collaboration diagram for Image< T, N >:

Collaboration graph
[legend]

List of all members.


Detailed Description

template<typename T, unsigned int N = 2>
class Image< T, N >

This is a template image class. It can be used to create Images of any type, float, int, or even color.

This interface can be used as a model for algorithm inputs and outputs. Simply copy this file and start your own implementation of your own image type.

Internally, it keeps a continuous memory of the image data

Public Types

enum  { dim = N }
typedef T type
 type of image (eg. float, uchar, color)
typedef unsigned int uint
typedef T * iterator
 iterator definition
typedef const T * const_iterator
 const iterator definition

Public Member Functions

 Image ()
 index type
 Image (uint width, uint height)
 2D image
 Image (uint width, uint height, uint depth)
 3D image
 Image (const T *data, uint width, uint height)
 2D image with data
 Image (const T *data, uint width, uint height, uint depth)
 3D image with data
 Image (const uint size[])
 N-D.
 Image (const Image &)
 copy constructor
 ~Image ()
 destructor
void setSize (const uint size[])
 set image size
const uintgetSize () const
 get image size
uint getSize (uint n) const
 Get size of a dimension.
const uintsize () const
 get image size
uint size (uint n) const
 Get size of a dimension.
void setSize (uint width, uint height)
 set size in 2D
void setSize (uint width, uint height, uint depth)
 set size in 3D
const T & get (const uint index[]) const
 get data
void set (const uint index[], const T &val)
 set data
const T & get (uint i, uint j) const
 get data in 2D
const T & get (uint i, uint j, uint k) const
 get data in 3D
void set (uint i, uint j, const T &val)
 set data in 2D
void set (uint i, uint j, uint k, const T &val)
 set data in 3D
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const

Protected Attributes

T * m_data
 image data
uint m_size [N]
 image size (width, height)


Member Typedef Documentation

template<typename T, unsigned int N = 2>
typedef T Image< T, N >::type

type of image (eg. float, uchar, color)

template<typename T, unsigned int N = 2>
typedef unsigned int Image< T, N >::uint

template<typename T, unsigned int N = 2>
typedef T* Image< T, N >::iterator

iterator definition

template<typename T, unsigned int N = 2>
typedef const T* Image< T, N >::const_iterator

const iterator definition


Member Enumeration Documentation

template<typename T, unsigned int N = 2>
anonymous enum

Enumerator:
dim 


Constructor & Destructor Documentation

template<typename T, unsigned int N>
Image< T, N >::Image (  )  [inline]

index type

no image

References Image< T, N >::m_size.

template<typename T, unsigned int N>
Image< T, N >::Image ( uint  width,
uint  height 
) [inline]

2D image

References Image< T, N >::setSize().

template<typename T, unsigned int N>
Image< T, N >::Image ( uint  width,
uint  height,
uint  depth 
) [inline]

3D image

References Image< T, N >::setSize().

template<typename T, unsigned int N>
Image< T, N >::Image ( const T *  data,
uint  width,
uint  height 
) [inline]

2D image with data

References Image< T, N >::m_data, and Image< T, N >::setSize().

template<typename T, unsigned int N>
Image< T, N >::Image ( const T *  data,
uint  width,
uint  height,
uint  depth 
) [inline]

3D image with data

References Image< T, N >::m_data, and Image< T, N >::setSize().

template<typename T, unsigned int N>
Image< T, N >::Image ( const uint  size[]  )  [inline]

N-D.

References Image< T, N >::setSize().

template<typename T, unsigned int N>
Image< T, N >::Image ( const Image< T, N > &  image  )  [inline]

template<typename T, unsigned int N>
Image< T, N >::~Image (  )  [inline]

destructor

References Image< T, N >::m_data.


Member Function Documentation

template<typename T, unsigned int N>
void Image< T, N >::setSize ( const uint  size[]  )  [inline]

set image size

References CHECK, Image< T, N >::m_data, and Image< T, N >::m_size.

Referenced by Image< T, N >::Image().

template<typename T, unsigned int N = 2>
const uint* Image< T, N >::getSize (  )  const [inline]

get image size

References Image< T, N >::m_size.

template<typename T, unsigned int N>
unsigned int Image< T, N >::getSize ( uint  n  )  const [inline]

Get size of a dimension.

References CHECKRANGE, and Image< T, N >::m_size.

template<typename T, unsigned int N = 2>
const uint* Image< T, N >::size (  )  const [inline]

get image size

References Image< T, N >::m_size.

Referenced by Image< T, N >::end().

template<typename T, unsigned int N>
unsigned int Image< T, N >::size ( uint  n  )  const [inline]

Get size of a dimension.

References CHECKRANGE, and Image< T, N >::m_size.

template<typename T, unsigned int N>
void Image< T, N >::setSize ( uint  width,
uint  height 
) [inline]

set size in 2D

References CHECK, Image< T, N >::m_data, and Image< T, N >::m_size.

template<typename T, unsigned int N>
void Image< T, N >::setSize ( uint  width,
uint  height,
uint  depth 
) [inline]

set size in 3D

References CHECK, Image< T, N >::m_data, and Image< T, N >::m_size.

template<typename T, unsigned int N>
const T & Image< T, N >::get ( const uint  index[]  )  const [inline]

template<typename T, unsigned int N>
void Image< T, N >::set ( const uint  index[],
const T &  val 
) [inline]

template<typename T, unsigned int N>
const T & Image< T, N >::get ( uint  i,
uint  j 
) const [inline]

get data in 2D

References CHECK, CHECKRANGE, Image< T, N >::m_data, and Image< T, N >::m_size.

template<typename T, unsigned int N>
const T & Image< T, N >::get ( uint  i,
uint  j,
uint  k 
) const [inline]

get data in 3D

References CHECK, CHECKRANGE, Image< T, N >::m_data, and Image< T, N >::m_size.

template<typename T, unsigned int N>
void Image< T, N >::set ( uint  i,
uint  j,
const T &  val 
) [inline]

set data in 2D

References CHECK, CHECKRANGE, Image< T, N >::m_data, and Image< T, N >::m_size.

template<typename T, unsigned int N>
void Image< T, N >::set ( uint  i,
uint  j,
uint  k,
const T &  val 
) [inline]

set data in 3D

References CHECK, CHECKRANGE, Image< T, N >::m_data, and Image< T, N >::m_size.

template<typename T, unsigned int N = 2>
iterator Image< T, N >::begin (  )  [inline]

get an iterator pointing at the beginning of the image data

References Image< T, N >::m_data.

template<typename T, unsigned int N = 2>
iterator Image< T, N >::end (  )  [inline]

get an iterator pointing at the end of the image data

References Image< T, N >::m_data, Image< T, N >::m_size, and Image< T, N >::size().

template<typename T, unsigned int N = 2>
const_iterator Image< T, N >::begin (  )  const [inline]

get an iterator pointing at the beginning of the image data

References Image< T, N >::m_data.

template<typename T, unsigned int N = 2>
const_iterator Image< T, N >::end (  )  const [inline]

get an iterator pointing at the end of the image data

References Image< T, N >::m_data, Image< T, N >::m_size, and Image< T, N >::size().


Member Data Documentation

template<typename T, unsigned int N = 2>
T* Image< T, N >::m_data [protected]

template<typename T, unsigned int N = 2>
uint Image< T, N >::m_size[N] [protected]


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

Generated on Tue Aug 4 17:57:42 2009 for libvd by  doxygen 1.5.5