Loading...
Searching...
No Matches
camera_lens.h
Go to the documentation of this file.
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
* Copyright (C) 2021, Google Inc.
*
* A camera lens controller
*/
#pragma once
#include <memory>
#include <stdint.h>
#include <string>
#include <libcamera/base/class.h>
#include <libcamera/base/log.h>
#include <libcamera/controls.h>
namespace libcamera {
class MediaEntity;
class V4L2Subdevice;
class CameraLens : protected Loggable
{
public:
explicit CameraLens(const MediaEntity *entity);
~CameraLens();
int init();
int setFocusPosition(int32_t position);
const std::string &model() const { return model_; }
const ControlInfoMap &controls() const;
protected:
std::string logPrefix() const override;
private:
LIBCAMERA_DISABLE_COPY_AND_MOVE(CameraLens)
int validateLensDriver();
const MediaEntity *entity_;
std::unique_ptr<V4L2Subdevice> subdev_;
std::string model_;
};
} /* 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:24
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:32
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:365
libcamera::Loggable
Base class to support log message extensions.
Definition log.h:92
libcamera::MediaEntity
The MediaEntity represents an entity in the media graph.
Definition media_object.h:97
libcamera::V4L2Subdevice
A V4L2 subdevice as exposed by the Linux kernel.
Definition v4l2_subdevice.h:76
controls.h
Framework to manage controls related to an object.
log.h
Logging infrastructure.
libcamera
Top-level libcamera namespace.
Definition backtrace.h:17