SLIP  1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Attributes | Friends | Related Functions | List of all members
slip::GrayscaleImage< T > Class Template Reference

This is a grayscaleimage class. This is a two-dimensional dynamic and generic container. This container statisfies the BidirectionnalContainer concepts of the STL. It is also an 2d extension of the RandomAccessContainer concept. That is to say the bracket element access is replaced by the double bracket element access. Data are stored using a Matrix class. It extends the interface of Matrix adding image read/write operations. These operations are done using the ImageMagick library. More...

#include <GrayscaleImage.hpp>

Public Types

typedef T value_type
 
typedef GrayscaleImage< T > self
 
typedef const GrayscaleImage< T > const_self
 
typedef value_typepointer
 
typedef const value_typeconst_pointer
 
typedef value_typereference
 
typedef const value_typeconst_reference
 
typedef ptrdiff_t difference_type
 
typedef std::size_t size_type
 
typedef pointer iterator
 
typedef const_pointer const_iterator
 
typedef std::reverse_iterator
< iterator
reverse_iterator
 
typedef std::reverse_iterator
< const_iterator
const_reverse_iterator
 
typedef pointer row_iterator
 
typedef const_pointer const_row_iterator
 
typedef slip::stride_iterator
< pointer
col_iterator
 
typedef slip::stride_iterator
< const_pointer
const_col_iterator
 
typedef slip::Matrix< T >
::iterator2d 
iterator2d
 
typedef slip::Matrix< T >
::const_iterator2d 
const_iterator2d
 
typedef slip::stride_iterator
< pointer
row_range_iterator
 
typedef slip::stride_iterator
< const_pointer
const_row_range_iterator
 
typedef slip::stride_iterator
< col_iterator
col_range_iterator
 
typedef slip::stride_iterator
< const_col_iterator
const_col_range_iterator
 
typedef slip::Matrix< T >
::iterator2d_range 
iterator2d_range
 
typedef slip::Matrix< T >
::const_iterator2d_range 
const_iterator2d_range
 
typedef std::reverse_iterator
< iterator
reverse_row_iterator
 
typedef std::reverse_iterator
< const_iterator
const_reverse_row_iterator
 
typedef std::reverse_iterator
< col_iterator
reverse_col_iterator
 
typedef std::reverse_iterator
< const_col_iterator
const_reverse_col_iterator
 
typedef std::reverse_iterator
< iterator2d
reverse_iterator2d
 
typedef std::reverse_iterator
< const_iterator2d
const_reverse_iterator2d
 
typedef std::reverse_iterator
< row_range_iterator
reverse_row_range_iterator
 
typedef std::reverse_iterator
< const_row_range_iterator
const_reverse_row_range_iterator
 
typedef std::reverse_iterator
< col_range_iterator
reverse_col_range_iterator
 
typedef std::reverse_iterator
< const_col_range_iterator
const_reverse_col_range_iterator
 
typedef std::reverse_iterator
< iterator2d_range
reverse_iterator2d_range
 
typedef std::reverse_iterator
< const_iterator2d_range
const_reverse_iterator2d_range
 
typedef iterator2d default_iterator
 
typedef const_iterator2d const_default_iterator
 

Public Member Functions

void resize (const size_type height, const size_type width, const T &val=T())
 Resizes a GrayscaleImage. More...
 
std::string name () const
 Returns the name of the class. More...
 
size_type dim1 () const
 Returns the number of rows (first dimension size) in the GrayscaleImage. More...
 
size_type rows () const
 Returns the number of rows (first dimension size) in the GrayscaleImage. More...
 
size_type height () const
 Returns the height (first dimension size) in the GrayscaleImage. More...
 
size_type dim2 () const
 Returns the number of columns (second dimension size) in the GrayscaleImage. More...
 
size_type columns () const
 Returns the number of columns (second dimension size) in the GrayscaleImage. More...
 
size_type cols () const
 Returns the number of columns (second dimension size) in the GrayscaleImage. More...
 
size_type width () const
 Returns the number of columns (second dimension size) in the GrayscaleImage. More...
 
size_type size () const
 Returns the number of elements in the GrayscaleImage. More...
 
size_type max_size () const
 Returns the maximal size (number of elements) in the GrayscaleImage. More...
 
bool empty () const
 Returns true if the GrayscaleImage is empty. (Thus size() == 0) More...
 
void swap (self &M)
 Swaps data with another GrayscaleImage. More...
 
T & min () const
 Returns the min element of the GrayscaleImage according to the operator <. More...
 
T & max () const
 Returns the max element of the GrayscaleImage according to the operator <. More...
 
sum () const
 Returns the sum of the elements of the GrayscaleImage. More...
 
GrayscaleImage< T > & apply (T(*fun)(T))
 Applys the one-parameter C-function fun to each element of the GrayscaleImage. More...
 
GrayscaleImage< T > & apply (T(*fun)(const T &))
 Applys the one-parameter C-function fun to each element of the GrayscaleImage. More...
 
template<typename T>
 GrayscaleImage (const typename GrayscaleImage< T >::size_type height, const typename GrayscaleImage< T >::size_type width)
 
template<typename T>
 GrayscaleImage (const typename GrayscaleImage< T >::size_type height, const typename GrayscaleImage< T >::size_type width, const T &val)
 
template<typename T>
 GrayscaleImage (const typename GrayscaleImage< T >::size_type height, const typename GrayscaleImage< T >::size_type width, const T *val)
 
template<>
void write_ascii (const std::string &file_path_name) const
 
Constructors & Destructors
 GrayscaleImage ()
 Constructs a GrayscaleImage. More...
 
 GrayscaleImage (const size_type height, const size_type width)
 Constructs a GrayscaleImage. More...
 
 GrayscaleImage (const size_type height, const size_type width, const T &val)
 Constructs a GrayscaleImage initialized by the scalar value val. More...
 
 GrayscaleImage (const size_type height, const size_type width, const T *val)
 Constructs a GrayscaleImage initialized by an array val. More...
 
template<typename InputIterator >
 GrayscaleImage (const size_type height, const size_type width, InputIterator first, InputIterator last)
 Contructs a GrayscaleImage from a range. More...
 
 GrayscaleImage (const self &rhs)
 Constructs a copy of the GrayscaleImage rhs. More...
 
 ~GrayscaleImage ()
 Destructor of the GrayscaleImage. More...
 
iterators
iterator begin ()
 Returns a read/write iterator that points to the first element in the GrayscaleImage. Iteration is done in ordinary element order. More...
 
iterator end ()
 Returns a read/write iterator that points one past the last element in the GrayscaleImage. Iteration is done in ordinary element order. More...
 
const_iterator begin () const
 Returns a read-only (constant) iterator that points to the first element in the GrayscaleImage. Iteration is done in ordinary element order. More...
 
const_iterator end () const
 Returns a read-only (constant) iterator that points one past the last element in the GrayscaleImage. Iteration is done in ordinary element order. More...
 
reverse_iterator rbegin ()
 Returns a read/write reverse iterator that points to the last element in the GrayscaleImage. Iteration is done in reverse element order. More...
 
reverse_iterator rend ()
 Returns a read/write reverse iterator that points to one before the first element in the GrayscaleImage. Iteration is done in reverse element order. More...
 
const_reverse_iterator rbegin () const
 Returns a read-only (constant) reverse iterator that points to the last element in the GrayscaleImage. Iteration is done in reverse element order. More...
 
const_reverse_iterator rend () const
 Returns a read-only (constant) reverse iterator that points to one before the first element in the GrayscaleImage. Iteration is done in reverse element order. More...
 
row_iterator row_begin (const size_type row)
 Returns a read/write iterator that points to the first element of the row row in the GrayscaleImage. Iteration is done in ordinary element order. More...
 
row_iterator row_end (const size_type row)
 Returns a read/write iterator that points one past the end element of the row row in the GrayscaleImage. Iteration is done in ordinary element order. More...
 
const_row_iterator row_begin (const size_type row) const
 Returns a read-only iterator that points to the first element of the row row in the GrayscaleImage. Iteration is done in ordinary element order. More...
 
const_row_iterator row_end (const size_type row) const
 Returns a read-only iterator that points one past the end element of the row row in the GrayscaleImage. Iteration is done in ordinary element order. More...
 
col_iterator col_begin (const size_type col)
 Returns a read/write iterator that points to the first element of the column column in the GrayscaleImage. Iteration is done modulo the number of columns. More...
 
col_iterator col_end (const size_type col)
 Returns a read/write iterator that points one past the end element of the column column in the GrayscaleImage. Iteration is done modulo the number of columns. More...
 
const_col_iterator col_begin (const size_type col) const
 Returns a read-only iterator that points to the first element of the column column in the GrayscaleImage. Iteration is done modulo the number of columns. More...
 
const_col_iterator col_end (const size_type col) const
 Returns a read-only iterator that points one past the end element of the column column in the GrayscaleImage. Iteration is done modulo the number of columns. More...
 
row_range_iterator row_begin (const size_type row, const slip::Range< int > &range)
 Returns a read/write iterator that points to the first element of the Range range of the row row in the GrayscaleImage. Iteration is done in ordinary element order according to the Range. More...
 
row_range_iterator row_end (const size_type row, const slip::Range< int > &range)
 Returns a read/write iterator that points one past the end element of the Range range of the row row in the GrayscaleImage. Iteration is done in ordinary element order according to the Range. More...
 
const_row_range_iterator row_begin (const size_type row, const slip::Range< int > &range) const
 Returns a read-only iterator that points to the first element of the Range range of the row row in the GrayscaleImage. Iteration is done in ordinary element order according to the Range. More...
 
const_row_range_iterator row_end (const size_type row, const slip::Range< int > &range) const
 Returns a read_only iterator that points one past the last element of the Range range of the row row in the GrayscaleImage. Iteration is done in ordinary element order according to the Range. More...
 
col_range_iterator col_begin (const size_type col, const slip::Range< int > &range)
 Returns a read-write iterator that points to the first element of the Range range of the col col in the GrayscaleImage. Iteration is done in ordinary element order according to the Range. More...
 
col_range_iterator col_end (const size_type col, const slip::Range< int > &range)
 Returns a read-write iterator that points to the past the end element of the Range range of the col col in the GrayscaleImage. Iteration is done in ordinary element order according to the Range. More...
 
const_col_range_iterator col_begin (const size_type col, const slip::Range< int > &range) const
 Returns a read-only iterator that points to the first element of the Range range of the col col in the GrayscaleImage. Iteration is done in ordinary element order according to the Range. More...
 
const_col_range_iterator col_end (const size_type col, const slip::Range< int > &range) const
 Returns a read-only iterator that points to the past the end element of the Range range of the col col in the GrayscaleImage. Iteration is done in ordinary element order according to the Range. More...
 
reverse_row_iterator row_rbegin (const size_type row)
 Returns a read/write reverse iterator that points to the last element of the row row in the GrayscaleImage. Iteration is done in the reverse element order. More...
 
reverse_row_iterator row_rend (const size_type row)
 Returns a read/write reverse iterator that points one past the first element of the row row in the GrayscaleImage. Iteration is done in the reverse element order. More...
 
const_reverse_row_iterator row_rbegin (const size_type row) const
 Returns a read-only reverse iterator that points to the last element of the row row in the GrayscaleImage. Iteration is done in the reverse element order. More...
 
const_reverse_row_iterator row_rend (const size_type row) const
 Returns a read-only reverse iterator that points one past the first element of the row row in the GrayscaleImage. Iteration is done in the reverse element order. More...
 
reverse_col_iterator col_rbegin (const size_type col)
 Returns a read/write reverse iterator that points to the last element of the column column in the GrayscaleImage. Iteration is done modulo the number of columns and in the reverse element order. More...
 
reverse_col_iterator col_rend (const size_type col)
 Returns a read/write reverse iterator that points one past the first element of the column column in the GrayscaleImage. Iteration is done modulo the number of columns and in the reverse element order. More...
 
const_reverse_col_iterator col_rbegin (const size_type col) const
 Returns a read-only reverse iterator that points to the last element of the column column in the GrayscaleImage. Iteration is done modulo the number of columns and in the reverse element order. More...
 
const_reverse_col_iterator col_rend (const size_type col) const
 Returns a read-only reverse iterator that points one past the first element of the column column in the GrayscaleImage. Iteration is done modulo the number of columns and in the reverse element order. More...
 
reverse_row_range_iterator row_rbegin (const size_type row, const slip::Range< int > &range)
 Returns a read-write iterator that points to the last element of the Range range of the row row in the GrayscaleImage. Iteration is done in the reverse element order according to the Range. More...
 
reverse_row_range_iterator row_rend (const size_type row, const slip::Range< int > &range)
 Returns a read-write iterator that points one before the first element of the Range range of the row row in the GrayscaleImage. Iteration is done in the reverse element order according to the Range. More...
 
const_reverse_row_range_iterator row_rbegin (const size_type row, const slip::Range< int > &range) const
 Returns a read-only iterator that points to the last element of the Range range of the row row in the GrayscaleImage. Iteration is done in the reverse element order according to the Range. More...
 
const_reverse_row_range_iterator row_rend (const size_type row, const slip::Range< int > &range) const
 Returns a read-only iterator that points one before the first element of the Range range of the row row in the GrayscaleImage. Iteration is done in the reverse element order according to the Range. More...
 
reverse_col_range_iterator col_rbegin (const size_type col, const slip::Range< int > &range)
 Returns a read-write iterator that points to the last element of the Range range of the col col in the GrayscaleImage. Iteration is done in the reverse element order according to the Range. More...
 
reverse_col_range_iterator col_rend (const size_type col, const slip::Range< int > &range)
 Returns a read-write iterator that points to one before the first element of the Range range of the col col in the GrayscaleImage. Iteration is done in the reverse element order according to the Range. More...
 
const_reverse_col_range_iterator col_rbegin (const size_type col, const slip::Range< int > &range) const
 Returns a read_only iterator that points to the last element of the Range & range of the col col in the GrayscaleImage. Iteration is done in the reverse element order according to the Range. More...
 
const_reverse_col_range_iterator col_rend (const size_type col, const slip::Range< int > &range) const
 Returns a read-only iterator that points to the first element of the Range range of the col col in the GrayscaleImage. Iteration is done in the reverse element order according to the Range. More...
 
iterator2d upper_left ()
 Returns a read/write iterator2d that points to the first element of the GrayscaleImage. It points to the upper left element of the GrayscaleImage. More...
 
iterator2d bottom_right ()
 Returns a read/write iterator2d that points to the past the end element of the GrayscaleImage. It points to past the end element of the bottom right element of the GrayscaleImage. More...
 
const_iterator2d upper_left () const
 Returns a read-only iterator2d that points to the first element of the GrayscaleImage. It points to the upper left element of the GrayscaleImage. More...
 
const_iterator2d bottom_right () const
 Returns a read-only iterator2d that points to the past the end element of the GrayscaleImage. It points to past the end element of the bottom right element of the GrayscaleImage. More...
 
iterator2d upper_left (const Box2d< int > &box)
 Returns a read/write iterator2d that points to the first element of the GrayscaleImage. It points to the upper left element of the Box2d associated to the GrayscaleImage. More...
 
iterator2d bottom_right (const Box2d< int > &box)
 Returns a read/write iterator2d that points to the past the end element of the GrayscaleImage. It points to past the end element of the bottom right element of the Box2d associated to the GrayscaleImage. More...
 
const_iterator2d upper_left (const Box2d< int > &box) const
 Returns a read only iterator2d that points to the first element of the GrayscaleImage. It points to the upper left element of the Box2d associated to the GrayscaleImage. More...
 
const_iterator2d bottom_right (const Box2d< int > &box) const
 Returns a read only iterator2d that points to the past the end element of the GrayscaleImage. It points to past the end element of the bottom right element of the Box2d associated to the GrayscaleImage. More...
 
iterator2d_range upper_left (const Range< int > &row_range, const Range< int > &col_range)
 Returns a read/write iterator2d_range that points to the upper left element of the ranges row_range and col_range associated to the GrayscaleImage. More...
 
iterator2d_range bottom_right (const Range< int > &row_range, const Range< int > &col_range)
 Returns a read/write iterator2d_range that points to the past the end bottom right element of the ranges row_range and col_range associated to the GrayscaleImage. More...
 
const_iterator2d_range upper_left (const Range< int > &row_range, const Range< int > &col_range) const
 Returns a read-only iterator2d_range that points to the to the upper left element of the ranges row_range and col_range associated to the GrayscaleImage. More...
 
const_iterator2d_range bottom_right (const Range< int > &row_range, const Range< int > &col_range) const
 Returns a read-only iterator2d_range that points to the past the end bottom right element of the ranges row_range and col_range associated to the GrayscaleImage. More...
 
iterator2d_range upper_left (const Range< int > &range)
 Returns a read/write iterator2d_range that points to the upper left element of the Range range associated to the GrayscaleImage. The same range is applied for rows and cols. More...
 
iterator2d_range bottom_right (const Range< int > &range)
 Returns a read/write iterator2d_range that points to the past the end bottom right element of the Range range associated to the GrayscaleImage. The same range is applied for rows and cols. More...
 
const_iterator2d_range upper_left (const Range< int > &range) const
 Returns a read-only iterator2d_range that points to the to the upper left element of the Range range associated to the GrayscaleImage. More...
 
const_iterator2d_range bottom_right (const Range< int > &range) const
 Returns a read-only const_iterator2d_range that points to the past the end bottom right element of the Range range associated to the GrayscaleImage. The same range is applied for rows and cols. More...
 
reverse_iterator2d rupper_left ()
 Returns a read/write reverse iterator2d. It points to the bottom right element of the GrayscaleImage. Iteration is done within the GrayscaleImage in the reverse order. More...
 
reverse_iterator2d rbottom_right ()
 Returns a read/write reverse iterator2d. It points to past the upper left element of the GrayscaleImage. Iteration is done in the reverse order. More...
 
const_reverse_iterator2d rupper_left () const
 Returns a read only reverse iterator2d that points. It points to the bottom right element of the GrayscaleImage. Iteration is done within the GrayscaleImage in the reverse order. More...
 
const_reverse_iterator2d rbottom_right () const
 Returns a read only reverse iterator2d. It points to past the upper left element of the GrayscaleImage. Iteration is done in the reverse order. More...
 
reverse_iterator2d rupper_left (const Box2d< int > &box)
 Returns a read/write reverse iterator2d. It points to the bottom right element of the Box2d associated to the GrayscaleImage. Iteration is done in the reverse order. More...
 
reverse_iterator2d rbottom_right (const Box2d< int > &box)
 Returns a read/write reverse iterator2d. It points to one before the upper left element of the Box2d box associated to the GrayscaleImage. More...
 
const_reverse_iterator2d rupper_left (const Box2d< int > &box) const
 Returns a read only reverse iterator2d. It points to the bottom right element of the Box2d box associated to the GrayscaleImage. Iteration is done in the reverse order. More...
 
const_reverse_iterator2d rbottom_right (const Box2d< int > &box) const
 Returns a read-only reverse iterator2d. It points to one before the element of the bottom right element of the Box2d box associated to the GrayscaleImage. More...
 
reverse_iterator2d_range rupper_left (const Range< int > &row_range, const Range< int > &col_range)
 Returns a read/write reverse_iterator2d_range that points to the past the bottom right element of the ranges row_range and col_range associated to the GrayscaleImage. Iteration is done in the reverse order. More...
 
reverse_iterator2d_range rbottom_right (const Range< int > &row_range, const Range< int > &col_range)
 Returns a read/write reverse_iterator2d_range that points to one before the upper left element of the ranges row_range and col_range associated to the GrayscaleImage. Iteration is done in the reverse order. More...
 
const_reverse_iterator2d_range rupper_left (const Range< int > &row_range, const Range< int > &col_range) const
 Returns a read-only reverse_iterator2d_range that points to the past the bottom right element of the ranges row_range and col_range associated to the GrayscaleImage. Iteration is done in the reverse order. More...
 
const_reverse_iterator2d_range rbottom_right (const Range< int > &row_range, const Range< int > &col_range) const
 Returns a read-only reverse_iterator2d_range that points to one before the upper left element of the ranges row_range and col_range associated to the GrayscaleImage.Iteration is done in the reverse order. More...
 
reverse_iterator2d_range rupper_left (const Range< int > &range)
 Returns a read/write reverse_iterator2d_range that points to the bottom right element of the Range range associated to the GrayscaleImage. The same range is applied for rows and cols. Iteration is done in the reverse order. More...
 
reverse_iterator2d_range rbottom_right (const Range< int > &range)
 Returns a read/write reverse_iterator2d_range that points to one before the upper left element of the Range range associated to the GrayscaleImage. The same range is applied for rows and cols. Iteration is done in the reverse order. More...
 
const_reverse_iterator2d_range rupper_left (const Range< int > &range) const
 Returns a read-only reverse_iterator2d_range that points to the to the bottom right element of the Range range associated to the GrayscaleImage. The same range is applied for rows and cols. Iteration is done in the reverse order. More...
 
const_reverse_iterator2d_range rbottom_right (const Range< int > &range) const
 Returns a read_only reverse_iterator2d_range that points to one before the upper left element of the Range range associated to the GrayscaleImage. The same range is applied for rows and cols. Iteration is done in the reverse order. More...
 
Assignment operators and methods
GrayscaleImageoperator= (const self &rhs)
 Assign a GrayscaleImage. More...
 
selfoperator= (const T &val)
 Affects all the element of the GrayscaleImage by val. More...
 
void fill (const T &value)
 Fills the container range [begin(),begin()+size()) with copies of value. More...
 
void fill (const T *value)
 Fills the container range [begin(),begin()+size()) with a copy of the value array. More...
 
template<typename InputIterator >
void fill (InputIterator first, InputIterator last)
 Fills the container range [begin(),begin()+size()) with a copy of the range [first,last) More...
 
Element access operators
pointer operator[] (const size_type i)
 Subscript access to the row datas contained in the GrayscaleImage. More...
 
const_pointer operator[] (const size_type i) const
 Subscript access to the row datas contained in the GrayscaleImage. More...
 
reference operator() (const size_type i, const size_type j)
 Subscript access to the data contained in the GrayscaleImage. More...
 
const_reference operator() (const size_type i, const size_type j) const
 Subscript access to the data contained in the GrayscaleImage. More...
 
reference operator() (const Point2d< size_type > &point2d)
 Subscript access to the data contained in the GrayscaleImage. More...
 
const_reference operator() (const Point2d< size_type > &point2d) const
 Subscript access to the data contained in the GrayscaleImage. More...
 
self operator() (const Range< int > &row_range, const Range< int > &col_range)
 Subscript access to the data contained in the GrayscaleImage. More...
 
Arithmetic operators
selfoperator+= (const T &val)
 Add val to each element of the GrayscaleImage. More...
 
selfoperator-= (const T &val)
 
selfoperator*= (const T &val)
 
selfoperator/= (const T &val)
 
self operator- () const
 
selfoperator+= (const self &rhs)
 
selfoperator-= (const self &rhs)
 
selfoperator*= (const self &rhs)
 
selfoperator/= (const self &rhs)
 

Static Public Attributes

static const std::size_t DIM = 2
 

Friends

class boost::serialization::access
 
Comparison operators
bool operator== (const GrayscaleImage< T > &x, const GrayscaleImage< T > &y)
 GrayscaleImage equality comparison. More...
 
bool operator!= (const GrayscaleImage< T > &x, const GrayscaleImage< T > &y)
 GrayscaleImage inequality comparison. More...
 
bool operator< (const GrayscaleImage< T > &x, const GrayscaleImage< T > &y)
 Less than comparison operator (GrayscaleImage ordering relation) More...
 
bool operator> (const GrayscaleImage< T > &x, const GrayscaleImage< T > &y)
 More than comparison operator. More...
 
bool operator<= (const GrayscaleImage< T > &x, const GrayscaleImage< T > &y)
 Less than equal comparison operator. More...
 
bool operator>= (const GrayscaleImage< T > &x, const GrayscaleImage< T > &y)
 More than equal comparison operator. More...
 

Related Functions

(Note that these are not member functions.)

template<typename T >
T & min (const GrayscaleImage< T > &M1)
 Returns the min element of a GrayscaleImage. More...
 
template<typename T >
T & max (const GrayscaleImage< T > &M1)
 Returns the max element of a GrayscaleImage. More...
 

i/o operators

std::ostream & operator<< (std::ostream &out, const self &a)
 Write the GrayscaleImage to the ouput stream. More...
 
void write_ascii (const std::string &file_path_name) const
 Write the GrayscaleImage to an ASCII file. More...
 
void read_ascii (const std::string &file_path_name)
 Read the GrayscaleImage from an ASCII file. More...
 

Detailed Description

template<typename T>
class slip::GrayscaleImage< T >

This is a grayscaleimage class. This is a two-dimensional dynamic and generic container. This container statisfies the BidirectionnalContainer concepts of the STL. It is also an 2d extension of the RandomAccessContainer concept. That is to say the bracket element access is replaced by the double bracket element access. Data are stored using a Matrix class. It extends the interface of Matrix adding image read/write operations. These operations are done using the ImageMagick library.

Author
Benoit Tremblais <tremblais_AT_sic.univ-poitiers.fr>
Version
0.0.3
Since
1.0.0
Date
2014/04/01
Parameters
T.Type of object in the GrayscaleImage
Axis conventions:
iterator2d_conventions.jpg
axis and notation conventions
Examples:
color_edge_detection.cpp, edge_detection.cpp, fft2d.cpp, fft_crosscorrelation2d.cpp, median_filter.cpp, median_filter_ind_safeN.cpp, median_filter_ind_unsafeN.cpp, median_filter_safe_generic.cpp, median_filter_safeN.cpp, median_filter_unsafeN.cpp, netcdf_file_io.cpp, regularvector2dfield2d_op.cpp, svd_decomp.cpp, and test_graph.cpp.

Definition at line 134 of file GrayscaleImage.hpp.

Member Typedef Documentation

template<typename T>
typedef slip::stride_iterator<pointer> slip::GrayscaleImage< T >::col_iterator

Definition at line 214 of file GrayscaleImage.hpp.

Definition at line 222 of file GrayscaleImage.hpp.

Definition at line 215 of file GrayscaleImage.hpp.

Definition at line 223 of file GrayscaleImage.hpp.

template<typename T>
typedef const_iterator2d slip::GrayscaleImage< T >::const_default_iterator

Definition at line 243 of file GrayscaleImage.hpp.

template<typename T>
typedef const_pointer slip::GrayscaleImage< T >::const_iterator

Definition at line 206 of file GrayscaleImage.hpp.

template<typename T>
typedef slip::Matrix<T>::const_iterator2d slip::GrayscaleImage< T >::const_iterator2d

Definition at line 219 of file GrayscaleImage.hpp.

Definition at line 225 of file GrayscaleImage.hpp.

template<typename T>
typedef const value_type* slip::GrayscaleImage< T >::const_pointer

Definition at line 198 of file GrayscaleImage.hpp.

template<typename T>
typedef const value_type& slip::GrayscaleImage< T >::const_reference

Definition at line 200 of file GrayscaleImage.hpp.

template<typename T>
typedef std::reverse_iterator<const_col_iterator> slip::GrayscaleImage< T >::const_reverse_col_iterator

Definition at line 231 of file GrayscaleImage.hpp.

template<typename T>
typedef std::reverse_iterator<const_col_range_iterator> slip::GrayscaleImage< T >::const_reverse_col_range_iterator

Definition at line 237 of file GrayscaleImage.hpp.

template<typename T>
typedef std::reverse_iterator<const_iterator> slip::GrayscaleImage< T >::const_reverse_iterator

Definition at line 209 of file GrayscaleImage.hpp.

template<typename T>
typedef std::reverse_iterator<const_iterator2d> slip::GrayscaleImage< T >::const_reverse_iterator2d

Definition at line 233 of file GrayscaleImage.hpp.

template<typename T>
typedef std::reverse_iterator<const_iterator2d_range> slip::GrayscaleImage< T >::const_reverse_iterator2d_range

Definition at line 239 of file GrayscaleImage.hpp.

template<typename T>
typedef std::reverse_iterator<const_iterator> slip::GrayscaleImage< T >::const_reverse_row_iterator

Definition at line 229 of file GrayscaleImage.hpp.

template<typename T>
typedef std::reverse_iterator<const_row_range_iterator> slip::GrayscaleImage< T >::const_reverse_row_range_iterator

Definition at line 235 of file GrayscaleImage.hpp.

template<typename T>
typedef const_pointer slip::GrayscaleImage< T >::const_row_iterator

Definition at line 213 of file GrayscaleImage.hpp.

Definition at line 221 of file GrayscaleImage.hpp.

template<typename T>
typedef const GrayscaleImage<T> slip::GrayscaleImage< T >::const_self

Definition at line 195 of file GrayscaleImage.hpp.

template<typename T>
typedef iterator2d slip::GrayscaleImage< T >::default_iterator

Definition at line 242 of file GrayscaleImage.hpp.

template<typename T>
typedef ptrdiff_t slip::GrayscaleImage< T >::difference_type

Definition at line 202 of file GrayscaleImage.hpp.

template<typename T>
typedef pointer slip::GrayscaleImage< T >::iterator

Definition at line 205 of file GrayscaleImage.hpp.

template<typename T>
typedef slip::Matrix<T>::iterator2d slip::GrayscaleImage< T >::iterator2d

Definition at line 218 of file GrayscaleImage.hpp.

template<typename T>
typedef slip::Matrix<T>::iterator2d_range slip::GrayscaleImage< T >::iterator2d_range

Definition at line 224 of file GrayscaleImage.hpp.

template<typename T>
typedef value_type* slip::GrayscaleImage< T >::pointer

Definition at line 197 of file GrayscaleImage.hpp.

template<typename T>
typedef value_type& slip::GrayscaleImage< T >::reference

Definition at line 199 of file GrayscaleImage.hpp.

template<typename T>
typedef std::reverse_iterator<col_iterator> slip::GrayscaleImage< T >::reverse_col_iterator

Definition at line 230 of file GrayscaleImage.hpp.

template<typename T>
typedef std::reverse_iterator<col_range_iterator> slip::GrayscaleImage< T >::reverse_col_range_iterator

Definition at line 236 of file GrayscaleImage.hpp.

template<typename T>
typedef std::reverse_iterator<iterator> slip::GrayscaleImage< T >::reverse_iterator

Definition at line 208 of file GrayscaleImage.hpp.

template<typename T>
typedef std::reverse_iterator<iterator2d> slip::GrayscaleImage< T >::reverse_iterator2d

Definition at line 232 of file GrayscaleImage.hpp.

template<typename T>
typedef std::reverse_iterator<iterator2d_range> slip::GrayscaleImage< T >::reverse_iterator2d_range

Definition at line 238 of file GrayscaleImage.hpp.

template<typename T>
typedef std::reverse_iterator<iterator> slip::GrayscaleImage< T >::reverse_row_iterator

Definition at line 228 of file GrayscaleImage.hpp.

template<typename T>
typedef std::reverse_iterator<row_range_iterator> slip::GrayscaleImage< T >::reverse_row_range_iterator

Definition at line 234 of file GrayscaleImage.hpp.

template<typename T>
typedef pointer slip::GrayscaleImage< T >::row_iterator

Definition at line 212 of file GrayscaleImage.hpp.

Definition at line 220 of file GrayscaleImage.hpp.

template<typename T>
typedef GrayscaleImage<T> slip::GrayscaleImage< T >::self

Definition at line 194 of file GrayscaleImage.hpp.

template<typename T>
typedef std::size_t slip::GrayscaleImage< T >::size_type

Definition at line 203 of file GrayscaleImage.hpp.

template<typename T>
typedef T slip::GrayscaleImage< T >::value_type

Definition at line 193 of file GrayscaleImage.hpp.

Constructor & Destructor Documentation

template<typename T >
slip::GrayscaleImage< T >::GrayscaleImage ( )
inline

Constructs a GrayscaleImage.

Definition at line 2506 of file GrayscaleImage.hpp.

template<typename T>
slip::GrayscaleImage< T >::GrayscaleImage ( const size_type  height,
const size_type  width 
)

Constructs a GrayscaleImage.

Parameters
heightfirst dimension of the GrayscaleImage
widthsecond dimension of the GrayscaleImage
template<typename T>
slip::GrayscaleImage< T >::GrayscaleImage ( const size_type  height,
const size_type  width,
const T &  val 
)

Constructs a GrayscaleImage initialized by the scalar value val.

Parameters
heightfirst dimension of the GrayscaleImage
widthsecond dimension of the GrayscaleImage
valinitialization value of the elements
template<typename T>
slip::GrayscaleImage< T >::GrayscaleImage ( const size_type  height,
const size_type  width,
const T *  val 
)

Constructs a GrayscaleImage initialized by an array val.

Parameters
heightfirst dimension of the GrayscaleImage
widthsecond dimension of the GrayscaleImage
valinitialization array value of the elements
template<typename T>
template<typename InputIterator >
slip::GrayscaleImage< T >::GrayscaleImage ( const size_type  height,
const size_type  width,
InputIterator  first,
InputIterator  last 
)
inline

Contructs a GrayscaleImage from a range.

Parameters
heightfirst dimension of the GrayscaleImage
widthsecond dimension of the GrayscaleImage
firstAn input iterator.
lastAn input iterator.

Create a GrayscaleImage consisting of copies of the elements from [first,last).

Definition at line 298 of file GrayscaleImage.hpp.

template<typename T>
slip::GrayscaleImage< T >::GrayscaleImage ( const self rhs)
inline

Constructs a copy of the GrayscaleImage rhs.

Definition at line 2535 of file GrayscaleImage.hpp.

template<typename T >
slip::GrayscaleImage< T >::~GrayscaleImage ( )
inline

Destructor of the GrayscaleImage.

Definition at line 2541 of file GrayscaleImage.hpp.

template<typename T>
template<typename T>
slip::GrayscaleImage< T >::GrayscaleImage ( const typename GrayscaleImage< T >::size_type  height,
const typename GrayscaleImage< T >::size_type  width 
)
inline

Definition at line 2512 of file GrayscaleImage.hpp.

template<typename T>
template<typename T>
slip::GrayscaleImage< T >::GrayscaleImage ( const typename GrayscaleImage< T >::size_type  height,
const typename GrayscaleImage< T >::size_type  width,
const T &  val 
)
inline

Definition at line 2519 of file GrayscaleImage.hpp.

template<typename T>
template<typename T>
slip::GrayscaleImage< T >::GrayscaleImage ( const typename GrayscaleImage< T >::size_type  height,
const typename GrayscaleImage< T >::size_type  width,
const T *  val 
)
inline

Definition at line 2527 of file GrayscaleImage.hpp.

Member Function Documentation

template<typename T>
GrayscaleImage< T > & slip::GrayscaleImage< T >::apply ( T(*)(T)  fun)
inline

Applys the one-parameter C-function fun to each element of the GrayscaleImage.

Parameters
funThe one-parameter C function
Returns
the resulting GrayscaleImage
Example:
//fill M with values from 1 to 49 with step 1
slip::iota(M.begin(),M.end(),1.0,1.0);
//apply std::sqrt to each element of M

Definition at line 3554 of file GrayscaleImage.hpp.

template<typename T>
GrayscaleImage< T > & slip::GrayscaleImage< T >::apply ( T(*)(const T &)  fun)
inline

Applys the one-parameter C-function fun to each element of the GrayscaleImage.

Parameters
funThe one-const-parameter C function
Returns
the resulting GrayscaleImage
Example:
//fill M with values from 1 to 49 with step 1
slip::iota(M.begin(),M.end(),1.0,1.0);
//apply std::sqrt to each element of M

Definition at line 3562 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::iterator slip::GrayscaleImage< T >::begin ( )
inline

Returns a read/write iterator that points to the first element in the GrayscaleImage. Iteration is done in ordinary element order.

Returns
begin iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
//copy the sum of the elements of A1 and A2 in S
std::transform(A1.begin(),A1.end(),
A2.begin(),S.begin(),
std::plus<double>());

Definition at line 2577 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::const_iterator slip::GrayscaleImage< T >::begin ( ) const
inline

Returns a read-only (constant) iterator that points to the first element in the GrayscaleImage. Iteration is done in ordinary element order.

Returns
const begin iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
//copy the sum of A1 and A2 in S
std::transform(A1.begin(),A1.end(),
A2.begin(),S.begin(),
std::plus<double>());

Definition at line 2591 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::iterator2d slip::GrayscaleImage< T >::bottom_right ( )
inline

Returns a read/write iterator2d that points to the past the end element of the GrayscaleImage. It points to past the end element of the bottom right element of the GrayscaleImage.

Returns
begin iterator2d value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.
Example:
//copy the elements of A1 in A2

Definition at line 2946 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::const_iterator2d slip::GrayscaleImage< T >::bottom_right ( ) const
inline

Returns a read-only iterator2d that points to the past the end element of the GrayscaleImage. It points to past the end element of the bottom right element of the GrayscaleImage.

Returns
begin const iterator2d value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.
Example:
//copy the elements of A1 in A2

Definition at line 2953 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::iterator2d slip::GrayscaleImage< T >::bottom_right ( const Box2d< int > &  box)
inline

Returns a read/write iterator2d that points to the past the end element of the GrayscaleImage. It points to past the end element of the bottom right element of the Box2d associated to the GrayscaleImage.

Parameters
boxa Box2d defining the range of indices to iterate within the GrayscaleImage.
Returns
end iterator2d value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.
Precondition
The box indices must be inside the range of the GrayscaleImage ones.
Example:
slip::Box2d<int> box(1,1,3,2);
//copy the elements of A1 inside the box which upper_left element
//is located in (1,1) and the bottom right element is in (3,2)

Definition at line 2979 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::const_iterator2d slip::GrayscaleImage< T >::bottom_right ( const Box2d< int > &  box) const
inline

Returns a read only iterator2d that points to the past the end element of the GrayscaleImage. It points to past the end element of the bottom right element of the Box2d associated to the GrayscaleImage.

Parameters
boxa Box2d defining the range of indices to iterate within the GrayscaleImage.
Returns
end const iterator2d value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.
Precondition
The box indices must be inside the range of the GrayscaleImage ones.
Example:
slip::Box2d<int> box(1,1,3,2);
//copy the elements of A1 inside the box which upper_left element
//is located in (1,1) and the bottom right element is in (3,2)

Definition at line 2986 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::iterator2d_range slip::GrayscaleImage< T >::bottom_right ( const Range< int > &  row_range,
const Range< int > &  col_range 
)
inline

Returns a read/write iterator2d_range that points to the past the end bottom right element of the ranges row_range and col_range associated to the GrayscaleImage.

Parameters
row_rangeThe range of the rows.
col_rangeThe range of the columns.
Precondition
row_range and col_range must be valid.
The ranges indices must be inside the ranges of the GrayscaleImage ones.
Returns
iterator2d_range value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.
Example:
slip::Range<int> row_range(0,A1.dim2()-1,2);
slip::Range<int> col_range(0,A1.dim1()-1,2);
//copy the elements of A1 within the ranges row_range and col_range
//in A2
std::copy(A1.upper_left(row_range,col_range),
A1.bottom_right(row_range,col_range),A2.upper_left());

Definition at line 3014 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::const_iterator2d_range slip::GrayscaleImage< T >::bottom_right ( const Range< int > &  row_range,
const Range< int > &  col_range 
) const
inline

Returns a read-only iterator2d_range that points to the past the end bottom right element of the ranges row_range and col_range associated to the GrayscaleImage.

Parameters
row_rangeThe range of the rows.
col_rangeThe range of the columns.
Precondition
row_range and col_range must be valid.
The ranges indices must be inside the ranges of the GrayscaleImage ones.
Returns
const_iterator2d_range value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.
Example:
slip::Range<int> row_range(0,A1.dim2()-1,2);
slip::Range<int> col_range(0,A1.dim1()-1,2);
//copy the elements of A1 within the ranges row_range and col_range
//in A2
std::copy(A1.upper_left(row_range,col_range),
A1.bottom_right(row_range,col_range),A2.upper_left());

Definition at line 3023 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::iterator2d_range slip::GrayscaleImage< T >::bottom_right ( const Range< int > &  range)
inline

Returns a read/write iterator2d_range that points to the past the end bottom right element of the Range range associated to the GrayscaleImage. The same range is applied for rows and cols.

Parameters
rangeThe range of the rows and the cols.
Precondition
range must be valid.
The range indices must be inside the ranges of the GrayscaleImage ones.
Returns
iterator2d_range value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.
Example:
slip::Range<int> range(0,A1.dim2()-1,2);
//copy the elements of A1 within the range range
//in A2
std::copy(A1.upper_left(range),A1.bottom_right(range),A2.upper_left());

Definition at line 3050 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::const_iterator2d_range slip::GrayscaleImage< T >::bottom_right ( const Range< int > &  range) const
inline

Returns a read-only const_iterator2d_range that points to the past the end bottom right element of the Range range associated to the GrayscaleImage. The same range is applied for rows and cols.

Parameters
rangeThe range of the rows and the cols.
Precondition
range must be valid.
The range indices must be inside the ranges of the GrayscaleImage ones.
Returns
const_iterator2d_range value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.
Example:
slip::Range<int> range(0,A1.dim2()-1,2);
//copy the elements of A1 within the range range
//in A2
std::copy(A1.upper_left(range),A1.bottom_right(range),A2.upper_left());

Definition at line 3058 of file GrayscaleImage.hpp.

template<typename T>
col_iterator slip::GrayscaleImage< T >::col_begin ( const size_type  col)

Returns a read/write iterator that points to the first element of the column column in the GrayscaleImage. Iteration is done modulo the number of columns.

Parameters
colThe index of the column to iterate.
Returns
begin col_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
col must be compatible with the range of the GrayscaleImage
Example:
//copy the elements of the column 0 of A1 in the column 1 of A2
std::copy(A1.col_begin(0),A1.col_end(0),A2.col_begin(1));
template<typename T>
const_col_iterator slip::GrayscaleImage< T >::col_begin ( const size_type  col) const

Returns a read-only iterator that points to the first element of the column column in the GrayscaleImage. Iteration is done modulo the number of columns.

Parameters
colThe index of the column to iterate.
Returns
begin const_col_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
col must be compatible with the range of the GrayscaleImage.
Example:
//copy the elements of the column 0 of A1 in the column 1 of A2
std::copy(A1.col_begin(0),A1.col_end(0),A2.col_begin(1));
template<typename T>
col_range_iterator slip::GrayscaleImage< T >::col_begin ( const size_type  col,
const slip::Range< int > &  range 
)

Returns a read-write iterator that points to the first element of the Range range of the col col in the GrayscaleImage. Iteration is done in ordinary element order according to the Range.

Parameters
colThe index of the column to iterate.
rangeRange of the column to iterate
Returns
begin col_range_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
col must be compatible with the range of the GrayscaleImage.
The range must be inside the whole range of the GrayscaleImage.
Example:
slip::Range<int> range(0,A1.dim1()-1,2);
//copy the elements of the column 0 of A1 iterated according to the
//range in the column 1 of A2
std::copy(A1.col_begin(0,range),A1.col_end(0,range),A2.col_begin(1));
template<typename T>
const_col_range_iterator slip::GrayscaleImage< T >::col_begin ( const size_type  col,
const slip::Range< int > &  range 
) const

Returns a read-only iterator that points to the first element of the Range range of the col col in the GrayscaleImage. Iteration is done in ordinary element order according to the Range.

Parameters
colThe index of the column to iterate.
rangeRange of the column to iterate.
Returns
begin const_col_range_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
col must be compatible with the range of the GrayscaleImage.
The range must be inside the whole range of the GrayscaleImage.
Example:
slip::Range<int> range(0,A1.dim1()-1,2);
//copy the elements of the column 0 of A1 iterated according to the
//range in the column 1 of A2
std::copy(A1.col_begin(0,range),A1.col_end(0,range),A2.col_begin(1));
template<typename T>
col_iterator slip::GrayscaleImage< T >::col_end ( const size_type  col)

Returns a read/write iterator that points one past the end element of the column column in the GrayscaleImage. Iteration is done modulo the number of columns.

Parameters
colThe index of the column to iterate.
Returns
begin col_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
col must be compatible with the range of the GrayscaleImage.
Example:
//copy the elements of the column 0 of A1 in the column 1 of A2
std::copy(A1.col_begin(0),A1.col_end(0),A2.col_begin(1));
template<typename T>
const_col_iterator slip::GrayscaleImage< T >::col_end ( const size_type  col) const

Returns a read-only iterator that points one past the end element of the column column in the GrayscaleImage. Iteration is done modulo the number of columns.

Parameters
colThe index of the column
Returns
begin const_col_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
col must be compatible with the range of the GrayscaleImage.
Example:
//copy the elements of the column 0 of A1 in the column 1 of A2
std::copy(A1.col_begin(0),A1.col_end(0),A2.col_begin(1));
template<typename T>
col_range_iterator slip::GrayscaleImage< T >::col_end ( const size_type  col,
const slip::Range< int > &  range 
)

Returns a read-write iterator that points to the past the end element of the Range range of the col col in the GrayscaleImage. Iteration is done in ordinary element order according to the Range.

Parameters
colThe index of the column to iterate.
rangeRange of the column to iterate.
Returns
begin col_range_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
col must be compatible with the range of the GrayscaleImage.
The range must be inside the whole range of the GrayscaleImage.
Example:
slip::Range<int> range(0,A1.dim1()-1,2);
//copy the elements of the column 0 of A1 iterated according to the
//range in the column 1 of A2
std::copy(A1.col_begin(0,range),A1.col_end(0,range),A2.col_begin(1));
template<typename T>
const_col_range_iterator slip::GrayscaleImage< T >::col_end ( const size_type  col,
const slip::Range< int > &  range 
) const

Returns a read-only iterator that points to the past the end element of the Range range of the col col in the GrayscaleImage. Iteration is done in ordinary element order according to the Range.

Parameters
colThe index of the column to iterate.
rangeRange of the column to iterate
Returns
begin const_col_range_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
col must be compatible with the range of the GrayscaleImage.
The range must be inside the whole range of the GrayscaleImage.
Example:
slip::Range<int> range(0,A1.dim1()-1,2);
//copy the elements of the column 0 of A1 iterated according to the
//range in the column 1 of A2
std::copy(A1.col_begin(0,range),A1.col_end(0,range),A2.col_begin(1));
template<typename T>
reverse_col_iterator slip::GrayscaleImage< T >::col_rbegin ( const size_type  col)

Returns a read/write reverse iterator that points to the last element of the column column in the GrayscaleImage. Iteration is done modulo the number of columns and in the reverse element order.

Parameters
colThe index of the column to iterate.
Returns
begin col_reverse_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
col must be compatible with the range of the GrayscaleImage.
template<typename T>
const_reverse_col_iterator slip::GrayscaleImage< T >::col_rbegin ( const size_type  col) const

Returns a read-only reverse iterator that points to the last element of the column column in the GrayscaleImage. Iteration is done modulo the number of columns and in the reverse element order.

Parameters
colThe index of the column to iterate.
Returns
begin const_reverse_col_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
col must be compatible with the range of the GrayscaleImage.
template<typename T>
reverse_col_range_iterator slip::GrayscaleImage< T >::col_rbegin ( const size_type  col,
const slip::Range< int > &  range 
)

Returns a read-write iterator that points to the last element of the Range range of the col col in the GrayscaleImage. Iteration is done in the reverse element order according to the Range.

Parameters
colThe index of the column to iterate.
rangeRange of the column to iterate.
Returns
begin reverse_col_range_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
col must be compatible with the range of the GrayscaleImage.
The range must be inside the whole range of the GrayscaleImage.
template<typename T>
const_reverse_col_range_iterator slip::GrayscaleImage< T >::col_rbegin ( const size_type  col,
const slip::Range< int > &  range 
) const

Returns a read_only iterator that points to the last element of the Range & range of the col col in the GrayscaleImage. Iteration is done in the reverse element order according to the Range.

Parameters
colThe index of the column to iterate.
rangeRange of the column to iterate.
Returns
begin const_reverse_col_range_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
col must be compatible with the range of the GrayscaleImage.
The range must be inside the whole range of the GrayscaleImage.
template<typename T>
reverse_col_iterator slip::GrayscaleImage< T >::col_rend ( const size_type  col)

Returns a read/write reverse iterator that points one past the first element of the column column in the GrayscaleImage. Iteration is done modulo the number of columns and in the reverse element order.

Parameters
colThe index of the column to iterate.
Returns
end reverse_col_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
col must be compatible with the range of the GrayscaleImage.
template<typename T>
const_reverse_col_iterator slip::GrayscaleImage< T >::col_rend ( const size_type  col) const

Returns a read-only reverse iterator that points one past the first element of the column column in the GrayscaleImage. Iteration is done modulo the number of columns and in the reverse element order.

Parameters
colThe index of the column to iterate.
Returns
end const_reverse_col_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
col must be compatible with the range of the GrayscaleImage.
template<typename T>
reverse_col_range_iterator slip::GrayscaleImage< T >::col_rend ( const size_type  col,
const slip::Range< int > &  range 
)

Returns a read-write iterator that points to one before the first element of the Range range of the col col in the GrayscaleImage. Iteration is done in the reverse element order according to the Range.

Parameters
colThe index of the column to iterate.
rangeRange of the column to iterate.
Returns
reverse_col_range_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
col must be compatible with the range of the GrayscaleImage.
The range must be inside the whole range of the GrayscaleImage.
template<typename T>
const_reverse_col_range_iterator slip::GrayscaleImage< T >::col_rend ( const size_type  col,
const slip::Range< int > &  range 
) const

Returns a read-only iterator that points to the first element of the Range range of the col col in the GrayscaleImage. Iteration is done in the reverse element order according to the Range.

Parameters
colThe index of the column to iterate.
rangeRange of the column to iterate.
Returns
const_reverse_col_range_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
col must be compatible with the range of the GrayscaleImage.
The range must be inside the whole range of the GrayscaleImage.
template<typename T >
GrayscaleImage< T >::size_type slip::GrayscaleImage< T >::cols ( ) const
inline

Returns the number of columns (second dimension size) in the GrayscaleImage.

Definition at line 3430 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::size_type slip::GrayscaleImage< T >::columns ( ) const
inline

Returns the number of columns (second dimension size) in the GrayscaleImage.

Definition at line 3425 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::size_type slip::GrayscaleImage< T >::dim1 ( ) const
inline

Returns the number of rows (first dimension size) in the GrayscaleImage.

Definition at line 3400 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::size_type slip::GrayscaleImage< T >::dim2 ( ) const
inline

Returns the number of columns (second dimension size) in the GrayscaleImage.

Definition at line 3415 of file GrayscaleImage.hpp.

template<typename T >
bool slip::GrayscaleImage< T >::empty ( ) const
inline

Returns true if the GrayscaleImage is empty. (Thus size() == 0)

Definition at line 3448 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::iterator slip::GrayscaleImage< T >::end ( )
inline

Returns a read/write iterator that points one past the last element in the GrayscaleImage. Iteration is done in ordinary element order.

Returns
end iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
//copy the sum of the elements of A1 and A2 in S
std::transform(A1.begin(),A1.end(),
A2.begin(),S.begin(),
std::plus<double>());

Definition at line 2584 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::const_iterator slip::GrayscaleImage< T >::end ( ) const
inline

Returns a read-only (constant) iterator that points one past the last element in the GrayscaleImage. Iteration is done in ordinary element order.

Returns
const end iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
//copy the sum of the elements of A1 and A2 in S
std::transform(A1.begin(),A1.end(),
A2.begin(),S.begin(),
std::plus<double>());

Definition at line 2599 of file GrayscaleImage.hpp.

template<typename T>
void slip::GrayscaleImage< T >::fill ( const T &  value)
inline

Fills the container range [begin(),begin()+size()) with copies of value.

Parameters
valueA reference-to-const of arbitrary type.

Definition at line 1957 of file GrayscaleImage.hpp.

template<typename T>
void slip::GrayscaleImage< T >::fill ( const T *  value)
inline

Fills the container range [begin(),begin()+size()) with a copy of the value array.

Parameters
valueA pointer of arbitrary type.

Definition at line 1968 of file GrayscaleImage.hpp.

template<typename T>
template<typename InputIterator >
void slip::GrayscaleImage< T >::fill ( InputIterator  first,
InputIterator  last 
)
inline

Fills the container range [begin(),begin()+size()) with a copy of the range [first,last)

Parameters
firstAn input iterator.
lastAn input iterator.

Definition at line 1982 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::size_type slip::GrayscaleImage< T >::height ( ) const
inline

Returns the height (first dimension size) in the GrayscaleImage.

Definition at line 3405 of file GrayscaleImage.hpp.

template<typename T >
T & slip::GrayscaleImage< T >::max ( ) const
inline

Returns the max element of the GrayscaleImage according to the operator <.

Precondition
size() != 0

Definition at line 3540 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::size_type slip::GrayscaleImage< T >::max_size ( ) const
inline

Returns the maximal size (number of elements) in the GrayscaleImage.

Definition at line 3440 of file GrayscaleImage.hpp.

template<typename T >
T & slip::GrayscaleImage< T >::min ( ) const
inline

Returns the min element of the GrayscaleImage according to the operator <.

Precondition
size() != 0

Definition at line 3533 of file GrayscaleImage.hpp.

template<typename T >
std::string slip::GrayscaleImage< T >::name ( ) const
inline

Returns the name of the class.

Definition at line 3395 of file GrayscaleImage.hpp.

template<typename T>
reference slip::GrayscaleImage< T >::operator() ( const size_type  i,
const size_type  j 
)

Subscript access to the data contained in the GrayscaleImage.

Parameters
iThe index of the row for which the data should be accessed.
jThe index of the columns for which the data should be accessed.
Returns
Read/write reference to data.
Precondition
i < rows()
j < columns()

This operator allows for easy, 2d array-style, data access. Note that data access with this operator is unchecked and out_of_range lookups are not defined.

template<typename T>
const_reference slip::GrayscaleImage< T >::operator() ( const size_type  i,
const size_type  j 
) const

Subscript access to the data contained in the GrayscaleImage.

Parameters
iThe index of the row for which the data should be accessed.
jThe index of the columns for which the data should be accessed.
Returns
Read_only (constant) reference to data.
Precondition
i < rows()
j < columns()

This operator allows for easy, 2d array-style, data access. Note that data access with this operator is unchecked and out_of_range lookups are not defined.

template<typename T>
reference slip::GrayscaleImage< T >::operator() ( const Point2d< size_type > &  point2d)

Subscript access to the data contained in the GrayscaleImage.

Parameters
point2dA Point2d which indicate the subscripts of the data to access.
Returns
Read/write reference to data.
Precondition
point2d must be defined in the range of the GrayscaleImage.

This operator allows for easy, 2d array-style, data access. Note that data access with this operator is unchecked and out_of_range lookups are not defined.

template<typename T>
const_reference slip::GrayscaleImage< T >::operator() ( const Point2d< size_type > &  point2d) const

Subscript access to the data contained in the GrayscaleImage.

Parameters
point2dA Point2d which indicate the subscripts of the data to access.
Returns
Read_only (constant) reference to data.
Precondition
point2d must be defined in the range of the GrayscaleImage.

This operator allows for easy, 2d array-style, data access. Note that data access with this operator is unchecked and out_of_range lookups are not defined.

template<typename T >
GrayscaleImage< T > slip::GrayscaleImage< T >::operator() ( const Range< int > &  row_range,
const Range< int > &  col_range 
)
inline

Subscript access to the data contained in the GrayscaleImage.

Parameters
row_rangeThe range of the rows.
col_rangeThe range of the columns.
Returns
a copy of the range.
Precondition
row_range and col_range must be valid.
The ranges indices must be inside the ranges of the GrayscaleImage ones.

This operator allows for easy, 2d array-style, data access. Note that data access with this operator is unchecked and out_of_range lookups are not defined.

Definition at line 3375 of file GrayscaleImage.hpp.

template<typename T>
GrayscaleImage< T > & slip::GrayscaleImage< T >::operator*= ( const T &  val)
inline

Definition at line 3476 of file GrayscaleImage.hpp.

template<typename T>
GrayscaleImage< T > & slip::GrayscaleImage< T >::operator*= ( const self rhs)
inline

Definition at line 3516 of file GrayscaleImage.hpp.

template<typename T>
GrayscaleImage< T > & slip::GrayscaleImage< T >::operator+= ( const T &  val)
inline

Add val to each element of the GrayscaleImage.

Parameters
valvalue
Returns
reference to the resulting GrayscaleImage

Definition at line 3459 of file GrayscaleImage.hpp.

template<typename T>
GrayscaleImage< T > & slip::GrayscaleImage< T >::operator+= ( const self rhs)
inline

Definition at line 3500 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T > slip::GrayscaleImage< T >::operator- ( ) const
inline

Definition at line 3492 of file GrayscaleImage.hpp.

template<typename T>
GrayscaleImage< T > & slip::GrayscaleImage< T >::operator-= ( const T &  val)
inline

Definition at line 3467 of file GrayscaleImage.hpp.

template<typename T>
GrayscaleImage< T > & slip::GrayscaleImage< T >::operator-= ( const self rhs)
inline

Definition at line 3508 of file GrayscaleImage.hpp.

template<typename T>
GrayscaleImage< T > & slip::GrayscaleImage< T >::operator/= ( const T &  val)
inline

Definition at line 3484 of file GrayscaleImage.hpp.

template<typename T>
GrayscaleImage< T > & slip::GrayscaleImage< T >::operator/= ( const self rhs)
inline

Definition at line 3524 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T > & slip::GrayscaleImage< T >::operator= ( const self rhs)
inline

Assign a GrayscaleImage.

Assign elements of GrayscaleImage in rhs

Parameters
rhsGrayscaleImage to get the values from.
Returns

Definition at line 2548 of file GrayscaleImage.hpp.

template<typename T>
GrayscaleImage< T > & slip::GrayscaleImage< T >::operator= ( const T &  val)
inline

Affects all the element of the GrayscaleImage by val.

Parameters
valaffectation value
Returns
reference to corresponding GrayscaleImage

Definition at line 2559 of file GrayscaleImage.hpp.

template<typename T>
pointer slip::GrayscaleImage< T >::operator[] ( const size_type  i)

Subscript access to the row datas contained in the GrayscaleImage.

Parameters
iThe index of the row for which data should be accessed.
Returns
Read/write pointer to the row data.
Precondition
i < rows()

This operator allows for easy, 2d array-style, data access. Note that data access with this operator is unchecked and out_of_range lookups are not defined.

template<typename T>
const_pointer slip::GrayscaleImage< T >::operator[] ( const size_type  i) const

Subscript access to the row datas contained in the GrayscaleImage.

Parameters
iThe index of the row for which data should be accessed.
Returns
Read-only (constant) pointer to the row data.
Precondition
i < rows()

This operator allows for easy, 2d array-style, data access. Note that data access with this operator is unchecked and out_of_range lookups are not defined.

template<typename T >
GrayscaleImage< T >::reverse_iterator slip::GrayscaleImage< T >::rbegin ( )
inline

Returns a read/write reverse iterator that points to the last element in the GrayscaleImage. Iteration is done in reverse element order.

Returns
reverse begin iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
//copy the sum of the elements of A1 and A2
//in S (iterated in the reverse order element)
std::transform(A1.begin(),A1.end(),
A2.begin(),S.rbegin(),
std::plus<double>());

Definition at line 2608 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::const_reverse_iterator slip::GrayscaleImage< T >::rbegin ( ) const
inline

Returns a read-only (constant) reverse iterator that points to the last element in the GrayscaleImage. Iteration is done in reverse element order.

Returns
const reverse begin iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
//copy the sum of the elements of A1 (iterated in the reverse order element)
//and A2 in S
std::transform(A1.rbegin(),A1.rend(),
A2.begin(),S.begin(),
std::plus<double>());

Definition at line 2623 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::reverse_iterator2d slip::GrayscaleImage< T >::rbottom_right ( )
inline

Returns a read/write reverse iterator2d. It points to past the upper left element of the GrayscaleImage. Iteration is done in the reverse order.

Returns
reverse iterator2d value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.

Definition at line 3068 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::const_reverse_iterator2d slip::GrayscaleImage< T >::rbottom_right ( ) const
inline

Returns a read only reverse iterator2d. It points to past the upper left element of the GrayscaleImage. Iteration is done in the reverse order.

Returns
const reverse iterator2d value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.

Definition at line 3076 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::reverse_iterator2d slip::GrayscaleImage< T >::rbottom_right ( const Box2d< int > &  box)
inline

Returns a read/write reverse iterator2d. It points to one before the upper left element of the Box2d box associated to the GrayscaleImage.

Parameters
boxA Box2d defining the range of indices to iterate within the GrayscaleImage.
Precondition
The box indices must be inside the range of the GrayscaleImage ones.
Returns
reverse iterator2d value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.

Definition at line 3102 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::const_reverse_iterator2d slip::GrayscaleImage< T >::rbottom_right ( const Box2d< int > &  box) const
inline

Returns a read-only reverse iterator2d. It points to one before the element of the bottom right element of the Box2d box associated to the GrayscaleImage.

Parameters
boxA Box2d defining the range of indices to iterate within the GrayscaleImage.
Precondition
The box indices must be inside the range of the GrayscaleImage ones.
Returns
const reverse iterator2d value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.

Definition at line 3110 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::reverse_iterator2d_range slip::GrayscaleImage< T >::rbottom_right ( const Range< int > &  row_range,
const Range< int > &  col_range 
)
inline

Returns a read/write reverse_iterator2d_range that points to one before the upper left element of the ranges row_range and col_range associated to the GrayscaleImage. Iteration is done in the reverse order.

Parameters
row_rangeThe range of the rows.
col_rangeThe range of the columns.
Precondition
row_range and col_range must be valid.
The ranges indices must be inside the ranges of the GrayscaleImage ones.
Returns
reverse_iterator2d_range value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.

Definition at line 3155 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::const_reverse_iterator2d_range slip::GrayscaleImage< T >::rbottom_right ( const Range< int > &  row_range,
const Range< int > &  col_range 
) const
inline

Returns a read-only reverse_iterator2d_range that points to one before the upper left element of the ranges row_range and col_range associated to the GrayscaleImage.Iteration is done in the reverse order.

Parameters
row_rangeThe range of the rows.
col_rangeThe range of the columns.
Precondition
row_range and col_range must be valid.
The ranges indices must be inside the ranges of the GrayscaleImage ones.
Returns
const_reverse_iterator2d_range value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.

Definition at line 3164 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::reverse_iterator2d_range slip::GrayscaleImage< T >::rbottom_right ( const Range< int > &  range)
inline

Returns a read/write reverse_iterator2d_range that points to one before the upper left element of the Range range associated to the GrayscaleImage. The same range is applied for rows and cols. Iteration is done in the reverse order.

Parameters
rangeThe range of the rows and the cols.
Precondition
range must be valid.
The range indices must be inside the ranges of the GrayscaleImage ones.
Returns
reverse_iterator2d_range value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.

Definition at line 3190 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::const_reverse_iterator2d_range slip::GrayscaleImage< T >::rbottom_right ( const Range< int > &  range) const
inline

Returns a read_only reverse_iterator2d_range that points to one before the upper left element of the Range range associated to the GrayscaleImage. The same range is applied for rows and cols. Iteration is done in the reverse order.

Parameters
rangeThe range of the rows and the cols.
Precondition
range must be valid.
The range indices must be inside the ranges of the GrayscaleImage ones.
Returns
const_reverse_iterator2d_range value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.

Definition at line 3198 of file GrayscaleImage.hpp.

template<typename T>
void slip::GrayscaleImage< T >::read_ascii ( const std::string &  file_path_name)
inline

Read the GrayscaleImage from an ASCII file.

Parameters
file_path_name

Definition at line 1922 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::reverse_iterator slip::GrayscaleImage< T >::rend ( )
inline

Returns a read/write reverse iterator that points to one before the first element in the GrayscaleImage. Iteration is done in reverse element order.

Returns
reverse end iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
//copy the sum of the elements of A1 and A2
//in S (iterated in the reverse order element)
std::transform(A1.begin(),A1.end(),
A2.begin(),S.rbegin(),
std::plus<double>());

Definition at line 2615 of file GrayscaleImage.hpp.

template<typename T >
std::reverse_iterator< const T * > slip::GrayscaleImage< T >::rend ( ) const
inline

Returns a read-only (constant) reverse iterator that points to one before the first element in the GrayscaleImage. Iteration is done in reverse element order.

Returns
const reverse end iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Example:
//copy the sum of the elements of A1 (iterated in the reverse order element)
//and A2 in S
std::transform(A1.rbegin(),A1.rend(),
A2.begin(),S.begin(),
std::plus<double>());

Definition at line 2631 of file GrayscaleImage.hpp.

template<typename T>
void slip::GrayscaleImage< T >::resize ( const size_type  height,
const size_type  width,
const T &  val = T() 
)
inline

Resizes a GrayscaleImage.

Parameters
heightnew first dimension
widthnew second dimension
valnew value for all the elements

Definition at line 2567 of file GrayscaleImage.hpp.

template<typename T>
row_iterator slip::GrayscaleImage< T >::row_begin ( const size_type  row)

Returns a read/write iterator that points to the first element of the row row in the GrayscaleImage. Iteration is done in ordinary element order.

Parameters
rowThe index of the row to iterate.
Returns
begin row_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
row must be compatible with the range of the GrayscaleImage.
Example:
//copy the elements of the row 0 of A1 in the row 1 of A2
std::copy(A1.row_begin(0),A1.row_end(0),A2.row_begin(1));
template<typename T>
const_row_iterator slip::GrayscaleImage< T >::row_begin ( const size_type  row) const

Returns a read-only iterator that points to the first element of the row row in the GrayscaleImage. Iteration is done in ordinary element order.

Parameters
rowThe index of the row to iterate.
Returns
begin const_row_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
row must be compatible with the range of the GrayscaleImage.
Example:
//copy the elements of the row 0 of A1 in the row 1 of A2
std::copy(A1.row_begin(0),A1.row_end(0),A2.row_begin(1));
template<typename T>
row_range_iterator slip::GrayscaleImage< T >::row_begin ( const size_type  row,
const slip::Range< int > &  range 
)

Returns a read/write iterator that points to the first element of the Range range of the row row in the GrayscaleImage. Iteration is done in ordinary element order according to the Range.

Parameters
rowThe index of the row to iterate.
rangeRange of the row to iterate.
Returns
begin row_range_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
row must be compatible with the range of the GrayscaleImage.
The range must be inside the whole range of the GrayscaleImage.
Example:
slip::Range<int> range(0,A1.dim2()-1,2);
//copy the elements of the row 0 of A1 iterated according to the
//range in the row 1 of A2
std::copy(A1.row_begin(0,range),A1.row_end(0,range),A2.row_begin(1));
template<typename T>
const_row_range_iterator slip::GrayscaleImage< T >::row_begin ( const size_type  row,
const slip::Range< int > &  range 
) const

Returns a read-only iterator that points to the first element of the Range range of the row row in the GrayscaleImage. Iteration is done in ordinary element order according to the Range.

Parameters
rowThe index of the row to iterate.
rangeRange of the row to iterate.
Returns
begin const_row_range_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
row must be compatible with the range of the GrayscaleImage.
The range must be inside the whole range of the GrayscaleImage.
Example:
slip::Range<int> range(0,A1.dim2()-1,2);
//copy the elements of the row 0 of A1 iterated according to the
//range in the row 1 of A2
std::copy(A1.row_begin(0,range),A1.row_end(0,range),A2.row_begin(1));
template<typename T>
row_iterator slip::GrayscaleImage< T >::row_end ( const size_type  row)

Returns a read/write iterator that points one past the end element of the row row in the GrayscaleImage. Iteration is done in ordinary element order.

Parameters
rowThe index of the row to iterate.
Returns
begin row_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
row must be compatible with the range of the GrayscaleImage.
Example:
//copy the elements of the row 0 of A1 in the row 1 of A2
std::copy(A1.row_begin(0),A1.row_end(0),A2.row_begin(1));
template<typename T>
const_row_iterator slip::GrayscaleImage< T >::row_end ( const size_type  row) const

Returns a read-only iterator that points one past the end element of the row row in the GrayscaleImage. Iteration is done in ordinary element order.

Parameters
rowThe index of the row to iterate.
Returns
begin const_row_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
row must be compatible with the range of the GrayscaleImage.
Example:
//copy the elements of the row 0 of A1 in the row 1 of A2
std::copy(A1.row_begin(0),A1.row_end(0),A2.row_begin(1));
template<typename T>
row_range_iterator slip::GrayscaleImage< T >::row_end ( const size_type  row,
const slip::Range< int > &  range 
)

Returns a read/write iterator that points one past the end element of the Range range of the row row in the GrayscaleImage. Iteration is done in ordinary element order according to the Range.

Parameters
rowThe index of the row to iterate.
rangeRange of the row to iterate.
Returns
end row_range_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
row must be compatible with the range of the GrayscaleImage.
The range must be inside the whole range of the GrayscaleImage.
Example:
slip::Range<int> range(0,A1.dim2()-1,2);
//copy the elements of the row 0 of A1 iterated according to the
//range in the row 1 of A2
std::copy(A1.row_begin(0,range),A1.row_end(0,range),A2.row_begin(1));
template<typename T>
const_row_range_iterator slip::GrayscaleImage< T >::row_end ( const size_type  row,
const slip::Range< int > &  range 
) const

Returns a read_only iterator that points one past the last element of the Range range of the row row in the GrayscaleImage. Iteration is done in ordinary element order according to the Range.

Parameters
rowRow to iterate.
rangeRange of the row to iterate
Returns
begin const_row_range_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
row must be compatible with the range of the GrayscaleImage.
The range must be inside the whole range of the GrayscaleImage.
Example:
slip::Range<int> range(0,A1.dim2()-1,2);
//copy the elements of the row 0 of A1 iterated according to the
//range in the row 1 of A2
std::copy(A1.row_begin(0,range),A1.row_end(0,range),A2.row_begin(1));
template<typename T>
reverse_row_iterator slip::GrayscaleImage< T >::row_rbegin ( const size_type  row)

Returns a read/write reverse iterator that points to the last element of the row row in the GrayscaleImage. Iteration is done in the reverse element order.

Parameters
rowThe index of the row to iterate.
Returns
begin reverse_row_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
row must be compatible with the range of the GrayscaleImage.
template<typename T>
const_reverse_row_iterator slip::GrayscaleImage< T >::row_rbegin ( const size_type  row) const

Returns a read-only reverse iterator that points to the last element of the row row in the GrayscaleImage. Iteration is done in the reverse element order.

Parameters
rowThe index of the row to iterate.
Returns
begin const_reverse_row_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
row must be compatible with the range of the GrayscaleImage.
template<typename T>
reverse_row_range_iterator slip::GrayscaleImage< T >::row_rbegin ( const size_type  row,
const slip::Range< int > &  range 
)

Returns a read-write iterator that points to the last element of the Range range of the row row in the GrayscaleImage. Iteration is done in the reverse element order according to the Range.

Parameters
rowThe index of the row to iterate.
rangeRange of the row to iterate.
Returns
reverse_row_range_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
row must be compatible with the range of the GrayscaleImage.
The range must be inside the whole range of the GrayscaleImage.
template<typename T>
const_reverse_row_range_iterator slip::GrayscaleImage< T >::row_rbegin ( const size_type  row,
const slip::Range< int > &  range 
) const

Returns a read-only iterator that points to the last element of the Range range of the row row in the GrayscaleImage. Iteration is done in the reverse element order according to the Range.

Parameters
rowThe index of the row to iterate.
rangeRange of the row to iterate
Returns
begin const_reverse_row_range_iterator value
Precondition
row must be compatible with the range of the GrayscaleImage.
The range must be inside the whole range of the GrayscaleImage.
template<typename T>
reverse_row_iterator slip::GrayscaleImage< T >::row_rend ( const size_type  row)

Returns a read/write reverse iterator that points one past the first element of the row row in the GrayscaleImage. Iteration is done in the reverse element order.

Parameters
rowThe index of the row to iterate.
Returns
end reverse_row_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
row must be compatible with the range of the GrayscaleImage.
template<typename T>
const_reverse_row_iterator slip::GrayscaleImage< T >::row_rend ( const size_type  row) const

Returns a read-only reverse iterator that points one past the first element of the row row in the GrayscaleImage. Iteration is done in the reverse element order.

Parameters
rowThe index of the row to iterate.
Returns
end const_reverse_row_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
row must be compatible with the range of the GrayscaleImage.
template<typename T>
reverse_row_range_iterator slip::GrayscaleImage< T >::row_rend ( const size_type  row,
const slip::Range< int > &  range 
)

Returns a read-write iterator that points one before the first element of the Range range of the row row in the GrayscaleImage. Iteration is done in the reverse element order according to the Range.

Parameters
rowThe index of the row to iterate.
rangeRange of the row to iterate.
Returns
reverse_row_range_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
row must be compatible with the range of the GrayscaleImage.
The range must be inside the whole range of the GrayscaleImage.
template<typename T>
const_reverse_row_range_iterator slip::GrayscaleImage< T >::row_rend ( const size_type  row,
const slip::Range< int > &  range 
) const

Returns a read-only iterator that points one before the first element of the Range range of the row row in the GrayscaleImage. Iteration is done in the reverse element order according to the Range.

Parameters
rowThe index of the row to iterate.
rangeRange of the row to iterate
Returns
const_reverse_row_range_iterator value
Remarks
This iterator is compatible with RandomAccessIterator algorithms.
Precondition
row must be compatible with the range of the GrayscaleImage.
The range must be inside the whole range of the GrayscaleImage.
template<typename T >
GrayscaleImage< T >::size_type slip::GrayscaleImage< T >::rows ( ) const
inline

Returns the number of rows (first dimension size) in the GrayscaleImage.

Definition at line 3410 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::reverse_iterator2d slip::GrayscaleImage< T >::rupper_left ( )
inline

Returns a read/write reverse iterator2d. It points to the bottom right element of the GrayscaleImage. Iteration is done within the GrayscaleImage in the reverse order.

Returns
reverse_iterator2d value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.

Definition at line 3085 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::const_reverse_iterator2d slip::GrayscaleImage< T >::rupper_left ( ) const
inline

Returns a read only reverse iterator2d that points. It points to the bottom right element of the GrayscaleImage. Iteration is done within the GrayscaleImage in the reverse order.

Returns
const_reverse_iterator2d value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.

Definition at line 3093 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::reverse_iterator2d slip::GrayscaleImage< T >::rupper_left ( const Box2d< int > &  box)
inline

Returns a read/write reverse iterator2d. It points to the bottom right element of the Box2d associated to the GrayscaleImage. Iteration is done in the reverse order.

Parameters
boxa Box2d defining the range of indices to iterate within the GrayscaleImage.
Precondition
The box indices must be inside the range of the GrayscaleImage ones.
Returns
reverse iterator2d value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.

Definition at line 3119 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::const_reverse_iterator2d slip::GrayscaleImage< T >::rupper_left ( const Box2d< int > &  box) const
inline

Returns a read only reverse iterator2d. It points to the bottom right element of the Box2d box associated to the GrayscaleImage. Iteration is done in the reverse order.

Parameters
boxA Box2d defining the range of indices to iterate within the GrayscaleImage.
Precondition
The box indices must be inside the range of the GrayscaleImage ones.
Returns
const reverse iterator2d value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.

Definition at line 3127 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::reverse_iterator2d_range slip::GrayscaleImage< T >::rupper_left ( const Range< int > &  row_range,
const Range< int > &  col_range 
)
inline

Returns a read/write reverse_iterator2d_range that points to the past the bottom right element of the ranges row_range and col_range associated to the GrayscaleImage. Iteration is done in the reverse order.

Parameters
row_rangeThe range of the rows.
col_rangeThe range of the columns.
Precondition
row_range and col_range must be valid.
The ranges indices must be inside the ranges of the GrayscaleImage ones.
Returns
reverse_iterator2d_range value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.

Definition at line 3136 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::const_reverse_iterator2d_range slip::GrayscaleImage< T >::rupper_left ( const Range< int > &  row_range,
const Range< int > &  col_range 
) const
inline

Returns a read-only reverse_iterator2d_range that points to the past the bottom right element of the ranges row_range and col_range associated to the GrayscaleImage. Iteration is done in the reverse order.

Parameters
row_rangeThe range of the rows.
col_rangeThe range of the columns.
Precondition
row_range and col_range must be valid.
The ranges indices must be inside the ranges of the GrayscaleImage ones.
Returns
const_reverse_iterator2d_range value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.

Definition at line 3145 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::reverse_iterator2d_range slip::GrayscaleImage< T >::rupper_left ( const Range< int > &  range)
inline

Returns a read/write reverse_iterator2d_range that points to the bottom right element of the Range range associated to the GrayscaleImage. The same range is applied for rows and cols. Iteration is done in the reverse order.

Parameters
rangeThe range of the rows and the cols.
Precondition
range and must be valid.
The range indices must be inside the ranges of the GrayscaleImage ones.
Returns
reverse_iterator2d_range value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.

Definition at line 3174 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::const_reverse_iterator2d_range slip::GrayscaleImage< T >::rupper_left ( const Range< int > &  range) const
inline

Returns a read-only reverse_iterator2d_range that points to the to the bottom right element of the Range range associated to the GrayscaleImage. The same range is applied for rows and cols. Iteration is done in the reverse order.

Parameters
rangeThe range of the rows and the cols.
Precondition
range must be valid.
The range indices must be inside the ranges of the GrayscaleImage ones.
Returns
const_reverse_iterator2d_range value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.

Definition at line 3182 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::size_type slip::GrayscaleImage< T >::size ( ) const
inline

Returns the number of elements in the GrayscaleImage.

Definition at line 3435 of file GrayscaleImage.hpp.

template<typename T >
T slip::GrayscaleImage< T >::sum ( ) const
inline

Returns the sum of the elements of the GrayscaleImage.

Precondition
size() != 0

Definition at line 3547 of file GrayscaleImage.hpp.

template<typename T >
void slip::GrayscaleImage< T >::swap ( self M)
inline

Swaps data with another GrayscaleImage.

Parameters
MA GrayscaleImage of the same element type

Definition at line 3452 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::iterator2d slip::GrayscaleImage< T >::upper_left ( )
inline

Returns a read/write iterator2d that points to the first element of the GrayscaleImage. It points to the upper left element of the GrayscaleImage.

Returns
begin iterator2d value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.
Example:
//copy the elements of A1 in A2

Definition at line 2931 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::const_iterator2d slip::GrayscaleImage< T >::upper_left ( ) const
inline

Returns a read-only iterator2d that points to the first element of the GrayscaleImage. It points to the upper left element of the GrayscaleImage.

Returns
begin const iterator2d value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.
Example:
//copy the elements of A1 in A2

Definition at line 2938 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::iterator2d slip::GrayscaleImage< T >::upper_left ( const Box2d< int > &  box)
inline

Returns a read/write iterator2d that points to the first element of the GrayscaleImage. It points to the upper left element of the Box2d associated to the GrayscaleImage.

Parameters
boxA Box2d defining the range of indices to iterate within the GrayscaleImage.
Remarks
This iterator is compatible with BidirectionalIterator algorithms.
Returns
end iterator2d value
Precondition
The box indices must be inside the range of the GrayscaleImage ones.
Example:
slip::Box2d<int> box(1,1,3,2);
//copy the elements of A1 inside the box which upper_left element
//is located in (1,1) and the bottom right element is in (3,2)

Definition at line 2962 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::const_iterator2d slip::GrayscaleImage< T >::upper_left ( const Box2d< int > &  box) const
inline

Returns a read only iterator2d that points to the first element of the GrayscaleImage. It points to the upper left element of the Box2d associated to the GrayscaleImage.

Parameters
boxa Box2d defining the range of indices to iterate within the GrayscaleImage.
Returns
end const iterator2d value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.
Precondition
The box indices must be inside the range of the GrayscaleImage ones.
Example:
slip::Box2d<int> box(1,1,3,2);
//copy the elements of A1 inside the box which upper_left element
//is located in (1,1) and the bottom right element is in (3,2)

Definition at line 2970 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::iterator2d_range slip::GrayscaleImage< T >::upper_left ( const Range< int > &  row_range,
const Range< int > &  col_range 
)
inline

Returns a read/write iterator2d_range that points to the upper left element of the ranges row_range and col_range associated to the GrayscaleImage.

Parameters
row_rangeThe range of the rows.
col_rangeThe range of the columns.
Precondition
row_range and col_range must be valid.
The ranges indices must be inside the ranges of the GrayscaleImage ones.
Returns
iterator2d_range value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.
Example:
slip::Range<int> row_range(0,A1.dim2()-1,2);
slip::Range<int> col_range(0,A1.dim1()-1,2);
//copy the elements of A1 within the ranges row_range and col_range
//in A2
std::copy(A1.upper_left(row_range,col_range),
A1.bottom_right(row_range,col_range),A2.upper_left());

Definition at line 2995 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::const_iterator2d_range slip::GrayscaleImage< T >::upper_left ( const Range< int > &  row_range,
const Range< int > &  col_range 
) const
inline

Returns a read-only iterator2d_range that points to the to the upper left element of the ranges row_range and col_range associated to the GrayscaleImage.

Parameters
row_rangeThe range of the rows.
col_rangeThe range of the columns.
Precondition
row_range and col_range must be valid.
The ranges indices must be inside the ranges of the GrayscaleImage ones.
Returns
const_iterator2d_range value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.
Example:
slip::Range<int> row_range(0,A1.dim2()-1,2);
slip::Range<int> col_range(0,A1.dim1()-1,2);
//copy the elements of A1 within the ranges row_range and col_range
//in A2
std::copy(A1.upper_left(row_range,col_range),
A1.bottom_right(row_range,col_range),A2.upper_left());

Definition at line 3004 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::iterator2d_range slip::GrayscaleImage< T >::upper_left ( const Range< int > &  range)
inline

Returns a read/write iterator2d_range that points to the upper left element of the Range range associated to the GrayscaleImage. The same range is applied for rows and cols.

Parameters
rangeThe range of the rows and the cols.
Precondition
range and must be valid.
The range indices must be inside the ranges of the GrayscaleImage ones.
Returns
iterator2d_range value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.
Example:
slip::Range<int> range(0,A1.dim2()-1,2);
//copy the elements of A1 within the range range
//in A2
std::copy(A1.upper_left(range),A1.bottom_right(range),A2.upper_left());

Definition at line 3033 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::const_iterator2d_range slip::GrayscaleImage< T >::upper_left ( const Range< int > &  range) const
inline

Returns a read-only iterator2d_range that points to the to the upper left element of the Range range associated to the GrayscaleImage.

Parameters
rangeThe range of the rows and the cols.
Precondition
range must be valid.
The range indices must be inside the ranges of the GrayscaleImage ones.
Returns
const_iterator2d_range value
Remarks
This iterator is compatible with BidirectionalIterator algorithms.
Example:
slip::Range<int> range(0,A1.dim2()-1,2);
//copy the elements of A1 within the range range
//in A2
std::copy(A1.upper_left(range),A1.bottom_right(range),A2.upper_left());

Definition at line 3041 of file GrayscaleImage.hpp.

template<typename T >
GrayscaleImage< T >::size_type slip::GrayscaleImage< T >::width ( ) const
inline

Returns the number of columns (second dimension size) in the GrayscaleImage.

Definition at line 3420 of file GrayscaleImage.hpp.

template<typename T>
void slip::GrayscaleImage< T >::write_ascii ( const std::string &  file_path_name) const
inline

Write the GrayscaleImage to an ASCII file.

Parameters
file_path_name

Definition at line 1912 of file GrayscaleImage.hpp.

template<>
void slip::GrayscaleImage< unsigned char >::write_ascii ( const std::string &  file_path_name) const
inline

Definition at line 3260 of file GrayscaleImage.hpp.

Friends And Related Function Documentation

template<typename T>
friend class boost::serialization::access
friend

Definition at line 2323 of file GrayscaleImage.hpp.

template<typename T >
T & max ( const GrayscaleImage< T > &  M1)
related

Returns the max element of a GrayscaleImage.

Parameters
M1the GrayscaleImage
Returns
the min element
Examples:
matrix_math_op.cpp.

Definition at line 3704 of file GrayscaleImage.hpp.

template<typename T >
T & min ( const GrayscaleImage< T > &  M1)
related

Returns the min element of a GrayscaleImage.

Parameters
M1the GrayscaleImage
Returns
the min element
Examples:
matrix_math_op.cpp.

Definition at line 3693 of file GrayscaleImage.hpp.

template<typename T>
bool operator!= ( const GrayscaleImage< T > &  x,
const GrayscaleImage< T > &  y 
)
friend

GrayscaleImage inequality comparison.

Parameters
xA GrayscaleImage
yA GrayscaleImage of the same type of x
Returns
true if !(x == y)
Precondition
x.size() == y.size()

Definition at line 3722 of file GrayscaleImage.hpp.

template<typename T>
bool operator< ( const GrayscaleImage< T > &  x,
const GrayscaleImage< T > &  y 
)
friend

Less than comparison operator (GrayscaleImage ordering relation)

Parameters
xA GrayscaleImage
yA GrayscaleImage of the same type of x
Returns
true iff x is lexicographically less than y
Precondition
x.size() == y.size()

Definition at line 3733 of file GrayscaleImage.hpp.

template<typename T>
std::ostream& operator<< ( std::ostream &  out,
const self a 
)
friend

Write the GrayscaleImage to the ouput stream.

Parameters
outoutput stream
aGrayscaleImage to write to the output stream

Definition at line 3205 of file GrayscaleImage.hpp.

template<typename T>
bool operator<= ( const GrayscaleImage< T > &  x,
const GrayscaleImage< T > &  y 
)
friend

Less than equal comparison operator.

Parameters
xA GrayscaleImage
yA GrayscaleImage of the same type of x
Returns
true iff !(y > x)
Precondition
x.size() == y.size()

Definition at line 3752 of file GrayscaleImage.hpp.

template<typename T>
bool operator== ( const GrayscaleImage< T > &  x,
const GrayscaleImage< T > &  y 
)
friend

GrayscaleImage equality comparison.

Parameters
xA GrayscaleImage
yA GrayscaleImage of the same type of x
Returns
true iff the size and the elements of the Arrays are equal
Precondition
x.size() == y.size()

Definition at line 3713 of file GrayscaleImage.hpp.

template<typename T>
bool operator> ( const GrayscaleImage< T > &  x,
const GrayscaleImage< T > &  y 
)
friend

More than comparison operator.

Parameters
xA GrayscaleImage
yA GrayscaleImage of the same type of x
Returns
true iff y > x
Precondition
x.size() == y.size()

Definition at line 3743 of file GrayscaleImage.hpp.

template<typename T>
bool operator>= ( const GrayscaleImage< T > &  x,
const GrayscaleImage< T > &  y 
)
friend

More than equal comparison operator.

Parameters
xA GrayscaleImage
yA GrayscaleImage of the same type of x
Returns
true iff !(x < y)
Precondition
x.size() == y.size()

Definition at line 3761 of file GrayscaleImage.hpp.

Member Data Documentation

template<typename T>
const std::size_t slip::GrayscaleImage< T >::DIM = 2
static

Definition at line 245 of file GrayscaleImage.hpp.


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