libcamera v0.7.2+rpt20261009
Supporting cameras in Linux since 2019
Loading...
Searching...
No Matches
libcamera::ipa::GammaAlgorithm< NLutNodes, UQ > Class Template Reference

The libipa gamma correction algorithm. More...

Inheritance diagram for libcamera::ipa::GammaAlgorithm< NLutNodes, UQ >:
Collaboration diagram for libcamera::ipa::GammaAlgorithm< NLutNodes, UQ >:

Public Member Functions

template<typename T >
void prepare (gamma::FrameContext &context, std::span< T, NLutNodes > lut)
 
- Public Member Functions inherited from libcamera::ipa::GammaAlgorithmBase
 GammaAlgorithmBase (unsigned int nLutNodes)
 Construct an instance of the class.
 
int init (ControlInfoMap::Map &controls, const ValueNode &tuningData, std::span< unsigned int > segments={})
 Initialise the algorithm with the given tuning data.
 
void configure (gamma::ActiveState &state)
 Configure the gamma correction algorithm.
 
void queueRequest (gamma::ActiveState &state, const uint32_t frame, gamma::FrameContext &context, const ControlList &controls)
 Queue a request to the gamma correction algorithm.
 
void process (gamma::FrameContext &context, ControlList &metadata)
 Populate metadata with the gamma correction values for a frame.
 

Additional Inherited Members

- Protected Attributes inherited from libcamera::ipa::GammaAlgorithmBase
unsigned int nLutNodes_
 The number of gamma LUT sampling points.
 
float defaultGamma_
 The default gamma parameter.
 
std::vector< float > kneePoints_
 a vector holding the X-position of the knee points of the curve
 

Detailed Description

template<unsigned int NLutNodes, typename UQ>
class libcamera::ipa::GammaAlgorithm< NLutNodes, UQ >

The libipa gamma correction algorithm.

Template Parameters
NLutNodesThe number of gamma LUT sampling points
UQThe fixedpoint representation of the gamma correction values

Gamma correction adjusts for the differences in the way light is perceived by a camera and the human eye by applying a function to the input values. The GammaAlgorithm class facilitates this by building a piecewise linear function from a gamma parameter and supplying it in the hardware-specific formats defined by the IPA algorithms.

IPA modules are expected to store an instance of GammaAlgorithm as a class member, templated with the format and number of knee-points in the PWL expected by their hardware and then call its functions in their overload of the Algorithm class's function.

When an application queues a new value for the gamma parameter with a Request, the GammaAlgorithm will recalculate and populate the new LUT to be sent to the ISP.

Useful links:

Member Function Documentation

◆ prepare()

template<unsigned int NLutNodes, typename UQ >
template<typename T >
libcamera::ipa::GammaAlgorithm< NLutNodes, UQ >::prepare ( gamma::FrameContext &  context,
std::span< T, NLutNodes >  lut 
)
inline
Template Parameters
TThe type of data expected by the hardware's look-up table
Parameters
[in]contextThe frame context
[out]lutThe std::span into which to place the calculated look-up table

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