summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2024-02-09 12:05:43 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2024-03-15 13:00:58 +0200
commit2a6d4324570a3e9803067ec674d20cd0a8e25863 (patch)
tree827af7ad324a5a05d7de5615c43536d5aa34f175 /include
parent9b1a2a8c8b89b2c56afc155c67c78baefee19d28 (diff)
libcamera: camera_sensor: Reorder functions
The CameraSensor class has grown a lot since its creation, with many functions added for different types of purposes. They are not grouped by categories in the class definition, generating confusion when reading the header file. Improve readability by sorting functions by category: - Getters for static data (model, entity, focus lens, ...) - Format and sensor configuration accessors - Properties and controls (including test pattern mode) Update the .cpp file accordingly. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
Diffstat (limited to 'include')
-rw-r--r--include/libcamera/internal/camera_sensor.h29
1 files changed, 15 insertions, 14 deletions
diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h
index b2f077b9..750d6d72 100644
--- a/include/libcamera/internal/camera_sensor.h
+++ b/include/libcamera/internal/camera_sensor.h
@@ -46,15 +46,15 @@ public:
const std::string &model() const { return model_; }
const std::string &id() const { return id_; }
+
const MediaEntity *entity() const { return entity_; }
+ V4L2Subdevice *device() { return subdev_.get(); }
+
+ CameraLens *focusLens() { return focusLens_.get(); }
+
const std::vector<unsigned int> &mbusCodes() const { return mbusCodes_; }
std::vector<Size> sizes(unsigned int mbusCode) const;
Size resolution() const;
- const std::vector<controls::draft::TestPatternModeEnum> &testPatternModes() const
- {
- return testPatternModes_;
- }
- int setTestPatternMode(controls::draft::TestPatternModeEnum mode);
V4L2SubdeviceFormat getFormat(const std::vector<unsigned int> &mbusCodes,
const Size &size) const;
@@ -66,18 +66,19 @@ public:
Transform transform = Transform::Identity,
V4L2SubdeviceFormat *sensorFormat = nullptr);
- const ControlInfoMap &controls() const;
- ControlList getControls(const std::vector<uint32_t> &ids);
- int setControls(ControlList *ctrls);
-
- V4L2Subdevice *device() { return subdev_.get(); }
-
const ControlList &properties() const { return properties_; }
int sensorInfo(IPACameraSensorInfo *info) const;
+ Transform computeTransform(Orientation *orientation) const;
- CameraLens *focusLens() { return focusLens_.get(); }
+ const ControlInfoMap &controls() const;
+ ControlList getControls(const std::vector<uint32_t> &ids);
+ int setControls(ControlList *ctrls);
- Transform computeTransform(Orientation *orientation) const;
+ const std::vector<controls::draft::TestPatternModeEnum> &testPatternModes() const
+ {
+ return testPatternModes_;
+ }
+ int setTestPatternMode(controls::draft::TestPatternModeEnum mode);
protected:
std::string logPrefix() const override;
@@ -91,8 +92,8 @@ private:
void initStaticProperties();
void initTestPatternModes();
int initProperties();
- int applyTestPatternMode(controls::draft::TestPatternModeEnum mode);
int discoverAncillaryDevices();
+ int applyTestPatternMode(controls::draft::TestPatternModeEnum mode);
const MediaEntity *entity_;
std::unique_ptr<V4L2Subdevice> subdev_;