IDS peak ICV v1.2.0
Loading...
Searching...
No Matches
GammaFeature Class Reference
Inheritance diagram for GammaFeature:

Public Member Functions

None __init__ (self, ToneCurveCorrectionModule module)
 Creates a gamma feature for an existing tone curve correction module.
 
bool enabled (self)
 Indicates whether the feature is currently enabled.
 
None enabled (self, bool value)
 Enables or disables the feature.
 
None reset_to_default (self)
 Resets the gamma value to 1.0.
 
float value (self)
 Gets the current gamma correction exponent.
 
None value (self, float gamma)
 Sets the gamma correction exponent.
 
Interval range (self)
 Retrieves the valid range for the gamma correction exponent.
 

Data Fields

float value = 1.0
 

Protected Attributes

 _module = module
 

Detailed Description

Gamma applies an inverse gamma transformation to an image.

Supported pixel formats
  • Mono8
  • Mono10
  • Mono12
  • Mono16
  • BayerBG8
  • BayerBG10
  • BayerBG12
  • BayerGB8
  • BayerGB10
  • BayerGB12
  • BayerRG8
  • BayerRG10
  • BayerRG12
  • BayerGR8
  • BayerGR10
  • BayerGR12
  • RGB8
  • RGBa8
  • BGR8
  • BGRa8
  • RGB10
  • RGBa10
  • BGR10
  • BGRa10
  • RGB12
  • RGBa12
  • BGR12
  • BGRa12

See the Pixel and Pixel Format Specifications for a detailed description of the pixel formats.

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 ^ (1.0 / gamma)

All input and output values are in the normalized range [0.0, 1.0].

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 range property.

The default value for gamma is 1.0.

Since
ids_peak_icv 1.0

Definition at line 8 of file gamma_feature.py.

Constructor & Destructor Documentation

◆ __init__()

None __init__ ( self,
ToneCurveCorrectionModule module )

Creates a gamma feature for an existing tone curve correction module.

Parameters
moduleReference to the underlying module

Definition at line 36 of file gamma_feature.py.

Member Function Documentation

◆ enabled() [1/2]

bool enabled ( self)

Indicates whether the feature is currently enabled.

Returns
True if enabled; otherwise, False.
Since
ids_peak_icv 1.0

Reimplemented from IFeature.

Definition at line 45 of file gamma_feature.py.

◆ enabled() [2/2]

None enabled ( self,
bool value )

Enables or disables the feature.

Parameters
valueSet to True to enable the feature, or False to disable it.
Since
ids_peak_icv 1.0

Reimplemented from IFeature.

Definition at line 56 of file gamma_feature.py.

◆ range()

Interval range ( self)

Retrieves the valid range for the gamma correction exponent.

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

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

Definition at line 108 of file gamma_feature.py.

◆ reset_to_default()

None reset_to_default ( self)

Resets the gamma value to 1.0.

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

Reimplemented from IFeature.

Definition at line 66 of file gamma_feature.py.

◆ value() [1/2]

float value ( self)

Gets the current gamma correction exponent.

Returns
The gamma exponent currently set.
Since
ids_peak_icv 1.0

Definition at line 78 of file gamma_feature.py.

◆ value() [2/2]

None value ( self,
float gamma )

Sets the gamma correction exponent.

This value determines the degree of inverse gamma correction applied during processing, where output values are computed as 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 range property.
Exceptions
OutOfRangeExceptionIf gamma is outside the valid range.
Since
ids_peak_icv 1.0

Definition at line 89 of file gamma_feature.py.

Field Documentation

◆ _module

_module = module
protected

Definition at line 42 of file gamma_feature.py.

◆ value

float value = 1.0

Definition at line 75 of file gamma_feature.py.