#include <ImageAccessorInterface.hpp>
Public Types | |
typedef DATA_t | data_t |
Public Member Functions | |
ImageAccessorInterface (image_t &image) | |
const ublas::fixed_vector < size_t, dimension > & | size () const |
bool | empty () const |
Static Public Attributes | |
static const size_t | dimension = image_t::dimension |
Protected Attributes | |
image_t & | _image_reference |
Reference to the image object interfaced by this object. |
This class defines an interface for image accessor classes. These are classes which provide layered access to objects which implement ImageInterface. E.g. such a class might convert values of a colour image to grayscale and back again in a transparent fashion when its pixel accessor functions (i.e. operator[]) are called. Similar tasks include rescaling image values or selecting channels in vector valued data.
Note that objects implementing this interface must also implement ImageInterface.
If you want to construct an accessor from constant images, it is necessary that the ImageAccessorInterface template is instantiated for the const image data type:
const GrayImage2d image; CastAccessor<const GrayImage2d, float_t> image_accessor; // works fine CastAccessor<GrayImage2d, float_t> image_accessor; // will not compile!
typedef DATA_t imaging::ImageAccessorInterface< image_t, 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< image_t::dimension, DATA_t >.
Reimplemented in imaging::CastAccessor< image_t, DATA_t >, imaging::ScalingAccessor< float_accessor_t >, and imaging::VectorComponentAccessor< vector_image_t >.
imaging::ImageAccessorInterface< image_t, DATA_t >::ImageAccessorInterface | ( | image_t & | image | ) | [inline] |
Initialize the image accessor with an reference to image. By image_t we mean any type, which implements ImageInterface, i.e. image may itself be an image accessor. This reference will be stored and accessed when the image accessor is utilized. The dimensions of the accessor are the same as those of image.
const ublas::fixed_vector<size_t, dimension>& imaging::ImageAccessorInterface< image_t, DATA_t >::size | ( | ) | const [inline] |
Returns the size of the image.
Reimplemented from imaging::ImageInterface< image_t::dimension, DATA_t >.
Referenced by imaging::ImageAccessorInterface< float_accessor_t, double >::empty().
bool imaging::ImageAccessorInterface< image_t, DATA_t >::empty | ( | ) | const [inline] |
Returns true if the image is empty, i.e. if at least on of its dimensions is zero.
const size_t imaging::ImageAccessorInterface< image_t, DATA_t >::dimension = image_t::dimension [static] |
The dimension of the image. It equals 2 for planar images and 3 for voxel-data.
Reimplemented from imaging::ImageInterface< image_t::dimension, DATA_t >.
Reimplemented in imaging::CastAccessor< image_t, DATA_t >, imaging::ScalingAccessor< float_accessor_t >, and imaging::VectorComponentAccessor< vector_image_t >.
Referenced by imaging::ImageAccessorInterface< float_accessor_t, double >::empty().