IDS peak ICV v1.5.0
Loading...
Searching...
No Matches
GammaFeature Class Reference

#include <peak_icv/pipeline/features/peak_icv_gamma_feature.hpp>

Inheritance diagram for GammaFeature:

Public Member Functions

 GammaFeature (detail::ToneCurveCorrectionModule &module)
 Creates a GammaFeature for an existing tone curve correction module.
 
void SetEnabled (bool enabled) override
 Enables or disables the feature.
 
bool IsEnabled () const override
 Gets whether this feature is currently enabled.
 
void ResetToDefault () override
 Resets the gamma value to the default.
 
void SetValue (float gamma)
 Sets the gamma correction exponent.
 
float GetValue () const
 Gets the current gamma correction exponent.
 
peak::common::IntervalF GetRange () const
 Retrieves the valid range for the gamma correction exponent.
 

Detailed Description

Gamma applies an inverse gamma transformation to an image.

This module adjusts the image luminance by applying an inverse gamma correction. This prepares the image for a linear domain or further processing.

The correction is applied independently to each channel in the image. For RGB images, it is applied to each color channel (R, G, B), and for monochrome images, it is applied to the single intensity channel.

The correction is performed using the following formula:

color_value_out = pow(color_value_in, 1.0 / gamma);

where:

  • color_value_in is the input channel value,
  • gamma is the gamma exponent,
  • color_value_out is the resulting output value.
Warning
Gamma values close to zero may result in very dark images, while very high values may cause loss of detail in dark areas. Use values within the range returned by GetRange().

Defaults
  • gamma = 1.0
See also
features::DigitalBlackFeature, features::GainFeature, features::SharpeningFeature
Since
ids_peak_icv 1.0

Constructor & Destructor Documentation

◆ GammaFeature()

GammaFeature ( detail::ToneCurveCorrectionModule & module)
inlineexplicit

Creates a GammaFeature for an existing tone curve correction module.

Parameters
moduleReference to the underlying detail::ToneCurveCorrectionModule.
Since
ids_peak_icv 1.0

Member Function Documentation

◆ GetRange()

peak::common::IntervalF GetRange ( ) const
inline

Retrieves the valid range for the gamma correction exponent.

The returned interval specifies the minimum and maximum values that can be passed to SetValue.

Returns
An IntervalF representing the valid gamma range.
Since
ids_peak_icv 1.0

◆ GetValue()

float GetValue ( ) const
inline

Gets the current gamma correction exponent.

Returns
The gamma exponent currently set.
Since
ids_peak_icv 1.0

◆ IsEnabled()

bool IsEnabled ( ) const
inlineoverridevirtual

Gets whether this feature is currently enabled.

Returns
true if enabled; otherwise false.
Since
ids_peak_icv 1.0

Implements IFeature.

◆ ResetToDefault()

void ResetToDefault ( )
inlineoverridevirtual

Resets the gamma value to the default.

Note
The enabled state does not change when calling this function.
Since
ids_peak_icv 1.0

Implements IFeature.

◆ SetEnabled()

void SetEnabled ( bool enabled)
inlineoverridevirtual

Enables or disables the feature.

Parameters
enabledSet to true to enable, or false to disable.
Since
ids_peak_icv 1.0

Implements IFeature.

◆ SetValue()

void SetValue ( float gamma)
inline

Sets the gamma correction exponent.

This value determines the degree of inverse gamma correction applied during processing, where output values are computed as pow(input, 1/gamma). Higher gamma values lighten the image, while values closer to zero darken it.

Parameters
gammaA floating-point value representing the gamma exponent. Valid values are within the range returned by GetRange.
Exceptions
OutOfRangeExceptionIf gamma is outside the valid range.
Since
ids_peak_icv 1.0