@@ -10,6 +10,7 @@
#pragma once
+#include <array>
#include <stdint.h>
#include "libcamera/internal/matrix.h"
@@ -25,6 +26,17 @@ struct DebayerParams {
float gamma = 1.0;
float contrastExp = 1.0;
RGB<double> gains = RGB<double>({ 1.0, 1.0, 1.0 });
+
+ /**
+ * To prevent OpenGL alignment issues, the number of bytes in each row
+ * should be a multiple of 4.
+ **/
+ static constexpr unsigned int kLscGridSize = 17;
+ static constexpr unsigned int kLscValuesPerCell = 4;
+ using LscLookupTable =
+ std::array<uint8_t, kLscGridSize * kLscGridSize * kLscValuesPerCell>;
+ LscLookupTable lscLut{};
+ uint64_t lscLutVersion = 0;
};
} /* namespace libcamera */
@@ -43,6 +43,34 @@ namespace libcamera {
* \brief Contrast value to be used as an exponent
*/
+/**
+ * \var DebayerParams::kLscGridSize
+ * \brief Number of lens shading grid areas in one direction
+ */
+
+/**
+ * \var DebayerParams::kLscValuesPerCell
+ * \brief Number of pixel values per each of the lens shading grid areas
+ */
+
+/**
+ * \typedef DebayerParams::LscLookupTable
+ * \brief Lookup table for lens shading correction
+ *
+ * It's an array of values to be later used as a texture.
+ * The values are in row - column - RGB order.
+ */
+
+/**
+ * \var DebayerParams::lscLut
+ * \brief Lens shading lookup table
+ */
+
+/**
+ * \var DebayerParams::lscLutVersion
+ * \brief Incremented on each \a lscLut change
+ */
+
/**
* \class Debayer
* \brief Base debayering class