libcamera  v0.2.0+135-3cb20bc2
Supporting cameras in Linux since 2019
Public Member Functions | Protected Member Functions | List of all members
libcamera::CameraLens Class Reference

A camera lens based on V4L2 subdevices. More...

Inheritance diagram for libcamera::CameraLens:
Inheritance graph
[legend]
Collaboration diagram for libcamera::CameraLens:
Collaboration graph
[legend]

Public Member Functions

 CameraLens (const MediaEntity *entity)
 Construct a CameraLens. More...
 
 ~CameraLens ()
 Destroy a CameraLens.
 
int init ()
 Initialize the camera lens instance. More...
 
int setFocusPosition (int32_t position)
 This function sets the focal point of the lens to a specific position. More...
 
const std::string & model () const
 Retrieve the lens model name. More...
 
const ControlInfoMapcontrols () const
 Retrieve the V4L2 controls of the lens' subdev. More...
 

Protected Member Functions

std::string logPrefix () const override
 Retrieve a string to be prefixed to the log message. More...
 
- Protected Member Functions inherited from libcamera::Loggable
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

A camera lens based on V4L2 subdevices.

The CameraLens class eases handling of lens for pipeline handlers by hiding the details of the V4L2 subdevice kernel API and caching lens information.

Constructor & Destructor Documentation

◆ CameraLens()

libcamera::CameraLens::CameraLens ( const MediaEntity entity)
explicit

Construct a CameraLens.

Parameters
[in]entityThe media entity backing the camera lens controller

Once constructed the instance must be initialized with init().

Member Function Documentation

◆ controls()

const ControlInfoMap & libcamera::CameraLens::controls ( ) const

Retrieve the V4L2 controls of the lens' subdev.

Returns
A map of the V4L2 controls supported by the lens' driver

◆ init()

int libcamera::CameraLens::init ( )

Initialize the camera lens instance.

This function performs the initialisation steps of the CameraLens that may fail. It shall be called once and only once after constructing the instance.

Returns
0 on success or a negative error code otherwise

◆ logPrefix()

std::string libcamera::CameraLens::logPrefix ( ) const
overrideprotectedvirtual

Retrieve a string to be prefixed to the log message.

This function allows classes inheriting from the Loggable class to extend the logger with an object-specific prefix output right before the log message contents.

Returns
A string to be prefixed to the log message

Implements libcamera::Loggable.

◆ model()

libcamera::CameraLens::model ( ) const
inline

Retrieve the lens model name.

The lens model name is a free-formed string that uniquely identifies the lens model.

Returns
The lens model name

◆ setFocusPosition()

int libcamera::CameraLens::setFocusPosition ( int32_t  position)

This function sets the focal point of the lens to a specific position.

Parameters
[in]positionThe focal point of the lens

This function sets the value of focal point of the lens as in position.

Returns
0 on success or -EINVAL otherwise

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