$extrastylesheet
Olena  User documentation 2.1
An Image Processing Platform
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mln::world::rgb Namespace Reference

Functions

template<typename I >
mln::trait::concrete< I >::ret invert (const Image< I > &input)
template<typename I >
void invert_inplace (Image< I > &input)

Function Documentation

template<typename I >
mln::trait::concrete< I >::ret mln::world::rgb::invert ( const Image< I > &  input)

Point-wise reversion of image input.

Parameters
[in]inputthe 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())
}

template<typename I >
void mln::world::rgb::invert_inplace ( Image< I > &  input)

Point-wise in-place reversion of image input.

Parameters
[in,out]inputThe 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())
}