libcamera v0.7.2+rpt20260817
Supporting cameras in Linux since 2019
Loading...
Searching...
No Matches
libcamera::ipa::LscImplementation Class Referenceabstract

Pure virtual base class for LSC algorithm implementations. More...

Inheritance diagram for libcamera::ipa::LscImplementation:

Public Types

using Components = std::map< std::string, std::vector< float >, std::less<> >
 Associate colour components with a list of gains in float format.
 
using ComponentsMap = std::map< unsigned int, Components >
 Associate a colour temperature to a LSC table.
 

Public Member Functions

virtual ~LscImplementation ()
 Virtual class destructor.
 
virtual int parseLscData (const ValueNode &tuningData, const LscDescriptor &descriptor)=0
 Parse tuningData.
 
virtual ComponentsMap sampleForCrop (const Rectangle &cropRectangle, std::vector< double > xPos, std::vector< double > yPos)=0
 Re-sample the LSC components for cropRectangle.
 

Detailed Description

Pure virtual base class for LSC algorithm implementations.

Defines the interface for the LSC algorithm implementation.

Member Typedef Documentation

◆ Components

Associate colour components with a list of gains in float format.

LSC tables are defined as a list of gain values associated to a colour component.

As different ISP support different colour components (usually 'r', 'gr', 'gb', 'b' or just 'r', 'g', 'b') this class associates a string identifier for the colour component to a list of gains.

The gain values are represented as floats and are either loaded from tuning file or are the result of a polynomial expansion, depending on the LscImplementation derived class in use (LscTable or LscPolynomial).

The gain values are converted to the platform's register format before being returned to the IPA module by LscAlgorithm::configure().

Todo:
Tabular LSC data are already expressed in register format. Make the tuning files express gains in float format as well and actually perform quantization in LscAlgorithm::configure().

◆ ComponentsMap

Associate a colour temperature to a LSC table.

An LSC table is generated during the tuning phase for a specific colour temperature, and a tuning file usually contains LSC tables generated for several different colour temperatures.

Member Function Documentation

◆ parseLscData()

libcamera::ipa::LscImplementation::parseLscData ( const ValueNode tuningData,
const LscDescriptor descriptor 
)
pure virtual

Parse tuningData.

Parameters
[in]tuningDataThe tuning data
[in]descriptorThe LSC engine descriptor

Parse the tuning file using the descriptor to identify the colour components in the tuning data and validate the size of the loaded gains tables.

Returns
0 on success, a negative error number otherwise

Implemented in libcamera::ipa::LscPolynomial, and libcamera::ipa::LscTable.

◆ sampleForCrop()

libcamera::ipa::LscImplementation::sampleForCrop ( const Rectangle cropRectangle,
std::vector< double >  xPos,
std::vector< double >  yPos 
)
pure virtual

Re-sample the LSC components for cropRectangle.

Parameters
[in]cropRectangleThe sensor analogue crop rectangle
[in]xPosList of horizontal positions of the LSC grid nodes
[in]yPosList of vertical positions of the LSC grid nodes

LSC tables have to be re-sampled every time a new sensor configuration is used, as each streaming session might use a different sensor crop rectangle cropRectangle.

cropRectangle represents the size of the frame on which the LSC tables have to be re-sampled on.

xPos and yPos represent the position of the grid nodes vertexes in the [0, 1] interval. For example an equally spaced grid of 16 nodes will have each segment of size 0.0625 and the list of nodes position will be [0, 0.0625, 0.125, 0.1875, ... , 1]. It is expected that the first position is 0 and the last position is 1.

LSC tables are expressed in two formats:

Table-based LSC tables are generated using an image at a fixed resolution and can't at the moment be re-sampled when a different resolution is used for a streaming session. Re-sampling a grid LSC table will return the same table as loaded from the tuning file.

Todo:
: Implement grid based re-sampling

Polynomial configurations are more flexible and can be re-sampled for a given sensor frame resolution using a list of horizontal and vertical nodes that define the LSC grid on which the polynomial is re-sampled on.

Implemented in libcamera::ipa::LscPolynomial, and libcamera::ipa::LscTable.


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