#include <Image.hpp>
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 |
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.
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 >.
imaging::Image< N, DATA_t >::Image | ( | ) | [inline] |
Default constructor. Sets the size of every image dimension to zero.
imaging::Image< N, DATA_t >::Image | ( | const ublas::fixed_vector< size_t, dimension > & | size | ) | [inline, explicit] |
Construct an image by specifying its dimensions.
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.
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.
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.
Image<N, DATA_t>& imaging::Image< N, DATA_t >::operator= | ( | const Image< N, DATA_t > & | source | ) | [inline] |
Assignement operator.
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.
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 >.
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 >.
const ublas::fixed_vector<size_t, dimension>& imaging::Image< N, DATA_t >::size | ( | ) | const [inline] |
Returns the size of the image.
Reimplemented from imaging::ImageInterface< N, DATA_t >.
Referenced by imaging::draw_level_set(), imaging::Image< SHAPE_DIMENSION, double >::empty(), imaging::image2matrix(), imaging::operator<<(), and imaging::Image< SHAPE_DIMENSION, double >::operator=().
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=().
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.
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 >.