libcamera v0.3.2 Supporting cameras in Linux since 2019

Loading...
Searching...
No Matches
camera_lens.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: LGPL-2.1-or-later */
2/*
3 * Copyright (C) 2021, Google Inc.
4 *
5 * A camera lens controller
6 */
7#pragma once
8
9#include <memory>
10#include <string>
11
12#include <libcamera/base/class.h>
13#include <libcamera/base/log.h>
14
15#include <libcamera/controls.h>
16
17 namespace libcamera {
18
19 class MediaEntity;
20 class V4L2Subdevice;
21
22 class CameraLens : protected Loggable
23{
24 public:
25 explicit CameraLens(const MediaEntity *entity);
26 ~CameraLens();
27
28 int init();
29 int setFocusPosition(int32_t position);
30
31 const std::string &model() const { return model_; }
32
33 const ControlInfoMap &controls() const;
34
35 protected:
36 std::string logPrefix() const override;
37
38 private:
39 LIBCAMERA_DISABLE_COPY_AND_MOVE(CameraLens)
40
41 int validateLensDriver();
42
43 const MediaEntity *entity_;
44 std::unique_ptr<V4L2Subdevice> subdev_;
45
46 std::string model_;
47};
48
49} /* namespace libcamera */
class.h
Utilities to help constructing class interfaces.
LIBCAMERA_DISABLE_COPY_AND_MOVE
#define LIBCAMERA_DISABLE_COPY_AND_MOVE(klass)
Disable copy and move construction and assignment of the klass.
Definition class.h:29
libcamera::CameraLens
A camera lens based on V4L2 subdevices.
Definition camera_lens.h:23
libcamera::CameraLens::CameraLens
CameraLens(const MediaEntity *entity)
Construct a CameraLens.
Definition camera_lens.cpp:38
libcamera::CameraLens::model
const std::string & model() const
Retrieve the lens model name.
Definition camera_lens.h:31
libcamera::CameraLens::setFocusPosition
int setFocusPosition(int32_t position)
This function sets the focal point of the lens to a specific position.
Definition camera_lens.cpp:87
libcamera::CameraLens::logPrefix
std::string logPrefix() const override
Retrieve a string to be prefixed to the log message.
Definition camera_lens.cpp:137
libcamera::CameraLens::init
int init()
Initialize the camera lens instance.
Definition camera_lens.cpp:56
libcamera::CameraLens::~CameraLens
~CameraLens()
Destroy a CameraLens.
libcamera::CameraLens::controls
const ControlInfoMap & controls() const
Retrieve the V4L2 controls of the lens' subdev.
Definition camera_lens.cpp:148
libcamera::ControlInfoMap
A map of ControlId to ControlInfo.
Definition controls.h:306
libcamera::Loggable
Base class to support log message extensions.
Definition log.h:91
libcamera::MediaEntity
The MediaEntity represents an entity in the media graph.
Definition media_object.h:97
controls.h
Framework to manage controls related to an object.
log.h
Logging infrastructure.
libcamera
Top-level libcamera namespace.
Definition backtrace.h:17