#include <peak_icv/pipeline/detail/peak_icv_gain_module.hpp>

Public Member Functions | |
| GainModule () | |
| Creates an instance of class GainModule with default values. | |
| ~GainModule () override | |
| GainModule (const GainModule &other)=delete | |
| Copy constructor for class GainModule is deleted. | |
| GainModule (GainModule &&other) noexcept | |
| GainModule & | operator= (const GainModule &other)=delete |
| Copy assignment for class GainModule is deleted. | |
| GainModule & | operator= (GainModule &&other) noexcept |
| void | SetEnabled (bool enabled) override |
| Enables or disables the module. | |
| bool | IsEnabled () const override |
| Gets whether this module is currently enabled. | |
| void | Serialize (peak::common::serialization::IArchive &archive) const override |
| Serializes the object's internal state into the provided archive. | |
| void | Deserialize (const peak::common::serialization::IArchive &archive) override |
| Restores the object's state from the provided archive. | |
| const char * | GetType () const override |
| Returns the type of the module for serialization purposes. | |
| void | ResetToDefault () override |
| Resets the gain values to their defaults. | |
| void | SetMaster (float value) override |
| Sets the master gain value. | |
| float | GetMaster () const override |
| Returns the current master gain. | |
| void | SetRed (float value) override |
| Sets the red gain value. | |
| float | GetRed () const override |
| Returns the current red gain. | |
| void | SetGreen (float value) override |
| Sets the green gain value. | |
| float | GetGreen () const override |
| Returns the current green gain. | |
| void | SetBlue (float value) override |
| Sets the blue gain value. | |
| float | GetBlue () const override |
| Returns the current blue gain. | |
| peak::common::IntervalF | GetRange () const |
| Returns the valid range for the master or color gains. | |
| peak::icv::Image | Process (const peak::icv::Image &input) const |
| Applies the gains to the input image in place and returns a reference to the modified image. | |
| peak::common::Any | Process (const peak::common::Any &input) const override |
| Applies the gains to the input image in place and returns a reference to the modified image. | |
Image pipeline module for applying gain to the image.
Gain is used to adjust pixel intensities either uniformly across all color channels using the master gain, or individually per channel using the red, green, and blue gains. With master gain, image brightness can be increased. With color gains, the white balance can be adjusted.
For color images, gain is applied as follows:
where red_value_in, green_value_in, and blue_value_in are the input red, green, and blue channel values, respectively, and red_value_out, green_value_out, and blue_value_out are the corresponding output values. All RGB values are normalized to the range [0.0, 1.0].
For mono images, the color gains are ignored and applied as follows:
where gray_value_in is the input and gray_value_out the output value, normalized to the range [0.0, 1.0].
Definition at line 34 of file peak_icv_gain_module.hpp.
|
inline |
Creates an instance of class GainModule with default values.
Definition at line 312 of file peak_icv_gain_module.hpp.
|
inlineoverride |
Definition at line 319 of file peak_icv_gain_module.hpp.
|
delete |
Copy constructor for class GainModule is deleted.
|
inlinenoexcept |
Definition at line 327 of file peak_icv_gain_module.hpp.
|
inlineoverridevirtual |
Restores the object's state from the provided archive.
This function reads and applies all necessary parameters from the given archive to reconstruct the internal state of the object. It ensures that the object is restored to a valid and consistent state.
| archive | The source archive containing the serialized parameters. |
| CorruptedException | If Archive is malformed, misses keys or the values are invalid |
| NotSupportedException | If the 'Version' entry indicates an unsupported version. |
Implements ISerializable.
Definition at line 372 of file peak_icv_gain_module.hpp.
|
inlineoverridevirtual |
Returns the current blue gain.
Implements IGain.
Definition at line 435 of file peak_icv_gain_module.hpp.
|
inlineoverridevirtual |
Returns the current green gain.
Implements IGain.
Definition at line 425 of file peak_icv_gain_module.hpp.
|
inlineoverridevirtual |
Returns the current master gain.
Implements IGain.
Definition at line 405 of file peak_icv_gain_module.hpp.
|
inline |
Returns the valid range for the master or color gains.
Provides the minimum and maximum values that are accepted by the SetMaster, SetRed, SetGreen and the SetBlue functions.
Definition at line 440 of file peak_icv_gain_module.hpp.
|
inlineoverridevirtual |
Returns the current red gain.
Implements IGain.
Definition at line 415 of file peak_icv_gain_module.hpp.
|
inlineoverridevirtual |
Returns the type of the module for serialization purposes.
Implements IModule.
Definition at line 386 of file peak_icv_gain_module.hpp.
|
inlineoverridevirtual |
Gets whether this module is currently enabled.
true if enabled; otherwise false.Implements IModule.
Definition at line 356 of file peak_icv_gain_module.hpp.
|
delete |
Copy assignment for class GainModule is deleted.
|
inlinenoexcept |
Definition at line 333 of file peak_icv_gain_module.hpp.
|
inlineoverridevirtual |
Applies the gains to the input image in place and returns a reference to the modified image.
The correction is performed based on the current configuration of the module. The operation modifies the input image directly and does not create a copy.
| input | The input image to be processed and corrected. |
| peak::common::InvalidCastException | If the input cast to peak::icv::Image failed. |
| NotSupportedException | If input image has any other than the supported pixel formats. |
Implements IModule.
Definition at line 455 of file peak_icv_gain_module.hpp.
|
inline |
Applies the gains to the input image in place and returns a reference to the modified image.
The correction is performed based on the current configuration of the module. The operation modifies the input image directly and does not create a copy.
| input | The input image to be processed and corrected. |
| NotSupportedException | If input image has any other than the supported pixel formats. |
Definition at line 450 of file peak_icv_gain_module.hpp.
|
inlineoverridevirtual |
Resets the gain values to their defaults.
Implements IModule.
Definition at line 391 of file peak_icv_gain_module.hpp.
|
inlineoverridevirtual |
Serializes the object's internal state into the provided archive.
This function populates the given archive with all parameters required to fully represent the current state of the object. It ensures that the object can be reconstructed or transmitted accurately by saving all relevant data members in a consistent and structured format.
| archive | The target archive that will store the serialized parameters. |
Implements ISerializable.
Definition at line 361 of file peak_icv_gain_module.hpp.
|
inlineoverridevirtual |
Sets the blue gain value.
Sets the color gain for the blue channel. The valid range for the gain value can be obtained using the GetRange function.
| value | The blue gain value to set. |
| peak::icv::OutOfRangeException | If the gain value is outside the valid range. |
Implements IGain.
Definition at line 430 of file peak_icv_gain_module.hpp.
|
inlineoverridevirtual |
Enables or disables the module.
| enabled | Set to true to enable, or false to disable. |
Implements IModule.
Definition at line 351 of file peak_icv_gain_module.hpp.
|
inlineoverridevirtual |
Sets the green gain value.
Sets the color gain for the green channel. The valid range for the gain value can be obtained using the GetRange function.
| value | The green gain value to set. |
| peak::icv::OutOfRangeException | If the gain value is outside the valid range. |
Implements IGain.
Definition at line 420 of file peak_icv_gain_module.hpp.
|
inlineoverridevirtual |
Sets the master gain value.
Sets the overall master gain. The valid range for the gain value can be obtained using the GetRange function.
| value | The master gain value to set. |
| peak::icv::OutOfRangeException | If the gain value is outside the valid range. |
Implements IGain.
Definition at line 400 of file peak_icv_gain_module.hpp.
|
inlineoverridevirtual |
Sets the red gain value.
Sets the color gain for the red channel. The valid range for the gain value can be obtained using the GetRange function.
| value | The red gain value to set. |
| peak::icv::OutOfRangeException | If the gain value is outside the valid range. |
Implements IGain.
Definition at line 410 of file peak_icv_gain_module.hpp.