#include <ImageInterface.hpp>
Public Types | |
typedef DATA_t | data_t |
Public Member Functions | |
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 |
Static Public Attributes | |
static const std::size_t | dimension = N |
This class defines an interface which should be implemented by classes for image data. By image data we mean an N-dimensional array. The data DATA_t stored in the array is arbitrary but must be the same for each entry in the array. The range of valid indices for entries of the array is fixed upon construction of the array (although derived classes, such as Image, may proved functions to resize images) and can be obtained by calling size(). I.e. range of valid entries for the i-th component of an image runs from 0 to size()(i) - 1. Note that the operator [] is always used the same way to access pixels, independent of the image dimensions. This is demonstrated in the following example:
// float_image_2d implements ImageInterface<2, float_t> // graysc_image_3d implements ImageInterface<3, unsigned char> float_image_2d[ublas::fixed_vector<size_t, 2>(0, 1)] = 0.5; graysc_image_3d[ublas::fixed_vector<size_t, 3>(0, 1, 1)] = 128;
typedef DATA_t imaging::ImageInterface< 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 in imaging::CastAccessor< image_t, DATA_t >, imaging::Image< N, DATA_t >, imaging::ImageAccessorInterface< image_t, DATA_t >, imaging::ScalarImage< N, DATA_t >, imaging::ScalingAccessor< float_accessor_t >, imaging::VectorComponentAccessor< vector_image_t >, imaging::Image< N, boost::numeric::ublas::fixed_vector< double, N > >, imaging::Image< N, double >, imaging::Image< SHAPE_DIMENSION, double >, imaging::ImageAccessorInterface< vector_image_t, vector_image_t::data_t::data_t >, and imaging::ImageAccessorInterface< float_accessor_t, double >.
const DATA_t& imaging::ImageInterface< N, DATA_t >::operator[] | ( | const ublas::fixed_vector< size_t, dimension > & | index | ) | const |
Returns a constant reference to a pixel.
Reimplemented in imaging::CastAccessor< image_t, DATA_t >, imaging::Image< N, DATA_t >, imaging::ScalarImage< N, DATA_t >, imaging::ScalingAccessor< float_accessor_t >, imaging::VectorComponentAccessor< vector_image_t >, imaging::Image< N, boost::numeric::ublas::fixed_vector< double, N > >, imaging::Image< N, double >, and imaging::Image< SHAPE_DIMENSION, double >.
DATA_t& imaging::ImageInterface< N, DATA_t >::operator[] | ( | const ublas::fixed_vector< size_t, dimension > & | index | ) |
Returns a reference to a pixel. This function might not be implemented for accessor classes to constant data, such as ConstImageAccessorInterface().
Reimplemented in imaging::CastAccessor< image_t, DATA_t >, imaging::Image< N, DATA_t >, imaging::ScalingAccessor< float_accessor_t >, imaging::VectorComponentAccessor< vector_image_t >, imaging::Image< N, boost::numeric::ublas::fixed_vector< double, N > >, imaging::Image< N, double >, and imaging::Image< SHAPE_DIMENSION, double >.
const ublas::fixed_vector<size_t, dimension>& imaging::ImageInterface< N, DATA_t >::size | ( | ) | const |
Returns the size of the image.
Reimplemented in imaging::Image< N, DATA_t >, imaging::ImageAccessorInterface< image_t, DATA_t >, imaging::ScalarImage< N, DATA_t >, imaging::Image< N, boost::numeric::ublas::fixed_vector< double, N > >, imaging::Image< N, double >, imaging::Image< SHAPE_DIMENSION, double >, imaging::ImageAccessorInterface< vector_image_t, vector_image_t::data_t::data_t >, and imaging::ImageAccessorInterface< float_accessor_t, double >.
const std::size_t imaging::ImageInterface< N, DATA_t >::dimension = N [static] |
The dimension of the image. It equals 2 for planar images and 3 for voxel-data.
Reimplemented in imaging::CastAccessor< image_t, DATA_t >, imaging::Image< N, DATA_t >, imaging::ImageAccessorInterface< image_t, DATA_t >, imaging::ScalarImage< N, DATA_t >, imaging::ScalingAccessor< float_accessor_t >, imaging::VectorComponentAccessor< vector_image_t >, imaging::Image< N, boost::numeric::ublas::fixed_vector< double, N > >, imaging::Image< N, double >, imaging::Image< SHAPE_DIMENSION, double >, imaging::ImageAccessorInterface< vector_image_t, vector_image_t::data_t::data_t >, and imaging::ImageAccessorInterface< float_accessor_t, double >.