Namespaces | Functions

mln::arith Namespace Reference

Namespace of arithmetic. More...

Namespaces

namespace  impl
 

Implementation namespace of arith namespace.


namespace  internal

Functions

template<typename I >
mln::trait::concrete< I >::ret diff_abs (const Image< I > &lhs, const Image< I > &rhs)
 Point-wise absolute difference of images lhs and rhs.
template<typename L , typename R , typename O >
void div (const Image< L > &lhs, const Image< R > &rhs, Image< O > &output)
 Point-wise division of images lhs and rhs.
template<typename I , typename V , typename O >
void div_cst (const Image< I > &input, const V &val, Image< O > &output)
 Point-wise division of the value val to image input.
template<typename I , typename V >
void div_cst_inplace (Image< I > &input, const V &val)
template<typename L , typename R >
void div_inplace (Image< L > &lhs, const Image< R > &rhs)
 Point-wise division of image rhs in image lhs.
template<typename L , typename R >
mln::trait::concrete< L >::ret min (const Image< L > &lhs, const Image< R > &rhs)
 Point-wise min of images lhs and rhs.
template<typename L , typename R >
void min_inplace (Image< L > &lhs, const Image< R > &rhs)
 Point-wise min of image lhs in image rhs.
template<typename L , typename R >
mln::trait::op::minus< L, R >::ret minus (const Image< L > &lhs, const Image< R > &rhs)
 Point-wise addition of images lhs and rhs.
template<typename L , typename R , typename F >
mln::trait::ch_value< L,
typename F::result >::ret 
minus (const Image< L > &lhs, const Image< R > &rhs, const Function_v2v< F > &f)
 Point-wise addition of images lhs and rhs.
template<typename V , typename L , typename R >
mln::trait::ch_value< L, V >::ret minus (const Image< L > &lhs, const Image< R > &rhs)
 Point-wise addition of images lhs and rhs.
template<typename I , typename V >
mln::trait::op::minus< I, V >::ret minus_cst (const Image< I > &input, const V &val)
 Point-wise addition of the value val to image input.
template<typename I , typename V , typename F >
mln::trait::ch_value< I,
typename F::result >::ret 
minus_cst (const Image< I > &input, const V &val, const Function_v2v< F > &f)
 Point-wise addition of the value val to image input.
template<typename I , typename V >
I & minus_cst_inplace (Image< I > &input, const V &val)
 Point-wise addition of the value val to image input.
template<typename L , typename R >
void minus_inplace (Image< L > &lhs, const Image< R > &rhs)
 Point-wise addition of image rhs in image lhs.
template<typename L , typename R , typename F >
mln::trait::ch_value< L,
typename F::result >::ret 
plus (const Image< L > &lhs, const Image< R > &rhs, const Function_v2v< F > &f)
 Point-wise addition of images lhs and rhs.
template<typename V , typename L , typename R >
mln::trait::ch_value< L, V >::ret plus (const Image< L > &lhs, const Image< R > &rhs)
 Point-wise addition of images lhs and rhs.
template<typename L , typename R >
mln::trait::op::plus< L, R >::ret plus (const Image< L > &lhs, const Image< R > &rhs)
 Point-wise addition of images lhs and rhs.
template<typename I , typename V >
mln::trait::op::plus< I, V >::ret plus_cst (const Image< I > &input, const V &val)
 Point-wise addition of the value val to image input.
template<typename I , typename V , typename F >
mln::trait::ch_value< I,
typename F::result >::ret 
plus_cst (const Image< I > &input, const V &val, const Function_v2v< F > &f)
 Point-wise addition of the value val to image input.
template<typename W , typename I , typename V >
mln::trait::ch_value< I, W >::ret plus_cst (const Image< I > &input, const V &val)
 Point-wise addition of the value val to image input.
template<typename I , typename V >
I & plus_cst_inplace (Image< I > &input, const V &val)
 Point-wise addition of the value val to image input.
template<typename L , typename R >
void plus_inplace (Image< L > &lhs, const Image< R > &rhs)
 Point-wise addition of image rhs in image lhs.
template<typename I >
mln::trait::concrete< I >::ret revert (const Image< I > &input)
 Point-wise reversion of image input.
template<typename I >
void revert_inplace (Image< I > &input)
 Point-wise in-place reversion of image input.
template<typename L , typename R , typename O >
void times (const Image< L > &lhs, const Image< R > &rhs, Image< O > &output)
 Point-wise addition of images lhs and rhs.
template<typename I , typename V , typename O >
void times_cst (const Image< I > &input, const V &val, Image< O > &output)
 Point-wise addition of the value val to image input.
template<typename I , typename V >
void times_cst_inplace (Image< I > &input, const V &val)
template<typename L , typename R >
void times_inplace (Image< L > &lhs, const Image< R > &rhs)
 Point-wise addition of image rhs in image lhs.

Detailed Description

Namespace of arithmetic.


Function Documentation

template<typename I >
mln::trait::concrete< I >::ret mln::arith::diff_abs ( const Image< I > &  lhs,
const Image< I > &  rhs 
) [inline]

Point-wise absolute difference of images lhs and rhs.

Parameters:
[in] lhs First operand image.
[in] rhs Second operand image.
Returns:
The result image.
Precondition:
lhs.domain == rhs.domain

Definition at line 63 of file arith/diff_abs.hh.

References mln::trace::entering(), mln::exact(), mln::trace::exiting(), and mln::data::transform().

template<typename L , typename R , typename O >
void mln::arith::div ( const Image< L > &  lhs,
const Image< R > &  rhs,
Image< O > &  output 
) [inline]

Point-wise division of images lhs and rhs.

Parameters:
[in] lhs First operand image.
[in] rhs Second operand image.
[out] output The result image.
Precondition:
output.domain == lhs.domain == rhs.domain

Definition at line 227 of file arith/div.hh.

References mln::trace::entering(), mln::exact(), and mln::trace::exiting().

Referenced by mln::operator/().

template<typename I , typename V , typename O >
void mln::arith::div_cst ( const Image< I > &  input,
const V &  val,
Image< O > &  output 
) [inline]

Point-wise division of the value val to image input.

Parameters:
[in] input The image.
[in] val The value.
[out] output The result image.
Precondition:
output.domain == input.domain

Definition at line 242 of file arith/div.hh.

References mln::pw::cst(), div_cst(), mln::trace::entering(), mln::exact(), and mln::trace::exiting().

Referenced by div_cst(), mln::operator/(), and mln::operator/=().

template<typename I , typename V >
void mln::arith::div_cst_inplace ( Image< I > &  input,
const V &  val 
) [inline]
template<typename L , typename R >
void mln::arith::div_inplace ( Image< L > &  lhs,
const Image< R > &  rhs 
) [inline]

Point-wise division of image rhs in image lhs.

Parameters:
[in] lhs First operand image (subject to division).
[in,out] rhs Second operand image (to div lhs).

This addition performs:
for all p of rhs.domain
lhs(p) /= rhs(p)

Precondition:
rhs.domain <= lhs.domain

Definition at line 255 of file arith/div.hh.

References div_inplace(), mln::trace::entering(), mln::exact(), and mln::trace::exiting().

Referenced by div_cst_inplace(), div_inplace(), and mln::operator/=().

template<typename L , typename R >
mln::trait::concrete< L >::ret mln::arith::min ( const Image< L > &  lhs,
const Image< R > &  rhs 
) [inline]

Point-wise min of images lhs and rhs.

Parameters:
[in] lhs First operand image.
[in] rhs Second operand image.
Returns:
The result image.
Precondition:
lhs.domain == rhs.domain

Definition at line 112 of file arith/min.hh.

References mln::trace::entering(), mln::exact(), mln::trace::exiting(), and mln::initialize().

template<typename L , typename R >
void mln::arith::min_inplace ( Image< L > &  lhs,
const Image< R > &  rhs 
) [inline]

Point-wise min of image lhs in image rhs.

Parameters:
[in,out] lhs First operand image.
[in] rhs Second operand image.
Precondition:
rhs.domain == lhs.domain

Definition at line 128 of file arith/min.hh.

References mln::trace::entering(), mln::exact(), and mln::trace::exiting().

template<typename L , typename R >
mln::trait::op::minus< L, R >::ret mln::arith::minus ( const Image< L > &  lhs,
const Image< R > &  rhs 
) [inline]

Point-wise addition of images lhs and rhs.

Parameters:
[in] lhs First operand image.
[in] rhs Second operand image.
Returns:
The result image.
Precondition:
lhs.domain == rhs.domain

Definition at line 331 of file arith/minus.hh.

References mln::trace::entering(), mln::exact(), mln::trace::exiting(), and mln::initialize().

Referenced by mln::operator-().

template<typename L , typename R , typename F >
mln::trait::ch_value< L, typename F::result >::ret mln::arith::minus ( const Image< L > &  lhs,
const Image< R > &  rhs,
const Function_v2v< F > &  f 
) [inline]

Point-wise addition of images lhs and rhs.

Parameters:
[in] lhs First operand image.
[in] rhs Second operand image.
[in] f Function.
Returns:
The result image.
Precondition:
lhs.domain == rhs.domain

Definition at line 350 of file arith/minus.hh.

References mln::trace::entering(), mln::exact(), mln::trace::exiting(), and mln::initialize().

template<typename V , typename L , typename R >
mln::trait::ch_value< L, V >::ret mln::arith::minus ( const Image< L > &  lhs,
const Image< R > &  rhs 
) [inline]

Point-wise addition of images lhs and rhs.

Parameters:
[in] lhs First operand image.
[in] rhs Second operand image.
Returns:
The result image.

The free parameter V sets the destination value type.

Precondition:
lhs.domain == rhs.domain

Definition at line 369 of file arith/minus.hh.

References mln::trace::entering(), mln::exact(), and mln::trace::exiting().

template<typename I , typename V >
mln::trait::op::minus< I, V >::ret mln::arith::minus_cst ( const Image< I > &  input,
const V &  val 
) [inline]

Point-wise addition of the value val to image input.

Parameters:
[in] input The image.
[in] val The value.
Returns:
The result image.
Precondition:
input.is_valid

Definition at line 387 of file arith/minus.hh.

References mln::pw::cst(), mln::trace::entering(), mln::exact(), and mln::trace::exiting().

Referenced by mln::operator-().

template<typename I , typename V , typename F >
mln::trait::ch_value< I, typename F::result >::ret mln::arith::minus_cst ( const Image< I > &  input,
const V &  val,
const Function_v2v< F > &  f 
) [inline]

Point-wise addition of the value val to image input.

Parameters:
[in] input The image.
[in] val The value.
[in] f Function.
Returns:
The result image.
Precondition:
input.is_valid

Definition at line 405 of file arith/minus.hh.

References mln::pw::cst(), mln::trace::entering(), mln::exact(), and mln::trace::exiting().

template<typename I , typename V >
I & mln::arith::minus_cst_inplace ( Image< I > &  input,
const V &  val 
) [inline]

Point-wise addition of the value val to image input.

Parameters:
[in,out] input The image.
[in] val The value.
Precondition:
input.is_valid

Definition at line 440 of file arith/minus.hh.

References mln::pw::cst(), mln::trace::entering(), mln::exact(), mln::trace::exiting(), minus_cst_inplace(), and minus_inplace().

Referenced by minus_cst_inplace(), and mln::operator-=().

template<typename L , typename R >
void mln::arith::minus_inplace ( Image< L > &  lhs,
const Image< R > &  rhs 
) [inline]

Point-wise addition of image rhs in image lhs.

Parameters:
[in,out] lhs First operand image (subject to addition).
[in] rhs Second operand image (to be added to lhs).

This addition performs:
for all p of rhs.domain
lhs(p) -= rhs(p)

Precondition:
rhs.domain == lhs.domain

Definition at line 424 of file arith/minus.hh.

References mln::trace::entering(), mln::exact(), mln::trace::exiting(), and minus_inplace().

Referenced by minus_cst_inplace(), minus_inplace(), and mln::operator-=().

template<typename L , typename R , typename F >
mln::trait::ch_value< L, typename F::result >::ret mln::arith::plus ( const Image< L > &  lhs,
const Image< R > &  rhs,
const Function_v2v< F > &  f 
) [inline]

Point-wise addition of images lhs and rhs.

Parameters:
[in] lhs First operand image.
[in] rhs Second operand image.
[in] f Function.
Returns:
The result image.
Precondition:
lhs.domain == rhs.domain

Definition at line 367 of file arith/plus.hh.

References mln::trace::entering(), mln::exact(), mln::trace::exiting(), and mln::initialize().

template<typename V , typename L , typename R >
mln::trait::ch_value< L, V >::ret mln::arith::plus ( const Image< L > &  lhs,
const Image< R > &  rhs 
) [inline]

Point-wise addition of images lhs and rhs.

Parameters:
[in] lhs First operand image.
[in] rhs Second operand image.
Returns:
The result image.

The free parameter V sets the destination value type.

Precondition:
lhs.domain == rhs.domain

Definition at line 386 of file arith/plus.hh.

References mln::trace::entering(), mln::exact(), and mln::trace::exiting().

template<typename L , typename R >
mln::trait::op::plus< L, R >::ret mln::arith::plus ( const Image< L > &  lhs,
const Image< R > &  rhs 
) [inline]

Point-wise addition of images lhs and rhs.

Parameters:
[in] lhs First operand image.
[in] rhs Second operand image.
Returns:
The result image.
Precondition:
lhs.domain == rhs.domain

Definition at line 348 of file arith/plus.hh.

References mln::trace::entering(), mln::exact(), mln::trace::exiting(), and mln::initialize().

Referenced by mln::operator+().

template<typename I , typename V >
mln::trait::op::plus< I, V >::ret mln::arith::plus_cst ( const Image< I > &  input,
const V &  val 
) [inline]

Point-wise addition of the value val to image input.

Parameters:
[in] input The image.
[in] val The value.
Returns:
The result image.
Precondition:
input.is_valid

Definition at line 404 of file arith/plus.hh.

References mln::pw::cst(), mln::trace::entering(), mln::exact(), and mln::trace::exiting().

Referenced by mln::operator+(), and plus_cst().

template<typename I , typename V , typename F >
mln::trait::ch_value< I, typename F::result >::ret mln::arith::plus_cst ( const Image< I > &  input,
const V &  val,
const Function_v2v< F > &  f 
) [inline]

Point-wise addition of the value val to image input.

Parameters:
[in] input The image.
[in] val The value.
[in] f Function.
Returns:
The result image.
Precondition:
input.is_valid

Definition at line 422 of file arith/plus.hh.

References mln::pw::cst(), mln::trace::entering(), mln::exact(), and mln::trace::exiting().

template<typename W , typename I , typename V >
mln::trait::ch_value< I, W >::ret mln::arith::plus_cst ( const Image< I > &  input,
const V &  val 
) [inline]

Point-wise addition of the value val to image input.

Parameters:
[in] input The image.
[in] val The value.
Returns:
The result image.
Precondition:
input.is_valid

Definition at line 441 of file arith/plus.hh.

References mln::trace::entering(), mln::exact(), mln::trace::exiting(), and plus_cst().

template<typename I , typename V >
I & mln::arith::plus_cst_inplace ( Image< I > &  input,
const V &  val 
) [inline]

Point-wise addition of the value val to image input.

Parameters:
[in,out] input The image.
[in] val The value.
Precondition:
input.is_valid

Definition at line 475 of file arith/plus.hh.

References mln::pw::cst(), mln::trace::entering(), mln::exact(), mln::trace::exiting(), plus_cst_inplace(), and plus_inplace().

Referenced by mln::operator+=(), and plus_cst_inplace().

template<typename L , typename R >
void mln::arith::plus_inplace ( Image< L > &  lhs,
const Image< R > &  rhs 
) [inline]

Point-wise addition of image rhs in image lhs.

Parameters:
[in,out] lhs First operand image (subject to addition).
[in] rhs Second operand image (to be added to lhs).

This addition performs:
for all p of rhs.domain
lhs(p) += rhs(p)

Precondition:
rhs.domain == lhs.domain

Definition at line 459 of file arith/plus.hh.

References mln::trace::entering(), mln::exact(), mln::trace::exiting(), and plus_inplace().

Referenced by mln::operator+=(), plus_cst_inplace(), and plus_inplace().

template<typename I >
mln::trait::concrete< I >::ret mln::arith::revert ( const Image< I > &  input  )  [inline]

Point-wise reversion of image input.

Parameters:
[in] input the input image.
Returns:
The result image.
Precondition:
input.is_valid

It performs:
for all p of input.domain
output(p) = min + (max - input(p))

Definition at line 158 of file revert.hh.

References mln::trace::entering(), mln::exact(), mln::trace::exiting(), mln::initialize(), and mln::arith::internal::revert_dispatch().

Referenced by mln::morpho::impl::complementation_(), and mln::arith::internal::revert_dispatch().

template<typename I >
void mln::arith::revert_inplace ( Image< I > &  input  )  [inline]

Point-wise in-place reversion of image input.

Parameters:
[in,out] input The target image.
Precondition:
input.is_valid

It performs:
for all p of input.domain
input(p) = min + (max - input(p))

Definition at line 174 of file revert.hh.

References mln::trace::entering(), mln::exact(), mln::trace::exiting(), and mln::arith::internal::revert_dispatch().

Referenced by mln::morpho::impl::complementation_inplace_().

template<typename L , typename R , typename O >
void mln::arith::times ( const Image< L > &  lhs,
const Image< R > &  rhs,
Image< O > &  output 
) [inline]

Point-wise addition of images lhs and rhs.

Parameters:
[in] lhs First operand image.
[in] rhs Second operand image.
[out] output The result image.
Precondition:
output.domain == lhs.domain == rhs.domain

Definition at line 226 of file arith/times.hh.

References mln::trace::entering(), mln::exact(), and mln::trace::exiting().

Referenced by mln::operator*().

template<typename I , typename V , typename O >
void mln::arith::times_cst ( const Image< I > &  input,
const V &  val,
Image< O > &  output 
) [inline]

Point-wise addition of the value val to image input.

Parameters:
[in] input The image.
[in] val The value.
[out] output The result image.
Precondition:
output.domain == input.domain

Definition at line 241 of file arith/times.hh.

References mln::pw::cst(), mln::trace::entering(), mln::exact(), mln::trace::exiting(), and times_cst().

Referenced by mln::operator*(), mln::operator*=(), and times_cst().

template<typename I , typename V >
void mln::arith::times_cst_inplace ( Image< I > &  input,
const V &  val 
) [inline]
template<typename L , typename R >
void mln::arith::times_inplace ( Image< L > &  lhs,
const Image< R > &  rhs 
) [inline]

Point-wise addition of image rhs in image lhs.

Parameters:
[in] lhs First operand image (subject to addition).
[in,out] rhs Second operand image (to be added to lhs).

This addition performs:
for all p of rhs.domain
lhs(p) *= rhs(p)

Precondition:
rhs.domain <= lhs.domain

Definition at line 254 of file arith/times.hh.

References mln::trace::entering(), mln::exact(), mln::trace::exiting(), and times_inplace().

Referenced by mln::operator*=(), times_cst_inplace(), and times_inplace().