mln::image2d< T > Class Template Reference
[Basic types]

Basic 2D image class. More...

#include <image2d.hh>

Inherits mln::internal::image_primary< T, mln::box, mln::image2d< T > >.

List of all members.

Public Types

typedef T & lvalue
 Return type of read-write access.
typedef const T & rvalue
 Return type of read-only access.
typedef image2d< tag::value_< T > > skeleton
 Skeleton.
typedef T value
 Value associated type.

Public Member Functions

const box2dbbox () const
 Give the bounding box domain.
unsigned border () const
 Give the border thickness.
T * buffer ()
 Give a hook to the value buffer.
const T * buffer () const
 Give a hook to the value buffer.
int delta_index (const dpoint2d &dp) const
 Give the delta-index corresponding to the delta-point dp.
const box2ddomain () const
 Give the definition domain.
T & element (unsigned i)
 Read-write access to the image value located at index i.
const T & element (unsigned i) const
 Read-only access to the image value located at index i.
bool has (const point2d &p) const
 Test if p is valid.
 image2d (const box2d &b, unsigned bdr=border::thickness)
 Constructor with a box and the border thickness (default is 3).
 image2d (int nrows, int ncols, unsigned bdr=border::thickness)
 Constructor with the numbers of rows and columns and the border thickness.
 image2d ()
 Constructor without argument.
unsigned ncols () const
 Give the number of columns.
unsigned nelements () const
 Give the number of elements (points including border ones).
unsigned nrows () const
 Give the number of rows.
T & operator() (const point2d &p)
 Read-write access to the image value located at point p.
const T & operator() (const point2d &p) const
 Read-only access to the image value located at point p.
point2d point_at_index (unsigned i) const
 Give the point corresponding to the index i.


Detailed Description

template<typename T>
class mln::image2d< T >

Basic 2D image class.

The parameter T is the type of pixel values. This image class stores data in memory and has a virtual border with constant thickness around data.

Definition at line 135 of file core/image/image2d.hh.


Member Typedef Documentation

template<typename T>
typedef T& mln::image2d< T >::lvalue

Return type of read-write access.

Definition at line 147 of file core/image/image2d.hh.

template<typename T>
typedef const T& mln::image2d< T >::rvalue

Return type of read-only access.

Definition at line 144 of file core/image/image2d.hh.

template<typename T>
typedef image2d< tag::value_<T> > mln::image2d< T >::skeleton

Skeleton.

Definition at line 151 of file core/image/image2d.hh.

template<typename T>
typedef T mln::image2d< T >::value

Value associated type.

Definition at line 141 of file core/image/image2d.hh.


Constructor & Destructor Documentation

template<typename T>
mln::image2d< T >::image2d (  )  [inline]

Constructor without argument.

Definition at line 390 of file core/image/image2d.hh.

template<typename T>
mln::image2d< T >::image2d ( int  nrows,
int  ncols,
unsigned  bdr = border::thickness 
) [inline]

Constructor with the numbers of rows and columns and the border thickness.

Definition at line 396 of file core/image/image2d.hh.

References mln::make::box2d().

template<typename T>
mln::image2d< T >::image2d ( const box2d b,
unsigned  bdr = border::thickness 
) [inline]

Constructor with a box and the border thickness (default is 3).

Definition at line 403 of file core/image/image2d.hh.


Member Function Documentation

template<typename T>
const box2d & mln::image2d< T >::bbox (  )  const [inline]

Give the bounding box domain.

Definition at line 429 of file core/image/image2d.hh.

template<typename T>
unsigned mln::image2d< T >::border (  )  const [inline]

Give the border thickness.

Definition at line 507 of file core/image/image2d.hh.

template<typename T>
T * mln::image2d< T >::buffer (  )  [inline]

Give a hook to the value buffer.

Definition at line 552 of file core/image/image2d.hh.

template<typename T>
const T * mln::image2d< T >::buffer (  )  const [inline]

Give a hook to the value buffer.

Definition at line 543 of file core/image/image2d.hh.

template<typename T>
int mln::image2d< T >::delta_index ( const dpoint2d dp  )  const [inline]

Give the delta-index corresponding to the delta-point dp.

Definition at line 561 of file core/image/image2d.hh.

template<typename T>
const box2d & mln::image2d< T >::domain (  )  const [inline]

Give the definition domain.

Definition at line 420 of file core/image/image2d.hh.

Referenced by mln::morpho::line_gradient(), mln::make_debug_graph_image(), and mln::io::txt::save().

template<typename T>
T & mln::image2d< T >::element ( unsigned  i  )  [inline]

Read-write access to the image value located at index i.

Definition at line 534 of file core/image/image2d.hh.

References mln::image2d< T >::nelements().

template<typename T>
const T & mln::image2d< T >::element ( unsigned  i  )  const [inline]

Read-only access to the image value located at index i.

Definition at line 525 of file core/image/image2d.hh.

References mln::image2d< T >::nelements().

template<typename T>
bool mln::image2d< T >::has ( const point2d p  )  const [inline]

Test if p is valid.

Definition at line 438 of file core/image/image2d.hh.

Referenced by mln::image2d< T >::operator()(), and mln::debug::put_word().

template<typename T>
unsigned mln::image2d< T >::ncols (  )  const [inline]

Give the number of columns.

Definition at line 495 of file core/image/image2d.hh.

template<typename T>
unsigned mln::image2d< T >::nelements (  )  const [inline]

Give the number of elements (points including border ones).

Definition at line 516 of file core/image/image2d.hh.

Referenced by mln::image2d< T >::element(), and mln::image2d< T >::point_at_index().

template<typename T>
unsigned mln::image2d< T >::nrows (  )  const [inline]

Give the number of rows.

Definition at line 486 of file core/image/image2d.hh.

template<typename T>
T & mln::image2d< T >::operator() ( const point2d p  )  [inline]

Read-write access to the image value located at point p.

Definition at line 456 of file core/image/image2d.hh.

References mln::image2d< T >::has().

template<typename T>
const T & mln::image2d< T >::operator() ( const point2d p  )  const [inline]

Read-only access to the image value located at point p.

Definition at line 447 of file core/image/image2d.hh.

References mln::image2d< T >::has().

template<typename T>
point2d mln::image2d< T >::point_at_index ( unsigned  i  )  const [inline]

Give the point corresponding to the index i.

Definition at line 571 of file core/image/image2d.hh.

References mln::image2d< T >::nelements().


Generated on Sun May 16 01:35:46 2010 for Milena (Olena) by  doxygen 1.5.6