30 class SensorConfiguration;
34 struct IPACameraSensorInfo;
41 virtual const std::string &
model()
const = 0;
42 virtual const std::string &
id()
const = 0;
49 virtual const std::vector<unsigned int> &
mbusCodes()
const = 0;
50 virtual std::vector<Size>
sizes(
unsigned int mbusCode)
const = 0;
55 const Size &size)
const = 0;
73 virtual const std::vector<controls::draft::TestPatternModeEnum> &
86 const std::string &
name()
const {
return name_; }
92 static std::vector<CameraSensorFactoryBase *> &factories();
96 virtual std::variant<std::unique_ptr<CameraSensor>,
int>
103 template<
typename _CameraSensor>
113 std::variant<std::unique_ptr<CameraSensor>,
int>
116 return _CameraSensor::match(entity);
120 #define REGISTER_CAMERA_SENSOR(sensor, priority) \ 121 static CameraSensorFactory<sensor> global_##sensor##Factory{ #sensor, priority }; Utilities to help constructing class interfaces.
virtual std::vector< Size > sizes(unsigned int mbusCode) const =0
Retrieve the supported frame sizes for a media bus code.
Report the image sensor characteristics.
Definition: core_ipa_interface.h:28
virtual V4L2SubdeviceFormat getFormat(const std::vector< unsigned int > &mbusCodes, const Size &size) const =0
Retrieve the best sensor format for a desired output.
Image orientation definition.
virtual const MediaEntity * entity() const =0
Retrieve the sensor media entity.
Camera controls identifiers.
Top-level libcamera namespace.
Definition: backtrace.h:17
virtual const ControlInfoMap & controls() const =0
Retrieve the supported V4L2 controls and their information.
virtual ~CameraSensor()
Destroy a CameraSensor.
Base class for camera sensor factories.
Definition: camera_sensor.h:78
Describe a two-dimensional size.
Definition: geometry.h:52
Transform
Enum to represent a 2D plane transform.
Definition: transform.h:14
int priority() const
Retrieve the priority value for the factory.
Definition: camera_sensor.h:87
virtual const std::vector< controls::draft::TestPatternModeEnum > & testPatternModes() const =0
Retrieve all the supported test pattern modes of the camera sensor The test pattern mode values corre...
virtual int tryFormat(V4L2SubdeviceFormat *format) const =0
Try the sensor output format.
Orientation
The image orientation in a memory buffer.
Definition: orientation.h:14
virtual BayerFormat::Order bayerOrder(Transform t) const =0
Compute the Bayer order that results from the given Transform.
virtual int setFormat(V4L2SubdeviceFormat *format, Transform transform=Transform::Identity)=0
Set the sensor output format.
A map of ControlId to ControlInfo.
Definition: controls.h:336
CameraSensorFactory(const char *name, int priority)
Construct a camera sensor factory.
Definition: camera_sensor.h:107
Registration of CameraSensorFactory classes and creation of instances.
Definition: camera_sensor.h:104
virtual Transform computeTransform(Orientation *orientation) const =0
Compute the Transform that gives the requested orientation.
A abstract camera sensor.
Definition: camera_sensor.h:36
virtual V4L2Subdevice * device()=0
Retrieve the camera sensor device.
#define LIBCAMERA_DISABLE_COPY_AND_MOVE(klass)
Disable copy and move construction and assignment of the klass.
virtual const std::string & model() const =0
Retrieve the sensor model name.
virtual int applyConfiguration(const SensorConfiguration &config, Transform transform=Transform::Identity, V4L2SubdeviceFormat *sensorFormat=nullptr)=0
Apply a sensor configuration to the camera sensor.
virtual int setControls(ControlList *ctrls)=0
Write V4L2 controls to the sensor.
TestPatternModeEnum
Supported TestPatternMode values.
Definition: control_ids.h:313
virtual ControlList getControls(const std::vector< uint32_t > &ids)=0
Read V4L2 controls from the sensor.
virtual int sensorInfo(IPACameraSensorInfo *info) const =0
Assemble and return the camera sensor info.
virtual const std::string & id() const =0
Retrieve the sensor ID.
A camera lens based on V4L2 subdevices.
Definition: camera_lens.h:22
const std::string & name() const
Retrieve the camera sensor factory name.
Definition: camera_sensor.h:86
Associate a list of ControlId with their values for an object.
Definition: controls.h:380
virtual const std::vector< unsigned int > & mbusCodes() const =0
Retrieve the media bus codes supported by the camera sensor.
Framework to manage controls related to an object.
virtual const ControlList & properties() const =0
Retrieve the camera sensor properties.
virtual int setTestPatternMode(controls::draft::TestPatternModeEnum mode)=0
Set the test pattern mode for the camera sensor.
Data structures related to geometric objects.
Camera sensor configuration.
Definition: camera.h:35
virtual Size resolution() const =0
Retrieve the camera sensor resolution.
virtual CameraLens * focusLens()=0
Retrieve the focus lens controller.
A V4L2 subdevice as exposed by the Linux kernel.
Definition: v4l2_subdevice.h:73