imaging::Image< N, DATA_t > Class Template Reference
[Image Module]

Stores image data of arbitrary dimension and pixel type. More...

#include <Image.hpp>

Inheritance diagram for imaging::Image< N, DATA_t >:

imaging::ImageInterface< N, DATA_t >

List of all members.

Public Types

typedef DATA_t data_t

Public Member Functions

 Image ()
 Image (const ublas::fixed_vector< size_t, dimension > &size)
 Image (const std::string &file_name)
 Image (const char *file_name)
template<class source_accessor_t>
 Image (const source_accessor_t &image_accessor)
Image< N, DATA_t > & operator= (const Image< N, DATA_t > &source)
template<class source_accessor_t>
const Image< N, DATA_t > & operator= (const source_accessor_t &image_accessor)
const DATA_t & operator[] (const ublas::fixed_vector< size_t, dimension > &index) const
DATA_t & operator[] (const ublas::fixed_vector< size_t, dimension > &index)
const ublas::fixed_vector
< size_t, dimension > & 
size () const
void resize (const ublas::fixed_vector< size_t, dimension > &size)
bool empty () const
void read_image (const std::string &file_name)
void write_image (const std::string &file_name) const

Static Public Attributes

static const std::size_t dimension = N


Detailed Description

template<std::size_t N, class DATA_t>
class imaging::Image< N, DATA_t >

Stores image data of arbitrary dimension and pixel type.

Use this class template to store image data of dimension N with pixel data of type DATA_t. Objects of this class can be resized by calling set_size(). This is not generally true for implementations of ImageInterface.


Member Typedef Documentation

template<std::size_t N, class DATA_t>
typedef DATA_t imaging::Image< N, DATA_t >::data_t

The data type which is stored in the image. Common choices are float_t for grayscale images stored at floating point precision or char for 8-bit data.

Reimplemented from imaging::ImageInterface< N, DATA_t >.


Constructor & Destructor Documentation

template<std::size_t N, class DATA_t>
imaging::Image< N, DATA_t >::Image (  )  [inline]

Default constructor. Sets the size of every image dimension to zero.

template<std::size_t N, class DATA_t>
imaging::Image< N, DATA_t >::Image ( const ublas::fixed_vector< size_t, dimension > &  size  )  [inline, explicit]

Construct an image by specifying its dimensions.

template<std::size_t N, class DATA_t>
imaging::Image< N, DATA_t >::Image ( const std::string &  file_name  )  [inline, explicit]

Construct an image from the file file_name. The type of the file is determined from the suffix of file_name. Currently only 2-dimensional images are supported.

template<std::size_t N, class DATA_t>
imaging::Image< N, DATA_t >::Image ( const char *  file_name  )  [inline, explicit]

Construct an image from the file file_name. The type of the file is determined from the suffix of file_name. Currently only 2-dimensional images are supported.

template<std::size_t N, class DATA_t>
template<class source_accessor_t>
imaging::Image< N, DATA_t >::Image ( const source_accessor_t &  image_accessor  )  [inline, explicit]

Construct an image from any source which implements ImageInterface of the same dimension and whose data type can converted to the data type of this image. In other words, the explicit conversion from source_accessor_t::data_t to data_t must be defined.


Member Function Documentation

template<std::size_t N, class DATA_t>
Image<N, DATA_t>& imaging::Image< N, DATA_t >::operator= ( const Image< N, DATA_t > &  source  )  [inline]

Assignement operator.

template<std::size_t N, class DATA_t>
template<class source_accessor_t>
const Image<N, DATA_t>& imaging::Image< N, DATA_t >::operator= ( const source_accessor_t &  image_accessor  )  [inline]

Assignement operator for any image which implements ImageInterface of the same dimension and whose data type can converted to the data type of this image. In other words, the explicit conversion from source_accessor_t::data_t to data_t must be defined.

template<std::size_t N, class DATA_t>
const DATA_t& imaging::Image< N, DATA_t >::operator[] ( const ublas::fixed_vector< size_t, dimension > &  index  )  const [inline]

Returns a constant reference to a pixel.

Reimplemented from imaging::ImageInterface< N, DATA_t >.

template<std::size_t N, class DATA_t>
DATA_t& imaging::Image< N, DATA_t >::operator[] ( const ublas::fixed_vector< size_t, dimension > &  index  )  [inline]

Returns a reference to a pixel. This function might not be implemented for accessor classes to constant data, such as ConstImageAccessorInterface().

Reimplemented from imaging::ImageInterface< N, DATA_t >.

template<std::size_t N, class DATA_t>
const ublas::fixed_vector<size_t, dimension>& imaging::Image< N, DATA_t >::size (  )  const [inline]

template<std::size_t N, class DATA_t>
void imaging::Image< N, DATA_t >::resize ( const ublas::fixed_vector< size_t, dimension > &  size  )  [inline]

Sets the size of the image.

Referenced by imaging::Image< SHAPE_DIMENSION, double >::operator=().

template<std::size_t N, class DATA_t>
bool imaging::Image< N, DATA_t >::empty (  )  const [inline]

Returns true if the image is empty, i.e. if at least on of its dimensions is zero.

void imaging::GrayImage3d::read_image ( const std::string &  file_name  )  [inline]

Reads the image from the file file_name. The type of the file is determined from the suffix of file_name. Currently only 2-dimensional images are supported.

Referenced by imaging::Image< SHAPE_DIMENSION, double >::Image().

void imaging::GrayImage3d::write_image ( const std::string &  file_name  )  const [inline]

Writes the image to the file file_name. The type of the file is determined from the suffix of file_name. Currently only 2-dimensional images are supported.


Member Data Documentation

template<std::size_t N, class DATA_t>
const std::size_t imaging::Image< N, DATA_t >::dimension = N [static]

The dimension of the image. It equals 2 for planar images and 3 for voxel-data.

Reimplemented from imaging::ImageInterface< N, DATA_t >.


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

Generated on Tue Feb 10 10:01:31 2009 for imaging2 by  doxygen 1.5.5