[libcamera-devel,RFC,4/4] libcamera: lens: Add the hyperfocale property support
diff mbox series

Message ID 20220609060306.57953-5-jeanmichel.hautbois@ideasonboard.com
State New
Headers show
Series
  • Introduce camera lens properties
Related show

Commit Message

Jean-Michel Hautbois June 9, 2022, 6:03 a.m. UTC
A tuned lens may have measured its hyperfocale, which can then be used
by the controls::LensPosition control. Add support for it in the camera
lens properties database.

Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
---
 include/libcamera/internal/camera_lens_properties.h | 1 +
 src/libcamera/camera_lens_properties.cpp            | 4 ++++
 2 files changed, 5 insertions(+)

Patch
diff mbox series

diff --git a/include/libcamera/internal/camera_lens_properties.h b/include/libcamera/internal/camera_lens_properties.h
index 7424b375..13fa025c 100644
--- a/include/libcamera/internal/camera_lens_properties.h
+++ b/include/libcamera/internal/camera_lens_properties.h
@@ -19,6 +19,7 @@  struct CameraLensProperties {
 	static const CameraLensProperties *get(const std::string &lens);
 
 	Size lensFocusRange;
+	float hyperfocal;
 };
 
 } /* namespace libcamera */
diff --git a/src/libcamera/camera_lens_properties.cpp b/src/libcamera/camera_lens_properties.cpp
index 225546ae..7cab2704 100644
--- a/src/libcamera/camera_lens_properties.cpp
+++ b/src/libcamera/camera_lens_properties.cpp
@@ -35,6 +35,9 @@  LOG_DEFINE_CATEGORY(CameraLensProperties)
  *
  * \var CameraLensProperties::lensFocusRange
  * \brief The limits for the sensor position, stored as a min and a max.
+ *
+ * \var CameraLensProperties::hyperfocal
+ * \brief The hyperfocal distance measured, expressed in millimeters
  */
 
 /**
@@ -48,6 +51,7 @@  const CameraLensProperties *CameraLensProperties::get(const std::string &lens)
 	static const std::map<std::string, const CameraLensProperties> lensProps = {
 		{ "dw9714", {
 				.lensFocusRange = { 150, 800 },
+				.hyperfocal = 500,
 		} },
 	};