libcamera: libcamera::CameraLens Class Reference

libcamera v0.0.4 Supporting cameras in Linux since 2019

Loading...
Searching...
No Matches
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:
[legend]
Collaboration diagram for libcamera::CameraLens:
[legend]

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

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

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] | entity | The 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] | position | The 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:

- include/libcamera/internal/camera_lens.h
- src/libcamera/camera_lens.cpp