libcamera  v0.4.0
Supporting cameras in Linux since 2019
Public Types | Public Member Functions | Static Public Member Functions | List of all members
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 >:
Inheritance graph
[legend]
Collaboration diagram for libcamera::ipa::Module< _Context, _FrameContext, _Config, _Params, _Stats >:
Collaboration graph
[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. More...
 
int createAlgorithms (Context &context, const YamlObject &algorithms)
 Create algorithms from YAML configuration data. More...
 

Static Public Member Functions

static void registerAlgorithm (AlgorithmFactoryBase< Module > *factory)
 Add an algorithm factory class to the list of available algorithms. More...
 

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. More...
 
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. More...
 

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
ContextThe type of the shared IPA context
FrameContextThe type of the frame context
ConfigThe type of the IPA configuration data
ParamsThe type of the ISP specific parameters
StatsThe 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 >
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 >
libcamera::ipa::Module< _Context, _FrameContext, _Config, _Params, _Stats >::createAlgorithms ( Context context,
const YamlObject algorithms 
)
inline

Create algorithms from YAML configuration data.

Parameters
[in]contextThe IPA context
[in]algorithmsAlgorithms configuration data as a parsed YamlObject

This function iterates over the list of algorithms parsed from the YAML configuration file, 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.

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

◆ registerAlgorithm()

template<typename _Context , typename _FrameContext , typename _Config , typename _Params , typename _Stats >
libcamera::ipa::Module< _Context, _FrameContext, _Config, _Params, _Stats >::registerAlgorithm ( AlgorithmFactoryBase< Module< _Context, _FrameContext, _Config, _Params, _Stats > > *  factory)
inlinestatic

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

Parameters
[in]factoryFactory 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: