Namespaces | Functions

mln::world::rgb Namespace Reference

Namespaces

namespace  impl
namespace  internal

Functions

template<typename I >
mln::trait::concrete< I >::ret invert (const Image< I > &input)
 Point-wise reversion of image input.
template<typename I >
void invert_inplace (Image< I > &input)
 Point-wise in-place reversion of image input.

Function Documentation

template<typename I >
mln::trait::concrete< I >::ret mln::world::rgb::invert ( 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).red() = min(red) + (max(red) - input(p).red())
output(p).green() = min(green) + (max(green) - input(p).green())
output(p).blue() = min(blue) + (max(blue) - input(p).blue())
}

Definition at line 180 of file invert.hh.

References mln::trace::entering(), mln::exact(), mln::trace::exiting(), mln::initialize(), and mln::world::rgb::internal::invert_dispatch().

template<typename I >
void mln::world::rgb::invert_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
{
output(p).red() = min(red) + (max(red) - input(p).red())
output(p).green() = min(green) + (max(green) - input(p).green())
output(p).blue() = min(blue) + (max(blue) - input(p).blue())
}

Definition at line 196 of file invert.hh.

References mln::trace::entering(), mln::exact(), mln::trace::exiting(), and mln::world::rgb::internal::invert_dispatch().