Ocean
Loading...
Searching...
No Matches
Ocean::CV::FrameConverter::Options Class Reference

Definition of a class storing options for frame conversions. More...

#include <FrameConverter.h>

Public Types

enum  OptionsType : uint32_t {
  OT_DEFAULT = 0u , OT_ALPHA_CHANNEL_TARGET_VALUE = 1u << 0u , OT_GAMMA_CORRECTION = 1u << 1u , OT_BLACKLEVEL_WHITEBALANCE_GAMMA = 1u << 2u ,
  OT_APPROXIMATED = 1u << 2u
}
 Definition of individual types of options. More...
 

Public Member Functions

 Options (const bool allowApproximation=false)
 Default constructor.
 
 Options (const uint8_t alphaChannelTargetValue, const bool allowApproximation=false)
 Creates options for source image without alpha channel but a target image with alpha channel.
 
 Options (const float gamma, const bool allowApproximation=false)
 Creates options for a conversion applying gamma correction.
 
 Options (const uint16_t blackLevel, const float whiteBalanceRed, const float whiteBalanceGreen, const float whiteBalanceBlue, const float gamma, const bool allowApproximation=false)
 Creates options for a conversion applying black level subtraction, white balance, and gamma encoding.
 
OptionsType optionsType () const
 Returns the options type.
 
uint8_t alphaChannelTargetValue () const
 Returns the uint8_t alpha channel value for the target image if the source image does not contain an alpha channel; ignored if the source image contains an alpha channel.
 
float gamma () const
 Returns the gamma value for a conversion with gamma correction/encoding.
 
uint16_t blackLevel () const
 Returns the black level value for a conversion with black level correction.
 
const float * whiteBalance () const
 Returns the white balance values for a conversion with white balance correction.
 
bool allowApproximation () const
 Returns whether the conversion can be approximated.
 

Protected Attributes

OptionsType optionsType_ = OT_DEFAULT
 The options type.
 
uint8_t alphaChannelTargetValue_ = 0xFFu
 The alpha channel value for the target image if the source image does not contain an alpha channel, with range [0, 255].
 
float gamma_ = 1.0f
 The gamma value for a conversion with gamma correction/encoding, with range (0, 2) (OT_GAMMA_CORRECTION) or [0, infinity) (OT_BLACKLEVEL_WHITEBALANCE_GAMMA)
 
uint16_t blackLevel_ = 0u
 The black level value that is subtracted from each element of the raw image before any other operation, with range [0, 1024)
 
float whiteBalance_ [3] = { 1.0f, 1.0f, 1.0f }
 The white balancing scalars of the red, green, and blue channels (in that order), with range [0, infinity)
 

Detailed Description

Definition of a class storing options for frame conversions.

Member Enumeration Documentation

◆ OptionsType

Definition of individual types of options.

Enumerator
OT_DEFAULT 

Default conversion.

OT_ALPHA_CHANNEL_TARGET_VALUE 

Conversion with explicit alpha channel target value.

OT_GAMMA_CORRECTION 

Conversion with gamma correction.

OT_BLACKLEVEL_WHITEBALANCE_GAMMA 

Conversion with black level, white balance, and gamma encoding.

OT_APPROXIMATED 

Approximated conversion.

Constructor & Destructor Documentation

◆ Options() [1/4]

Ocean::CV::FrameConverter::Options::Options ( const bool  allowApproximation = false)
inlineexplicit

Default constructor.

Parameters
allowApproximationTrue, to allow an approximated conversion if available

◆ Options() [2/4]

Ocean::CV::FrameConverter::Options::Options ( const uint8_t  alphaChannelTargetValue,
const bool  allowApproximation = false 
)
inlineexplicit

Creates options for source image without alpha channel but a target image with alpha channel.

Parameters
alphaChannelTargetValueThe uint8_t alpha channel value for the target image if the source image does not contain an alpha channel; ignored if the source image contains an alpha channel, with range [0, 255]
allowApproximationTrue, to allow an approximated conversion if available

◆ Options() [3/4]

Ocean::CV::FrameConverter::Options::Options ( const float  gamma,
const bool  allowApproximation = false 
)
inlineexplicit

Creates options for a conversion applying gamma correction.

Parameters
gammaThe gamma value to be applied, with range (0, 2)
allowApproximationTrue, to allow an approximated conversion if available

◆ Options() [4/4]

Ocean::CV::FrameConverter::Options::Options ( const uint16_t  blackLevel,
const float  whiteBalanceRed,
const float  whiteBalanceGreen,
const float  whiteBalanceBlue,
const float  gamma,
const bool  allowApproximation = false 
)
inlineexplicit

Creates options for a conversion applying black level subtraction, white balance, and gamma encoding.

Parameters
blackLevelThe black level value that is subtracted from each element of the raw image before any other operation, with range [0, 1024)
whiteBalanceRedThe white balancing scalar of the red channel, with range [0, infinity)
whiteBalanceGreenThe white balancing scalar of the green channel, with range [0, infinity)
whiteBalanceBlueThe white balancing scalar of the blue channel, with range [0, infinity)
gammaThe gamma value to be applied, with range (0, infinity)
allowApproximationTrue, to allow an allowApproximation conversion if available
See also
FrameConverterRGGB10_Packed::convertRGGB10_PackedToRGB24BlacklevelWhiteBalanceGammaLUT()

Member Function Documentation

◆ allowApproximation()

bool Ocean::CV::FrameConverter::Options::allowApproximation ( ) const
inline

Returns whether the conversion can be approximated.

Returns
True, if so

◆ alphaChannelTargetValue()

uint8_t Ocean::CV::FrameConverter::Options::alphaChannelTargetValue ( ) const
inline

Returns the uint8_t alpha channel value for the target image if the source image does not contain an alpha channel; ignored if the source image contains an alpha channel.

Returns
The alpha value for the target channel, with range [0, 255]

◆ blackLevel()

uint16_t Ocean::CV::FrameConverter::Options::blackLevel ( ) const
inline

Returns the black level value for a conversion with black level correction.

Returns
The black level value, with range [0, 1024)

◆ gamma()

float Ocean::CV::FrameConverter::Options::gamma ( ) const
inline

Returns the gamma value for a conversion with gamma correction/encoding.

Returns
The gamma value, with range (0, 2) (OT_GAMMA_CORRECTION) or [0, infinity) (OT_BLACKLEVEL_WHITEBALANCE_GAMMA)

◆ optionsType()

FrameConverter::Options::OptionsType Ocean::CV::FrameConverter::Options::optionsType ( ) const
inline

Returns the options type.

Returns
The options' type

◆ whiteBalance()

const float * Ocean::CV::FrameConverter::Options::whiteBalance ( ) const
inline

Returns the white balance values for a conversion with white balance correction.

Returns
The white balance values for the red, green, and blue channels, with range [0, infinity)

Field Documentation

◆ alphaChannelTargetValue_

uint8_t Ocean::CV::FrameConverter::Options::alphaChannelTargetValue_ = 0xFFu
protected

The alpha channel value for the target image if the source image does not contain an alpha channel, with range [0, 255].

◆ blackLevel_

uint16_t Ocean::CV::FrameConverter::Options::blackLevel_ = 0u
protected

The black level value that is subtracted from each element of the raw image before any other operation, with range [0, 1024)

◆ gamma_

float Ocean::CV::FrameConverter::Options::gamma_ = 1.0f
protected

The gamma value for a conversion with gamma correction/encoding, with range (0, 2) (OT_GAMMA_CORRECTION) or [0, infinity) (OT_BLACKLEVEL_WHITEBALANCE_GAMMA)

◆ optionsType_

OptionsType Ocean::CV::FrameConverter::Options::optionsType_ = OT_DEFAULT
protected

The options type.

◆ whiteBalance_

float Ocean::CV::FrameConverter::Options::whiteBalance_[3] = { 1.0f, 1.0f, 1.0f }
protected

The white balancing scalars of the red, green, and blue channels (in that order), with range [0, infinity)


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