33 class SensorConfiguration;
35 struct CameraSensorProperties;
47 const std::string &
model()
const {
return model_; }
48 const std::string &
id()
const {
return id_; }
55 const std::vector<unsigned int> &
mbusCodes()
const {
return mbusCodes_; }
56 std::vector<Size>
sizes(
unsigned int mbusCode)
const;
60 const Size &size)
const;
80 return testPatternModes_;
91 int validateSensorDriver();
92 void initVimcDefaultProperties();
93 void initStaticProperties();
94 void initTestPatternModes();
96 int discoverAncillaryDevices();
100 std::unique_ptr<V4L2Subdevice> subdev_;
109 std::vector<unsigned int> mbusCodes_;
110 std::vector<Size> sizes_;
111 std::vector<controls::draft::TestPatternModeEnum> testPatternModes_;
114 Size pixelArraySize_;
118 bool flipsAlterBayerOrder_;
123 std::unique_ptr<CameraLens> focusLens_;
Utilities to help constructing class interfaces.
Report the image sensor characteristics.
Definition: core_ipa_interface.h:23
const std::vector< unsigned int > & mbusCodes() const
Retrieve the media bus codes supported by the camera sensor.
Definition: camera_sensor.h:55
Image orientation definition.
const std::string & model() const
Retrieve the sensor model name.
Definition: camera_sensor.h:47
Base class to support log message extensions.
Definition: log.h:91
Camera control identifiers.
Top-level libcamera namespace.
Definition: backtrace.h:17
const ControlInfoMap & controls() const
Retrieve the supported V4L2 controls and their information.
Definition: camera_sensor.cpp:1086
std::string logPrefix() const override
Retrieve a string to be prefixed to the log message.
Definition: camera_sensor.cpp:1202
CameraSensor(const MediaEntity *entity)
Construct a CameraSensor.
Definition: camera_sensor.cpp:58
~CameraSensor()
Destroy a CameraSensor.
Definition: camera_sensor.cpp:68
std::vector< Size > sizes(unsigned int mbusCode) const
Retrieve the supported frame sizes for a media bus code.
Definition: camera_sensor.cpp:631
BayerFormat::Order bayerOrder(Transform t) const
Compute the Bayer order that results from the given Transform.
Definition: camera_sensor.cpp:1061
Describe a two-dimensional size.
Definition: geometry.h:52
Transform
Enum to represent a 2D plane transform.
Definition: transform.h:16
std::map< unsigned int, std::vector< SizeRange > > Formats
A map of supported media bus formats to frame sizes.
Definition: v4l2_subdevice.h:76
ControlList getControls(const std::vector< uint32_t > &ids)
Read V4L2 controls from the sensor.
Definition: camera_sensor.cpp:1109
const ControlList & properties() const
Retrieve the camera sensor properties.
Definition: camera_sensor.h:69
const std::string & id() const
Retrieve the sensor ID.
Definition: camera_sensor.h:48
Orientation
The image orientation in a memory buffer.
Definition: orientation.h:14
A map of ControlId to ControlInfo.
Definition: controls.h:305
int setFormat(V4L2SubdeviceFormat *format, Transform transform=Transform::Identity)
Set the sensor output format.
Definition: camera_sensor.cpp:769
#define LIBCAMERA_DISABLE_COPY(klass)
Disable copy construction and assignment of the klass.
int applyConfiguration(const SensorConfiguration &config, Transform transform=Transform::Identity, V4L2SubdeviceFormat *sensorFormat=nullptr)
Apply a sensor configuration to the camera sensor.
Definition: camera_sensor.cpp:826
libcamera structs for IPAs
Describe a rectangle's position and dimensions.
Definition: geometry.h:242
const std::vector< controls::draft::TestPatternModeEnum > & testPatternModes() const
Retrieve all the supported test pattern modes of the camera sensor The test pattern mode values corre...
Definition: camera_sensor.h:78
A camera sensor based on V4L2 subdevices.
Definition: camera_sensor.h:39
int sensorInfo(IPACameraSensorInfo *info) const
Assemble and return the camera sensor info.
Definition: camera_sensor.cpp:915
V4L2Subdevice * device()
Retrieve the camera sensor device.
Definition: camera_sensor.h:51
Size resolution() const
Retrieve the camera sensor resolution.
Definition: camera_sensor.cpp:661
V4L2SubdeviceFormat getFormat(const std::vector< unsigned int > &mbusCodes, const Size &size) const
Retrieve the best sensor format for a desired output.
Definition: camera_sensor.cpp:702
int setControls(ControlList *ctrls)
Write V4L2 controls to the sensor.
Definition: camera_sensor.cpp:1139
int init()
Initialize the camera sensor instance.
Definition: camera_sensor.cpp:80
CameraLens * focusLens()
Retrieve the focus lens controller.
Definition: camera_sensor.h:53
int tryFormat(V4L2SubdeviceFormat *format) const
Try the sensor output format.
Definition: camera_sensor.cpp:805
const MediaEntity * entity() const
Retrieve the sensor media entity.
Definition: camera_sensor.h:50
TestPatternModeEnum
Supported TestPatternMode values.
Definition: control_ids.h:303
Transform computeTransform(Orientation *orientation) const
Compute the Transform that gives the requested orientation.
Definition: camera_sensor.cpp:1016
A camera lens based on V4L2 subdevices.
Definition: camera_lens.h:22
Database of camera sensor properties.
Definition: camera_sensor_properties.h:18
Associate a list of ControlId with their values for an object.
Definition: controls.h:349
Framework to manage controls related to an object.
Data structures related to geometric objects.
Camera sensor configuration.
Definition: camera.h:35
int setTestPatternMode(controls::draft::TestPatternModeEnum mode)
Set the test pattern mode for the camera sensor.
Definition: camera_sensor.cpp:1160
A V4L2 subdevice as exposed by the Linux kernel.
Definition: v4l2_subdevice.h:73