@@ -7,6 +7,7 @@
#pragma once
+#include <array>
#include <map>
#include <string>
@@ -20,6 +21,7 @@ struct CameraSensorProperties {
Size unitCellSize;
std::map<controls::draft::TestPatternModeEnum, int32_t> testPatternModes;
+ std::array<int32_t, 4> blackLevels;
};
} /* namespace libcamera */
@@ -306,6 +306,7 @@ void CameraSensor::initStaticProperties()
/* Register the properties retrieved from the sensor database. */
properties_.set(properties::UnitCellSize, staticProps_->unitCellSize);
+ properties_.set(properties::SensorFixedBlackLevels, staticProps_->blackLevels);
initTestPatternModes();
}
@@ -41,6 +41,11 @@ LOG_DEFINE_CATEGORY(CameraSensorProperties)
* \brief Map that associates the TestPattern control value with the indexes of
* the corresponding sensor test pattern modes as returned by
* V4L2_CID_TEST_PATTERN.
+ *
+ * \var CameraSensorProperties::blackLevels
+ * \brief Fixed black level offset for each of the four color filter
+ * arrangement (CFA) mosaic channels, specified in the same order as the order
+ * of color filters.
*/
/**
@@ -69,6 +74,7 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen
* 9: "Resolution Pattern"
*/
},
+ .blackLevels = {},
} },
{ "imx219", {
.unitCellSize = { 1120, 1120 },
@@ -79,6 +85,7 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen
{ controls::draft::TestPatternModeColorBarsFadeToGray, 3 },
{ controls::draft::TestPatternModePn9, 4 },
},
+ .blackLevels = {},
} },
{ "imx258", {
.unitCellSize = { 1120, 1120 },
@@ -89,10 +96,12 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen
{ controls::draft::TestPatternModeColorBarsFadeToGray, 3 },
{ controls::draft::TestPatternModePn9, 4 },
},
+ .blackLevels = {},
} },
{ "ov5647", {
.unitCellSize = { 1400, 1400 },
.testPatternModes = {},
+ .blackLevels = {},
} },
{ "ov5670", {
.unitCellSize = { 1120, 1120 },
@@ -100,6 +109,7 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen
{ controls::draft::TestPatternModeOff, 0 },
{ controls::draft::TestPatternModeColorBars, 1 },
},
+ .blackLevels = {},
} },
{ "ov5693", {
.unitCellSize = { 1400, 1400 },
@@ -112,6 +122,7 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen
* Rolling Bar".
*/
},
+ .blackLevels = {},
} },
{ "ov8865", {
.unitCellSize = { 1400, 1400 },
@@ -126,6 +137,7 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen
* 5: "Color squares with rolling bar"
*/
},
+ .blackLevels = {},
} },
{ "ov13858", {
.unitCellSize = { 1120, 1120 },
@@ -133,6 +145,7 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen
{ controls::draft::TestPatternModeOff, 0 },
{ controls::draft::TestPatternModeColorBars, 1 },
},
+ .blackLevels = {},
} },
};
Add an entry to the sensor database for the static black levels. As these are approximate static values for the black levels, they can reasonably be tied to the sensor model. Thus add it to the sensor database. Bug: https://bugs.libcamera.org/show_bug.cgi?id=48 Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> --- .../libcamera/internal/camera_sensor_properties.h | 2 ++ src/libcamera/camera_sensor.cpp | 1 + src/libcamera/camera_sensor_properties.cpp | 13 +++++++++++++ 3 files changed, 16 insertions(+)