libcamera v0.0.0+3423-a7ab5ef1
Supporting cameras in Linux since 2019
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
libcamera::ipa::CameraSensorHelperFactory Class Referenceabstract

Registration of CameraSensorHelperFactory classes and creation of instances. More...

Public Member Functions

 CameraSensorHelperFactory (const std::string name)
 Construct a camera sensor helper factory. More...
 

Static Public Member Functions

static std::unique_ptr< CameraSensorHelpercreate (const std::string &name)
 Create an instance of the CameraSensorHelper corresponding to a named factory. More...
 
static void registerType (CameraSensorHelperFactory *factory)
 Add a camera sensor helper class to the registry. More...
 
static std::vector< CameraSensorHelperFactory * > & factories ()
 Retrieve the list of all camera sensor helper factories. More...
 

Protected Member Functions

virtual CameraSensorHelpercreateInstance ()=0
 Create an instance of the CameraSensorHelper corresponding to the factory. More...
 

Detailed Description

Registration of CameraSensorHelperFactory classes and creation of instances.

To facilitate discovery and instantiation of CameraSensorHelper classes, the CameraSensorHelperFactory class maintains a registry of camera sensor helper sub-classes. Each CameraSensorHelper subclass shall register itself using the REGISTER_CAMERA_SENSOR_HELPER() macro, which will create a corresponding instance of a CameraSensorHelperFactory subclass and register it with the static list of factories.

Constructor & Destructor Documentation

◆ CameraSensorHelperFactory()

libcamera::ipa::CameraSensorHelperFactory::CameraSensorHelperFactory ( const std::string  name)

Construct a camera sensor helper factory.

Parameters
[in]nameName of the camera sensor helper class

Creating an instance of the factory registers it with the global list of factories, accessible through the factories() function.

The factory name is used for debug purpose and shall be unique.

Member Function Documentation

◆ create()

std::unique_ptr< CameraSensorHelper > libcamera::ipa::CameraSensorHelperFactory::create ( const std::string &  name)
static

Create an instance of the CameraSensorHelper corresponding to a named factory.

Parameters
[in]nameName of the factory
Returns
A unique pointer to a new instance of the CameraSensorHelper subclass corresponding to the named factory or a null pointer if no such factory exists

◆ createInstance()

libcamera::ipa::CameraSensorHelperFactory::createInstance ( )
protectedpure virtual

Create an instance of the CameraSensorHelper corresponding to the factory.

This virtual function is implemented by the REGISTER_CAMERA_SENSOR_HELPER() macro. It creates a camera sensor helper instance associated with the camera sensor model.

Returns
A pointer to a newly constructed instance of the CameraSensorHelper subclass corresponding to the factory

◆ factories()

std::vector< CameraSensorHelperFactory * > & libcamera::ipa::CameraSensorHelperFactory::factories ( )
static

Retrieve the list of all camera sensor helper factories.

Returns
The list of camera sensor helper factories

◆ registerType()

void libcamera::ipa::CameraSensorHelperFactory::registerType ( CameraSensorHelperFactory factory)
static

Add a camera sensor helper class to the registry.

Parameters
[in]factoryFactory to use to construct the camera sensor helper

The caller is responsible to guarantee the uniqueness of the camera sensor helper name.


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