libcamera v0.7.2 Supporting cameras in Linux since 2019

Loading...
Searching...
No Matches
libcamera::ipa::Module< _Context, _FrameContext, _Config, _Params, _Stats > Class Template Reference

The base class for all IPA modules. More...

Inheritance diagram for libcamera::ipa::Module< _Context, _FrameContext, _Config, _Params, _Stats >:
[legend]
Collaboration diagram for libcamera::ipa::Module< _Context, _FrameContext, _Config, _Params, _Stats >:
[legend]

## Public Types
using | Context = _Context
| The type of the shared IPA context.
using | FrameContext = _FrameContext
| The type of the frame context.
using | Config = _Config
| The type of the IPA configuration data.
using | Params = _Params
| The type of the ISP specific parameters.
using | Stats = _Stats
| The type of the IPA statistics and ISP results.

## Public Member Functions
const std::list< std::unique_ptr< Algorithm< Module > > > & | algorithms () const
| Retrieve the list of instantiated algorithms.
int | createAlgorithms (Context &context, const ValueNode &algorithms)
| Create algorithms from tuning data.

## Static Public Member Functions
static void | registerAlgorithm (AlgorithmFactoryBase< Module > *factory)
| Add an algorithm factory class to the list of available algorithms.

## Additional Inherited Members
Protected Member Functions inherited from libcamera::Loggable
virtual std::string | logPrefix () const =0
| Retrieve a string to be prefixed to the log message.
LogMessage | _log (const LogCategory &category, LogSeverity severity, const char *fileName=__builtin_FILE(), unsigned int line=__builtin_LINE()) const
| Create a temporary LogMessage object to log a message.

## Detailed Description

template<typename _Context, typename _FrameContext, typename _Config, typename _Params, typename _Stats>
class libcamera::ipa::Module< _Context, _FrameContext, _Config, _Params, _Stats >

The base class for all IPA modules.

Template Parameters

  Context | The type of the shared IPA context
  FrameContext | The type of the frame context
  Config | The type of the IPA configuration data
  Params | The type of the ISP specific parameters
  Stats | The type of the IPA statistics and ISP results

The Module class template defines a standard internal interface between IPA modules and libipa.

While IPA modules are platform-specific, many of their internal functions are conceptually similar, even if they take different types of platform-specifc parameters. For instance, IPA modules could share code that instantiates, initializes and run algorithms if it wasn't for the fact that the the format of ISP parameters or statistics passed to the related functions is device-dependent.

To enable a shared implementation of those common tasks in libipa, the Module class template defines a standard internal interface between IPA modules and libipa. The template parameters specify the types of module-dependent data. IPA modules shall create a specialization of the Module class template in their namespace, and use it to specialize other classes of libipa, such as the Algorithm class.

## Member Function Documentation

## ◆ algorithms()

template<typename _Context, typename _FrameContext, typename _Config, typename _Params, typename _Stats>

const std::list< std::unique_ptr< Algorithm< Module > > > & libcamera::ipa::Module< _Context, _FrameContext, _Config, _Params, _Stats >::algorithms | ( |  | ) | const
| inline

Retrieve the list of instantiated algorithms.

Returns
  The list of instantiated algorithms

## ◆ createAlgorithms()

template<typename _Context, typename _FrameContext, typename _Config, typename _Params, typename _Stats>

int libcamera::ipa::Module< _Context, _FrameContext, _Config, _Params, _Stats >::createAlgorithms | ( | Context & | context,
|  | const ValueNode & | algorithms )
| inline

Create algorithms from tuning data.

Parameters

  [in] | context | The IPA context
  [in] | algorithms | Algorithms configuration data as a parsed ValueNode

This function iterates over the list of algorithms parsed from the tuning data, and instantiates and initializes the corresponding algorithms. The configuration data is expected to be correct, any error causes the function to fail and return immediately.

Algorithms can optionally be disabled via the tuning file of the camera module as shown here, with AGC being used as an example:

- Agc: enabled: false

If this is the case, the algorithm will not be instantiated.

Returns
  0 on success, or a negative error code on failure

## ◆ registerAlgorithm()

template<typename _Context, typename _FrameContext, typename _Config, typename _Params, typename _Stats>

void libcamera::ipa::Module< _Context, _FrameContext, _Config, _Params, _Stats >::registerAlgorithm | ( | AlgorithmFactoryBase< Module< _Context, _FrameContext, _Config, _Params, _Stats > > * | factory | ) |
| inline static

Add an algorithm factory class to the list of available algorithms.

Parameters

  [in] | factory | Factory to use to construct the algorithm

This function registers an algorithm factory. It is meant to be called by the AlgorithmFactory constructor only.

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

- src/ipa/libipa/module.h
- src/ipa/libipa/module.cpp