oln::abstract::image< Exact > Class Template Reference

#include <image.hh>

Inheritance diagram for oln::abstract::image< Exact >:

Inheritance graph
[legend]
Collaboration diagram for oln::abstract::image< Exact >:

Collaboration graph
[legend]
List of all members.

Public Types

enum  { dim = image_traits<Exact>::dim }
typedef image_traits< Exact
>::point_type 
point_type
typedef image_traits< Exact
>::dpoint_type 
dpoint_type
typedef image_traits< Exact
>::iter_type 
iter_type
typedef image_traits< Exact
>::fwd_iter_type 
fwd_iter_type
typedef image_traits< Exact
>::bkd_iter_type 
bkd_iter_type
typedef image_traits< Exact
>::value_type 
value_type
typedef image_traits< Exact
>::size_type 
size_type
typedef image_traits< Exact
>::impl_type 
impl_type
typedef image< Exact > self_type
typedef Exact exact_type

Public Member Functions

const value_type operator[] (const abstract::point< point_type > &p) const
 Return a reference to the value stored at p in the current image.
value_typeoperator[] (const abstract::point< point_type > &p)
 Return the value stored stored at p in the current image.
bool has_impl () const
 Indicate if the image can be processed.
exact_type clone () const
 Clone the image, all the points are duplicated.
bool hold (const abstract::point< point_type > &p) const
 Test if the point p belong to the image.
const size_type size () const
 Return a reference to the image size.
coord border () const
 Return the value of the border width.
size_t npoints () const
 Return the total number of points in the current image.
exact_typeoperator= (self_type rhs)
 Perform a shallow copy from rhs to the current image, the points are not duplicated but shared between the two images.
void border_set_width (coord new_border, bool copy_border=false) const
 Set the width of the border to perform operations on the image sides.
void border_adapt_width (coord min_border, bool copy_border=false) const
 Adapt the border if min_border is less or equal to the current border value.
void border_adapt_copy (coord min_border) const
 The border points will have the same value as the nearer real point of the image.
void border_adapt_mirror (coord min_border) const
 The border points value are set according to the value of the points on the image sides.
void border_adapt_assign (coord min_border, value_type val) const
 The border points value will be equal to the val parameters.

Static Public Member Functions

static std::string name ()

Protected Member Functions

 image ()
 image (self_type &rhs)

Detailed Description

template<class Exact>
class oln::abstract::image< Exact >

The image class whom derives all other image classes.

Definition at line 83 of file core/abstract/image.hh.


Member Typedef Documentation

template<class Exact>
typedef image_traits<Exact>::point_type oln::abstract::image< Exact >::point_type

Prefer the macro oln_point_type(I) to retrieve the point_type of an image.

See also:
point

Reimplemented in oln::abstract::image_with_dim< 1, Exact >, oln::abstract::image_with_dim< 2, Exact >, and oln::abstract::image_with_dim< 3, Exact >.

Definition at line 87 of file core/abstract/image.hh.

template<class Exact>
typedef image_traits<Exact>::dpoint_type oln::abstract::image< Exact >::dpoint_type

Prefer the macro oln_dpoint_type(I) to retrieve the dpoint_type of an image.

See also:
dpoint

Reimplemented in oln::abstract::image_with_dim< 1, Exact >, oln::abstract::image_with_dim< 2, Exact >, and oln::abstract::image_with_dim< 3, Exact >.

Definition at line 93 of file core/abstract/image.hh.

template<class Exact>
typedef image_traits<Exact>::iter_type oln::abstract::image< Exact >::iter_type

Prefer the macro oln_iter_type(I) to retrieve the iter_type of an image

See also:
iter

Reimplemented in oln::abstract::image_with_dim< 1, Exact >, oln::abstract::image_with_dim< 2, Exact >, and oln::abstract::image_with_dim< 3, Exact >.

Definition at line 99 of file core/abstract/image.hh.

template<class Exact>
typedef image_traits<Exact>::fwd_iter_type oln::abstract::image< Exact >::fwd_iter_type

Forward iterator type.

Reimplemented in oln::abstract::image_with_dim< 1, Exact >, oln::abstract::image_with_dim< 2, Exact >, and oln::abstract::image_with_dim< 3, Exact >.

Definition at line 105 of file core/abstract/image.hh.

template<class Exact>
typedef image_traits<Exact>::bkd_iter_type oln::abstract::image< Exact >::bkd_iter_type

Backward iterator type.

Reimplemented in oln::abstract::image_with_dim< 1, Exact >, oln::abstract::image_with_dim< 2, Exact >, and oln::abstract::image_with_dim< 3, Exact >.

Definition at line 107 of file core/abstract/image.hh.

template<class Exact>
typedef image_traits<Exact>::value_type oln::abstract::image< Exact >::value_type

Prefer the macro oln_value_type(I) to retrieve the value_type of an image.

Reimplemented in oln::abstract::image_with_dim< 1, Exact >, oln::abstract::image_with_dim< 2, Exact >, and oln::abstract::image_with_dim< 3, Exact >.

Definition at line 109 of file core/abstract/image.hh.

template<class Exact>
typedef image_traits<Exact>::size_type oln::abstract::image< Exact >::size_type

Indicate how the image size is handled.

See also:
image_size

Reimplemented in oln::abstract::image_with_dim< 1, Exact >, oln::abstract::image_with_dim< 2, Exact >, and oln::abstract::image_with_dim< 3, Exact >.

Definition at line 113 of file core/abstract/image.hh.

template<class Exact>
typedef image_traits<Exact>::impl_type oln::abstract::image< Exact >::impl_type

Underlying implementation.

Definition at line 118 of file core/abstract/image.hh.


Member Function Documentation

template<class Exact>
bool oln::abstract::image< Exact >::has_impl (  )  const [inline]

Indicate if the image can be processed.

Returns:
True if the image can be processed, false otherwise.

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

References mlc_hierarchy::any_with_diamond< Exact >::exact().

Referenced by oln::abstract::image< Exact >::border_set_width(), oln::abstract::image< Exact >::hold(), and oln::abstract::image< Exact >::size().

00152       {
00153         return this->exact().impl() != 0;
00154       }

template<class Exact>
exact_type oln::abstract::image< Exact >::clone (  )  const [inline]

Clone the image, all the points are duplicated.

Returns:
A real copy of the current image.

Definition at line 163 of file core/abstract/image.hh.

References mlc_hierarchy::any_with_diamond< Exact >::exact().

00164       {
00165         return this->exact().clone_();
00166       }

template<class Exact>
bool oln::abstract::image< Exact >::hold ( const abstract::point< point_type > &  p  )  const [inline]

Test if the point p belong to the image.

Returns:
True if p belong to the image, false otherwise.

Definition at line 174 of file core/abstract/image.hh.

References mlc_hierarchy::any< Exact >::exact(), mlc_hierarchy::any_with_diamond< Exact >::exact(), and oln::abstract::image< Exact >::has_impl().

Referenced by oln::level::connected_component(), oln::morpho::hybrid::internal::exist_init_dilation(), oln::morpho::hybrid::internal::exist_init_erosion(), oln::level::frontp_connected_component(), oln::morpho::is_a_strict_maximum(), oln::morpho::is_a_strict_minimum(), and oln::morpho::watershed_seg_or().

00175       {
00176         assertion(has_impl());
00177         return this->exact().impl()->hold(p.exact());
00178       }

template<class Exact>
exact_type& oln::abstract::image< Exact >::operator= ( self_type  rhs  )  [inline]

Perform a shallow copy from rhs to the current image, the points are not duplicated but shared between the two images.

See also:
image::clone()

Reimplemented in oln::abstract::image_with_dim< 1, Exact >, oln::abstract::image_with_dim< 2, Exact >, oln::abstract::image_with_dim< 3, Exact >, oln::abstract::image_with_type< T, Exact >, oln::abstract::data_type_image< Exact >, oln::abstract::data_type_image_with_dim< Dim, Exact >, oln::abstract::vectorial_image< Exact >, oln::abstract::vectorial_image_with_dim< Dim, Exact >, oln::abstract::non_vectorial_image< Exact >, oln::abstract::non_vectorial_image_with_dim< Dim, Exact >, oln::abstract::binary_image< Exact >, oln::abstract::binary_image_with_dim< Dim, Exact >, oln::abstract::integer_image< Exact >, oln::abstract::integer_image_with_dim< Dim, Exact >, oln::abstract::decimal_image< Exact >, oln::abstract::decimal_image_with_dim< Dim, Exact >, and oln::abstract::image_with_type< image_id< Exact >::value_type, Exact >.

Definition at line 216 of file core/abstract/image.hh.

References mlc_hierarchy::any_with_diamond< E >::exact(), and mlc_hierarchy::any_with_diamond< Exact >::exact().

00217       {
00218         return this->exact().assign(rhs.exact());
00219       }

template<class Exact>
void oln::abstract::image< Exact >::border_set_width ( coord  new_border,
bool  copy_border = false 
) const [inline]

Set the width of the border to perform operations on the image sides.

Precondition:
new_border >= 0

has_impl() == true

See also:
image_size::border_

Definition at line 247 of file core/abstract/image.hh.

References oln::abstract::image< Exact >::border(), mlc_hierarchy::any_with_diamond< Exact >::exact(), and oln::abstract::image< Exact >::has_impl().

00248       {
00249         precondition(new_border >= 0);
00250         precondition(has_impl());
00251         if (border() == new_border)
00252           return; // Nothing to do.
00253 
00254         const_cast<impl_type *>(this->exact().impl())->border_reallocate_and_copy(new_border, copy_border);
00255       }

template<class Exact>
void oln::abstract::image< Exact >::border_adapt_width ( coord  min_border,
bool  copy_border = false 
) const [inline]

Adapt the border if min_border is less or equal to the current border value.

Precondition:
min_border >= 0
See also:
image_size::border_

Definition at line 271 of file core/abstract/image.hh.

References oln::abstract::image< Exact >::border(), and mlc_hierarchy::any_with_diamond< Exact >::exact().

Referenced by oln::abstract::image< Exact >::border_adapt_assign(), oln::abstract::image< Exact >::border_adapt_copy(), and oln::abstract::image< Exact >::border_adapt_mirror().

00273       {
00274         precondition(min_border >= 0);
00275         if (border() >= min_border)
00276           return;                       // Don't shrink.
00277 
00278         this->exact().border_set_width(min_border, copy_border);
00279       }

template<class Exact>
void oln::abstract::image< Exact >::border_adapt_copy ( coord  min_border  )  const [inline]

The border points will have the same value as the nearer real point of the image.

See also:
image_size::border_

Definition at line 290 of file core/abstract/image.hh.

References oln::abstract::image< Exact >::border_adapt_width(), and mlc_hierarchy::any_with_diamond< Exact >::exact().

Referenced by oln::convol::slow::convolve().

00291       {
00292         border_adapt_width(min_border);
00293         const_cast<impl_type *>(this->exact().impl())->border_replicate();
00294       }

template<class Exact>
void oln::abstract::image< Exact >::border_adapt_mirror ( coord  min_border  )  const [inline]

The border points value are set according to the value of the points on the image sides.

See also:
image_size::border_

Definition at line 305 of file core/abstract/image.hh.

References oln::abstract::image< Exact >::border_adapt_width(), and mlc_hierarchy::any_with_diamond< Exact >::exact().

00306       {
00307         border_adapt_width(min_border);
00308         const_cast<impl_type *>(this->exact().impl())->border_mirror();
00309       }

template<class Exact>
void oln::abstract::image< Exact >::border_adapt_assign ( coord  min_border,
value_type  val 
) const [inline]

The border points value will be equal to the val parameters.

See also:
image_size::border_

Definition at line 322 of file core/abstract/image.hh.

References oln::abstract::image< Exact >::border_adapt_width(), and mlc_hierarchy::any_with_diamond< Exact >::exact().

Referenced by oln::value_behavior< T, Exact >::adapt_border_impl().

00323       {
00324         border_adapt_width(min_border);
00325         const_cast<impl_type *>(this->exact().impl())->border_assign(val);
00326       }


The documentation for this class was generated from the following file:
Generated on Tue Feb 20 20:24:55 2007 for Olena by  doxygen 1.5.1