libcamera v0.8.0
Supporting cameras in Linux since 2019
Loading...
Searching...
No Matches
libcamera::ipa::LscTable Class Reference

Table based LSC algorithm implementation. More...

Inheritance diagram for libcamera::ipa::LscTable:
Collaboration diagram for libcamera::ipa::LscTable:

Public Member Functions

int parseLscData (const ValueNode &sets, const LscDescriptor &descriptor) override
 Parse tabular LSC data.
LscImplementation::ComponentsMap sampleForCrop (const Rectangle &cropRectangle, std::span< const double > xPos, std::span< const double > yPos) override
 Re-sample the LSC components for cropRectangle.
Public Member Functions inherited from libcamera::ipa::LscImplementation
virtual ~LscImplementation ()
 Virtual class destructor.

Additional Inherited Members

Public Types inherited from libcamera::ipa::LscImplementation
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.

Detailed Description

Table based LSC algorithm implementation.

Table based LSC algorithm implementation. The LSCTable class implements LSC support using tabular LSC data.

See also
LscImplementation

Member Function Documentation

◆ parseLscData()

int libcamera::ipa::LscTable::parseLscData ( const ValueNode & sets,
const LscDescriptor & descriptor )
overridevirtual

Parse tabular LSC data.

Parameters
[in]setsThe tuning file content
[in]descriptorThe LSC engine descriptor

Parse the LSC data in tabular form from the sets tuning data.

Todo
Currently the gain values parsed from tuning file are expressed in the platform fixed-point register format. Use gains in floating point representation for tabular LSC data in order to facilitate re-use of LSC tuning data across different platforms.
Returns
0 on success or a negative error number otherwise

Implements libcamera::ipa::LscImplementation.

◆ sampleForCrop()

LscImplementation::ComponentsMap libcamera::ipa::LscTable::sampleForCrop ( const Rectangle & cropRectangle,
std::span< const double > xPos,
std::span< const double > yPos )
inlineoverridevirtual

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.

Implements libcamera::ipa::LscImplementation.


The documentation for this class was generated from the following files:
  • src/ipa/libipa/lsc_table.h
  • src/ipa/libipa/lsc_table.cpp