libcamera v0.7.2+rpt20261009
Supporting cameras in Linux since 2019
Loading...
Searching...
No Matches
libcamera::ipa::ipu3::algorithms::ToneMapping Class Reference

A class to handle tone mapping based on gamma. More...

Inheritance diagram for libcamera::ipa::ipu3::algorithms::ToneMapping:
Collaboration diagram for libcamera::ipa::ipu3::algorithms::ToneMapping:

Public Member Functions

int init (IPAContext &context, const ValueNode &tuningData) override
 Initialize the Algorithm with tuning data.
 
int configure (IPAContext &context, const IPAConfigInfo &configInfo) override
 Configure the tone mapping given a configInfo.
 
void queueRequest (IPAContext &context, const uint32_t frame, IPAFrameContext &frameContext, const ControlList &controls) override
 Provide control values to the algorithm.
 
void prepare (IPAContext &context, const uint32_t frame, IPAFrameContext &frameContext, ipu3_uapi_params *params) override
 Fill in the parameter structure, and enable gamma control.
 
void process (IPAContext &context, const uint32_t frame, IPAFrameContext &frameContext, const ipu3_uapi_stats_3a *stats, ControlList &metadata) override
 Calculate the tone mapping look up table.
 
- Public Member Functions inherited from libcamera::ipa::Algorithm< _Module >
virtual int init (typename Module::Context &context, const ValueNode &tuningData)
 Initialize the Algorithm with tuning data.
 
virtual int configure (typename Module::Context &context, const typename Module::Config &configInfo)
 Configure the Algorithm given an IPAConfigInfo.
 
virtual void queueRequest (typename Module::Context &context, const uint32_t frame, typename Module::FrameContext &frameContext, const ControlList &controls)
 Provide control values to the algorithm.
 
virtual void prepare (typename Module::Context &context, const uint32_t frame, typename Module::FrameContext &frameContext, typename Module::Params *params)
 Fill the params buffer with ISP processing parameters for a frame.
 
virtual void process (typename Module::Context &context, const uint32_t frame, typename Module::FrameContext &frameContext, const typename Module::Stats *stats, ControlList &metadata)
 Process ISP statistics, and run algorithm operations.
 

Additional Inherited Members

- Public Types inherited from libcamera::ipa::Algorithm< _Module >
using Module = _Module
 The IPA module type for this class of algorithms.
 

Detailed Description

A class to handle tone mapping based on gamma.

This algorithm improves the image dynamic using a look-up table which is generated based on a gamma parameter.

Member Function Documentation

◆ configure()

int libcamera::ipa::ipu3::algorithms::ToneMapping::configure ( IPAContext &  context,
const IPAConfigInfo &  configInfo 
)
override

Configure the tone mapping given a configInfo.

Parameters
[in]contextThe shared IPA context
[in]configInfoThe IPA configuration data
Returns
0

◆ init()

int libcamera::ipa::ipu3::algorithms::ToneMapping::init ( IPAContext &  context,
const ValueNode &  tuningData 
)
override

Initialize the Algorithm with tuning data.

Parameters
[in]contextThe shared IPA context
[in]tuningDataThe tuning data for the algorithm

This function is called once, when the IPA module is initialized, to initialize the algorithm. The tuningData ValueNode contains the tuning data for algorithm.

Returns
0 if successful, an error code otherwise

◆ prepare()

void libcamera::ipa::ipu3::algorithms::ToneMapping::prepare ( IPAContext &  context,
const uint32_t  frame,
IPAFrameContext &  frameContext,
ipu3_uapi_params *  params 
)
override

Fill in the parameter structure, and enable gamma control.

Parameters
[in]contextThe shared IPA context
[in]frameThe frame context sequence number
[in]frameContextThe FrameContext for this frame
[out]paramsThe IPU3 parameters

Populate the IPU3 parameter structure with our tone mapping look up table and enable the gamma control module in the processing blocks.

◆ process()

void libcamera::ipa::ipu3::algorithms::ToneMapping::process ( IPAContext &  context,
const uint32_t  frame,
IPAFrameContext &  frameContext,
const ipu3_uapi_stats_3a *  stats,
ControlList &  metadata 
)
override

Calculate the tone mapping look up table.

Parameters
[in]contextThe shared IPA context
[in]frameThe current frame sequence number
[in]frameContextThe current frame context
[in]statsThe IPU3 statistics and ISP results
[out]metadataMetadata for the frame, to be filled by the algorithm

The tone mapping look up table is generated as an inverse power curve from our gamma setting.

◆ queueRequest()

void libcamera::ipa::ipu3::algorithms::ToneMapping::queueRequest ( IPAContext &  context,
const uint32_t  frame,
IPAFrameContext &  frameContext,
const ControlList &  controls 
)
override

Provide control values to the algorithm.

Parameters
[in]contextThe shared IPA context
[in]frameThe frame number to apply the control values
[in]frameContextThe current frame's context
[in]controlsThe list of user controls

This function is called for each request queued to the camera. It provides the controls stored in the request to the algorithm. The frame number is the Request sequence number and identifies the desired corresponding frame to target for the controls to take effect.

Algorithms shall read the applicable controls and store their value for later use during frame processing.


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