libcamera
v0.8.0
Supporting cameras in Linux since 2019
Toggle main menu visibility
Loading...
Searching...
No Matches
debayer_params.h
1
/* SPDX-License-Identifier: LGPL-2.1-or-later */
2
/*
3
* Copyright (C) 2023-2026 Red Hat Inc.
4
*
5
* Authors:
6
* Hans de Goede <hdegoede@redhat.com>
7
*
8
* DebayerParams header
9
*/
10
11
#pragma once
12
13
#include <array>
14
#include <stdint.h>
15
16
#include "
libcamera/internal/matrix.h
"
17
#include "
libcamera/internal/vector.h
"
18
19
namespace
libcamera
{
20
21
struct
DebayerParams
{
22
Matrix<float, 3, 3>
combinedMatrix
= { { 1.0, 0.0, 0.0,
23
0.0, 1.0, 0.0,
24
0.0, 0.0, 1.0 } };
25
RGB<double>
blackLevel
=
RGB<double>
({ 0.0, 0.0, 0.0 });
26
float
gamma
= 1.0;
27
float
contrastExp
= 1.0;
28
RGB<double>
gains
=
RGB<double>
({ 1.0, 1.0, 1.0 });
29
35
static
constexpr
unsigned
int
kLscGridSize
= 17;
36
static
constexpr
unsigned
int
kLscValuesPerCell
= 4;
37
static
constexpr
unsigned
int
kLscBytesPerCell
=
38
kLscValuesPerCell
*
sizeof
(uint8_t);
39
using
LscLookupTable
=
40
std::array<uint8_t, kLscGridSize * kLscGridSize * kLscValuesPerCell>;
41
static
constexpr
auto
identityLscLut
= [] {
42
LscLookupTable
lut = {};
43
/* lut.fill(64) could be used, but it fails with older gcc versions */
44
for
(
size_t
i = 0;
kLscValuesPerCell
* i < lut.size(); i++) {
45
lut[i *
kLscValuesPerCell
+ 0] = 64;
/* == UQ<2, 6>(1.0f).quantized() */
46
lut[i *
kLscValuesPerCell
+ 1] = 64;
47
lut[i *
kLscValuesPerCell
+ 2] = 64;
48
}
49
return
lut;
50
}();
51
alignas
(4)
LscLookupTable
lscLut
=
identityLscLut
;
52
uint64_t
lscLutVersion
= 0;
53
};
54
55
}
/* namespace libcamera */
libcamera::Matrix
Matrix class.
Definition
matrix.h:31
matrix.h
Matrix class.
libcamera
Top-level libcamera namespace.
Definition
backtrace.h:17
libcamera::RGB
Vector< T, 3 > RGB
A Vector of 3 elements representing an RGB pixel value.
Definition
vector.h:318
libcamera::DebayerParams
Struct to hold the debayer parameters.
Definition
debayer_params.h:21
libcamera::DebayerParams::blackLevel
RGB< double > blackLevel
Black level values.
Definition
debayer_params.h:25
libcamera::DebayerParams::kLscGridSize
static constexpr unsigned int kLscGridSize
Number of lens shading grid areas in one direction.
Definition
debayer_params.h:35
libcamera::DebayerParams::lscLutVersion
uint64_t lscLutVersion
Incremented on each lscLut change.
Definition
debayer_params.h:52
libcamera::DebayerParams::kLscBytesPerCell
static constexpr unsigned int kLscBytesPerCell
Number of bytes per each of the lens shading grid areas.
Definition
debayer_params.h:37
libcamera::DebayerParams::LscLookupTable
std::array< uint8_t, kLscGridSize *kLscGridSize *kLscValuesPerCell > LscLookupTable
Lookup table for lens shading correction.
Definition
debayer_params.h:39
libcamera::DebayerParams::gains
RGB< double > gains
Colour channel gains.
Definition
debayer_params.h:28
libcamera::DebayerParams::kLscValuesPerCell
static constexpr unsigned int kLscValuesPerCell
Number of pixel values per each of the lens shading grid areas.
Definition
debayer_params.h:36
libcamera::DebayerParams::gamma
float gamma
Gamma value, e.g. 1/2.2.
Definition
debayer_params.h:26
libcamera::DebayerParams::combinedMatrix
Matrix< float, 3, 3 > combinedMatrix
Colour correction matrix, including other adjustments.
Definition
debayer_params.h:22
libcamera::DebayerParams::contrastExp
float contrastExp
Contrast value to be used as an exponent.
Definition
debayer_params.h:27
libcamera::DebayerParams::identityLscLut
static constexpr auto identityLscLut
Lens shading lookup table of identity mapping.
Definition
debayer_params.h:41
libcamera::DebayerParams::lscLut
LscLookupTable lscLut
Lens shading lookup table.
Definition
debayer_params.h:51
vector.h
Vector class.
include
libcamera
internal
software_isp
debayer_params.h
Generated by
1.17.0