CVB++ 14.1
WhiteBalanceFactors Class Referencefinal

Factors for white balance correction. More...

#include <cvb/white_balance.hpp>

Public Member Functions

 WhiteBalanceFactors (double red, double green, double blue)
 Initialize a white balance factors structure. More...
 
double Red () const noexcept
 Gets the white balance factor for the red channel. More...
 
void SetRed (double red)
 Sets the white balance factor for the red channel. More...
 
double Green () const noexcept
 Gets the white balance factor for the geen channel. More...
 
void SetGreen (double green)
 Sets the white balance factor for the green channel. More...
 
double Blue () const noexcept
 Gets the white balance factor for the blue channel. More...
 
void SetBlue (double blue)
 Sets the white balance factor for the blue channel. More...
 

Static Public Member Functions

static WhiteBalanceFactors Identity () noexcept
 Identity transformation leaving all values as they are. More...
 

Related Functions

(Note that these are not member functions.)

WhiteBalanceFactors CalculateWhiteBalanceFactors (const Image &image, Area2D aoi)
 Calculate the red, green and blue gain factor for white balancing. More...
 
void ApplyWhiteBalanceFactors (const Image &image, WhiteBalanceFactors factors)
 Applies the white balance factors to the given image. More...
 

Detailed Description

Factors for white balance correction.

Note
The white balance factors inside this structure are internally stored as integers with 1/256 increments. Therefore even though the values are exposed as doubles, they cannot represent the full range of double values.

Constructor & Destructor Documentation

◆ WhiteBalanceFactors()

WhiteBalanceFactors ( double  red,
double  green,
double  blue 
)
inline

Initialize a white balance factors structure.

Parameters
[in]redCorrection factor for the red channel.
[in]greenCorrection factor for the green channel.
[in]blueCorrection factor for the blue channel.
Exceptions
Anyexception derived from std::exception including CvbException.

Member Function Documentation

◆ Blue()

double Blue ( ) const
inlinenoexcept

Gets the white balance factor for the blue channel.

Returns
double The factor.
Exceptions
Doesnot throw any exception.

◆ Green()

double Green ( ) const
inlinenoexcept

Gets the white balance factor for the geen channel.

Returns
double The factor.
Exceptions
Doesnot throw any exception.

◆ Identity()

static WhiteBalanceFactors Identity ( )
inlinestaticnoexcept

Identity transformation leaving all values as they are.

Returns
Default white balance factors.
Exceptions
Doesnot throw any exception.

◆ Red()

double Red ( ) const
inlinenoexcept

Gets the white balance factor for the red channel.

Returns
double The factor.
Exceptions
Doesnot throw any exception.

◆ SetBlue()

void SetBlue ( double  blue)
inline

Sets the white balance factor for the blue channel.

Parameters
[in]blueThe factor.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ SetGreen()

void SetGreen ( double  green)
inline

Sets the white balance factor for the green channel.

Parameters
[in]greenThe factor.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ SetRed()

void SetRed ( double  red)
inline

Sets the white balance factor for the red channel.

Parameters
[in]redThe factor.
Exceptions
Anyexception derived from std::exception including CvbException.

Friends And Related Function Documentation

◆ ApplyWhiteBalanceFactors()

void ApplyWhiteBalanceFactors ( const Image image,
WhiteBalanceFactors  factors 
)
related

Applies the white balance factors to the given image.

Parameters
[in]imageImage to apply white-balance factors to.
[in]factorsGain factors to apply.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ CalculateWhiteBalanceFactors()

WhiteBalanceFactors CalculateWhiteBalanceFactors ( const Image image,
Area2D  aoi 
)
related

Calculate the red, green and blue gain factor for white balancing.

Parameters
[in]imageImage on which the gain factors are to be calculated.
[in]aoiArea of interest that is assumed to be the neutral color.
Returns
Calculated white balance factors.
Exceptions
Anyexception derived from std::exception including CvbException.

Floating-point valued images must not have negative pixel values for this operation to yield useful output.