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
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 */
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 */
52};
53
54} /* namespace libcamera */
Top-level libcamera namespace.
Definition backtrace.h:17
Type of a single column of a color correction matrix (CCM)
Definition debayer_params.h:21
int16_t b
Blue (third) component of a CCM column.
Definition debayer_params.h:24
int16_t r
Red (first) component of a CCM column.
Definition debayer_params.h:22
int16_t g
Green (second) component of a CCM column.
Definition debayer_params.h:23
Struct to hold the debayer parameters.
Definition debayer_params.h:18
CcmLookupTable greenCcm
Lookup table for the CCM green column, mapping input values to output values.
Definition debayer_params.h:49
LookupTable blue
Lookup table for blue color, mapping input values to output values.
Definition debayer_params.h:38
LookupTable gammaLut
Gamma lookup table used with color correction matrix.
Definition debayer_params.h:51
CcmLookupTable redCcm
Lookup table for the CCM red column, mapping input values to output values.
Definition debayer_params.h:48
std::array< CcmColumn, kRGBLookupSize > CcmLookupTable
Type of the CCM lookup tables for red, green, blue values.
Definition debayer_params.h:28
CcmLookupTable blueCcm
Lookup table for the CCM blue column, mapping input values to output values.
Definition debayer_params.h:50
static constexpr unsigned int kRGBLookupSize
Size of a color lookup table.
Definition debayer_params.h:19
LookupTable red
Lookup table for red color, mapping input values to output values.
Definition debayer_params.h:36
std::array< uint8_t, kRGBLookupSize > LookupTable
Type of the lookup tables for single lookup values.
Definition debayer_params.h:27
LookupTable green
Lookup table for green color, mapping input values to output values.
Definition debayer_params.h:37