IDS peak IPL v1.17.2
Loading...
Searching...
No Matches
peak::ipl::GammaCorrector Class Referencefinal

Applies digital black and gamma correction to the image data. More...

#include <peak_ipl/algorithm/peak_ipl_gamma_corrector.hpp>

Public Member Functions

 GammaCorrector ()
 Constructor for a new GammaCorrector instance.
 ~GammaCorrector ()
 Destructor for the GammaCorrector instance.
 GammaCorrector (const GammaCorrector &other)
 Copy Constructor for a new GammaCorrector instance.
GammaCorrector & operator= (const GammaCorrector &other)
 Copy assigment for GammaCorrector instance.
 GammaCorrector (GammaCorrector &&other) noexcept
 Move constructor for GammaCorrector instance.
GammaCorrector & operator= (GammaCorrector &&other) noexcept
 Move assignment for GammaCorrector instance.
void SetGammaCorrectionValue (float gammaValue)
 Sets the gamma value of the gamma correction.
float GammaCorrectionValue () const
 Returns the value of the gamma correction.
float GammaCorrectionMin () const
 Returns the minimum value of the gamma correction.
float GammaCorrectionMax () const
 Returns the maximum value of the gamma correction.
void SetDigitalBlack (float digitalBlackValue)
 Configures the digital black correction value to adjust RGB master black.
float DigitalBlack () const
 Returns the value of the digital black correction.
float DigitalBlackMin () const
 Returns the minimum value of the digital black correction.
float DigitalBlackMax () const
 Returns the maximum value of the digital black correction.
bool IsPixelFormatSupported (PixelFormatName pixelFormatName) const
 Returns whether the gamma corrector supports the given pixel format.
void ProcessInPlace (Image &image) const
 Corrects the gammas of the given image in place that is, it will change the input image.
Image Process (const Image &inputImage) const
 Corrects the gammas of the given image.

Detailed Description

Applies digital black and gamma correction to the image data.

Constructor & Destructor Documentation

◆ GammaCorrector() [1/3]

peak::ipl::GammaCorrector::GammaCorrector ( )
inline

Constructor for a new GammaCorrector instance.

Creates a new GammaCorrector instance.

Since
1.2.2

◆ ~GammaCorrector()

peak::ipl::GammaCorrector::~GammaCorrector ( )
inline

Destructor for the GammaCorrector instance.

Destroys a GammaCorrector instance.

Since
1.2.2

◆ GammaCorrector() [2/3]

peak::ipl::GammaCorrector::GammaCorrector ( const GammaCorrector & other)
inline

Copy Constructor for a new GammaCorrector instance.

Creates a new GammaCorrector instance.

Note
This only creates a shallow copy. See Shallow copy (since 1.8) for a detailed explanation.
Parameters
[in]otherThe other instance to acquire a reference for.
Since
1.2.2 Deleted
1.8 Implemented as shallow copy

◆ GammaCorrector() [3/3]

peak::ipl::GammaCorrector::GammaCorrector ( GammaCorrector && other)
inlinenoexcept

Move constructor for GammaCorrector instance.

Moves the instance from other to this. Afterwards other is invalid.

Parameters
[in]otherThe other instance to move.
Since
1.2.2

Member Function Documentation

◆ DigitalBlack()

float peak::ipl::GammaCorrector::DigitalBlack ( ) const
inline

Returns the value of the digital black correction.

Returns
the value of the digital black correction as decimal fraction of the maximum range of the corresponding bit depth.
Since
1.15

◆ DigitalBlackMax()

float peak::ipl::GammaCorrector::DigitalBlackMax ( ) const
inline

Returns the maximum value of the digital black correction.

Returns
the maximum value of the digital black correction (1.0f). 1.0f corresponds to the maximum range of the corresponding bit depth.
Since
1.15

◆ DigitalBlackMin()

float peak::ipl::GammaCorrector::DigitalBlackMin ( ) const
inline

Returns the minimum value of the digital black correction.

Returns
the minimum value of the digital black correction (0.0f) 0.0f means that digital black correction is disabled.
Since
1.15

◆ GammaCorrectionMax()

float peak::ipl::GammaCorrector::GammaCorrectionMax ( ) const
inline

Returns the maximum value of the gamma correction.

Returns
gammaMax The maximum value of the gamma correction.
Since
1.2.2

◆ GammaCorrectionMin()

float peak::ipl::GammaCorrector::GammaCorrectionMin ( ) const
inline

Returns the minimum value of the gamma correction.

Returns
gammaMin The minimum value of the gamma correction.
Since
1.2.2

◆ GammaCorrectionValue()

float peak::ipl::GammaCorrector::GammaCorrectionValue ( ) const
inline

Returns the value of the gamma correction.

Returns
gammaValue The value of the gamma correction.
Since
1.2.2

◆ IsPixelFormatSupported()

bool peak::ipl::GammaCorrector::IsPixelFormatSupported ( PixelFormatName pixelFormatName) const
inline

Returns whether the gamma corrector supports the given pixel format.

Returns
Flag whether the given pixel format is supported.
Parameters
[in]pixelFormatNameThe pixel format of interest.
Since
1.2.2

◆ operator=() [1/2]

GammaCorrector & peak::ipl::GammaCorrector::operator= ( const GammaCorrector & other)
inline

Copy assigment for GammaCorrector instance.

Acquires a reference from other to this instance. If this instance already has a reference, it will be destroyed.

Note
See Shallow copy (since 1.8) for a detailed explanation.
Parameters
[in]otherThe other instance to acquire a reference for.
Since
1.2.2 Deleted
1.8 Implemented as shallow copy

◆ operator=() [2/2]

GammaCorrector & peak::ipl::GammaCorrector::operator= ( GammaCorrector && other)
inlinenoexcept

Move assignment for GammaCorrector instance.

Moves the instance from other to this. Afterwards other is invalid.

Parameters
[in]otherThe other instance to move.
Since
1.2.2

◆ Process()

Image peak::ipl::GammaCorrector::Process ( const Image & inputImage) const
inline

Corrects the gammas of the given image.

Parameters
[in]inputImageImage to process.
Note
Will not work with packed pixel formats. See Packed pixel format handling for the correct handling of this.
Returns
A new created image containing the gamma-corrected pixels.
Exceptions
ImageFormatNotSupportedExceptionimage has unsupported pixel format.
Since
1.2.2

◆ ProcessInPlace()

void peak::ipl::GammaCorrector::ProcessInPlace ( Image & image) const
inline

Corrects the gammas of the given image in place that is, it will change the input image.

Parameters
[in]imageImage to process.
Note
Will not work with packed pixel formats. See Packed pixel format handling for the correct handling of this.
Exceptions
ImageFormatNotSupportedExceptionimage has unsupported pixel format.
Since
1.2.2

◆ SetDigitalBlack()

void peak::ipl::GammaCorrector::SetDigitalBlack ( float digitalBlackValue)
inline

Configures the digital black correction value to adjust RGB master black.

This function sets the digital black, which shifts the darkest parts of an image towards zero. The value you set determines what intensity is treated as black, without changing the brightest parts (white level). This helps in the following ways:

  • Improves contrast: Reduces stray light effects and makes dark areas truly black.
  • Focuses on specific brightness ranges: Allows you to visualize a certain range of brightness in the image.

The value is supplied as a fraction of the maximum possible pixel value.

Note that gamma correction is applied after the digital black correction. Digital black is distinct from sensor electrical black adjustments, which can be set using the device black level. Digital black correction cannot address offsets in Bayer raw data.

Parameters
[in]digitalBlackValueThe value of the digital black correction as decimal fraction of the maximum range of the corresponding bit depth.
Exceptions
InvalidArgumentdigitalBlackValue is not supported.
Since
1.15

◆ SetGammaCorrectionValue()

void peak::ipl::GammaCorrector::SetGammaCorrectionValue ( float gammaValue)
inline

Sets the gamma value of the gamma correction.

The gamma correction adjusts the camera characteristic curve to a typical display characteristic curve by raising the gray values to the power of the inverse gamma value. Usually, sRGB colors with a gamma of 2.2 are assumed. A gamma setting of 1.0 preserves linear gray values.

The human eye perceives differences in brightness with a logarithmic characteristic curve, which is often approximated in practice with a gamma characteristic curve. The brightness perceived by humans increases more steeply in dark areas and less steeply in bright areas.

Parameters
[in]gammaValueThe value of the gamma correction.
Exceptions
InvalidArgumentgammaValue isn't supported.
Since
1.2.2

The documentation for this class was generated from the following file: