libcamera: include/libcamera/internal/software_isp/debayer_params.h Source File

libcamera v0.5.1 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-2025 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
16namespace libcamera {
17
18 struct DebayerParams {
19 static constexpr unsigned int kRGBLookupSize = 256;
20
21 struct CcmColumn {
22 int16_t r;
23 int16_t g;
24 int16_t b;
25 };
26
27 using LookupTable = std::array<uint8_t, kRGBLookupSize>;
28 using CcmLookupTable = std::array<CcmColumn, kRGBLookupSize>;
29
30 /*
31 * Color lookup tables when CCM is not used.
32 *
33 * Each color of a debayered pixel is amended by the corresponding
34 * value in the given table.
35 */
36 LookupTable red;
37 LookupTable green;
38 LookupTable blue;
39
40 /*
41 * Color and gamma lookup tables when CCM is used.
42 *
43 * Each of the CcmLookupTable's corresponds to a CCM column; together they
44 * make a complete 3x3 CCM lookup table. The CCM is applied on debayered
45 * pixels and then the gamma lookup table is used to set the resulting
46 * values of all the three colors.
47 */
48 CcmLookupTable redCcm;
49 CcmLookupTable greenCcm;
50 CcmLookupTable blueCcm;
51 LookupTable gammaLut;
52};
53
54} /* namespace libcamera */
libcamera
Top-level libcamera namespace.
Definition backtrace.h:17
libcamera::DebayerParams::CcmColumn
Type of a single column of a color correction matrix (CCM)
Definition debayer_params.h:21
libcamera::DebayerParams::CcmColumn::b
int16_t b
Blue (third) component of a CCM column.
Definition debayer_params.h:24
libcamera::DebayerParams::CcmColumn::r
int16_t r
Red (first) component of a CCM column.
Definition debayer_params.h:22
libcamera::DebayerParams::CcmColumn::g
int16_t g
Green (second) component of a CCM column.
Definition debayer_params.h:23
libcamera::DebayerParams
Struct to hold the debayer parameters.
Definition debayer_params.h:18
libcamera::DebayerParams::greenCcm
CcmLookupTable greenCcm
Lookup table for the CCM green column, mapping input values to output values.
Definition debayer_params.h:49
libcamera::DebayerParams::blue
LookupTable blue
Lookup table for blue color, mapping input values to output values.
Definition debayer_params.h:38
libcamera::DebayerParams::gammaLut
LookupTable gammaLut
Gamma lookup table used with color correction matrix.
Definition debayer_params.h:51
libcamera::DebayerParams::redCcm
CcmLookupTable redCcm
Lookup table for the CCM red column, mapping input values to output values.
Definition debayer_params.h:48
libcamera::DebayerParams::CcmLookupTable
std::array< CcmColumn, kRGBLookupSize > CcmLookupTable
Type of the CCM lookup tables for red, green, blue values.
Definition debayer_params.h:28
libcamera::DebayerParams::blueCcm
CcmLookupTable blueCcm
Lookup table for the CCM blue column, mapping input values to output values.
Definition debayer_params.h:50
libcamera::DebayerParams::kRGBLookupSize
static constexpr unsigned int kRGBLookupSize
Size of a color lookup table.
Definition debayer_params.h:19
libcamera::DebayerParams::red
LookupTable red
Lookup table for red color, mapping input values to output values.
Definition debayer_params.h:36
libcamera::DebayerParams::LookupTable
std::array< uint8_t, kRGBLookupSize > LookupTable
Type of the lookup tables for single lookup values.
Definition debayer_params.h:27
libcamera::DebayerParams::green
LookupTable green
Lookup table for green color, mapping input values to output values.
Definition debayer_params.h:37