imaging::VectorComponentAccessor< vector_image_t > Class Template Reference
[Image Module]

Provides access to different channels of vector valued image data. More...

#include <VectorComponentAccessor.hpp>

Inheritance diagram for imaging::VectorComponentAccessor< vector_image_t >:

imaging::ImageAccessorInterface< vector_image_t, vector_image_t::data_t::data_t > imaging::ImageInterface< vector_image_t::dimension, vector_image_t::data_t::data_t >

List of all members.

Public Types

typedef
vector_image_t::data_t::data_t 
data_t

Public Member Functions

 VectorComponentAccessor (vector_image_t &image, size_t component)
data_t operator[] (const ublas::fixed_vector< size_t, dimension > &index) const
data_reference operator[] (const ublas::fixed_vector< size_t, dimension > &index)

Static Public Attributes

static const size_t dimension


Detailed Description

template<class vector_image_t>
class imaging::VectorComponentAccessor< vector_image_t >

Provides access to different channels of vector valued image data.

Use this class to access components of vector valued pixels in images. By vector valued we mean that the pixel data type of the input image data consists of different components (all of the same type) which can be accessed by operator(). The following code example copies the green component of colour_image to green_channel. It then processes the green_channel and assigns the possibly modified channel back to the original image:

  ColorImage2d colour_image("some_image.png");
  GrayImage2d green_channel(colour_image.size());
  
  VectorComponentAccessor<ColorImage2d> accessor(colour_image, 2);
  
  green_channel = accessor;
  
  // process green_channel...
  
  accessor = green_channel;

Member Typedef Documentation

template<class vector_image_t>
typedef vector_image_t::data_t::data_t imaging::VectorComponentAccessor< vector_image_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::ImageAccessorInterface< vector_image_t, vector_image_t::data_t::data_t >.


Constructor & Destructor Documentation

template<class vector_image_t>
imaging::VectorComponentAccessor< vector_image_t >::VectorComponentAccessor ( vector_image_t &  image,
size_t  component 
) [inline]

Initialize the image accessor with an reference to image which must be an ImageInterface object with vector valued pixel data. The accessor will then behave as a scalar valued image consisting of the values of the component-th channel of image. The reference will be stored and accessed when the image accessor is utilized. The dimensions of the accessor are the same as those of image.

Note that component must be within the range of the components of the pixel data of image. E.g. component must not exceed 2 in case of RGB images.


Member Function Documentation

template<class vector_image_t>
data_t imaging::VectorComponentAccessor< vector_image_t >::operator[] ( const ublas::fixed_vector< size_t, dimension > &  index  )  const [inline]

Returns a constant reference to a pixel.

Reimplemented from imaging::ImageInterface< vector_image_t::dimension, vector_image_t::data_t::data_t >.

template<class vector_image_t>
data_reference imaging::VectorComponentAccessor< vector_image_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< vector_image_t::dimension, vector_image_t::data_t::data_t >.


Member Data Documentation

template<class vector_image_t>
const size_t imaging::VectorComponentAccessor< vector_image_t >::dimension [static]

Initial value:

      ImageAccessorInterface<vector_image_t, data_t>::dimension
The dimension of the image. It equals 2 for planar images and 3 for voxel-data.

Reimplemented from imaging::ImageAccessorInterface< vector_image_t, vector_image_t::data_t::data_t >.


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

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