libcamera v0.8.0+rpt20261104
Supporting cameras in Linux since 2019
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
18
19namespace libcamera {
20
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);
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 }();
52 uint64_t lscLutVersion = 0;
53};
54
55} /* namespace libcamera */
Matrix class.
Definition matrix.h:31
Vector class.
Definition vector.h:35
Matrix class.
Top-level libcamera namespace.
Definition backtrace.h:17
Struct to hold the debayer parameters.
Definition debayer_params.h:21
float contrastExp
Contrast value to be used as an exponent.
Definition debayer_params.h:27
static constexpr unsigned int kLscValuesPerCell
Number of pixel values per each of the lens shading grid areas.
Definition debayer_params.h:36
std::array< uint8_t, kLscGridSize *kLscGridSize *kLscValuesPerCell > LscLookupTable
Lookup table for lens shading correction.
Definition debayer_params.h:40
static constexpr unsigned int kLscBytesPerCell
Number of bytes per each of the lens shading grid areas.
Definition debayer_params.h:37
LscLookupTable lscLut
Lens shading lookup table.
Definition debayer_params.h:51
Matrix< float, 3, 3 > combinedMatrix
Colour correction matrix, including other adjustments.
Definition debayer_params.h:22
static constexpr unsigned int kLscGridSize
Number of lens shading grid areas in one direction.
Definition debayer_params.h:35
RGB< double > blackLevel
Black level values.
Definition debayer_params.h:25
float gamma
Gamma value, e.g. 1/2.2.
Definition debayer_params.h:26
RGB< double > gains
Colour channel gains.
Definition debayer_params.h:28
uint64_t lscLutVersion
Incremented on each lscLut change.
Definition debayer_params.h:52
static constexpr auto identityLscLut
Lens shading lookup table of identity mapping.
Definition debayer_params.h:41
Vector class.