libcamera
v0.7.2+1-2f862c3e-dirty (2026-11-19T09:18:39UTC)-nvm
Supporting cameras in Linux since 2019
Toggle main menu visibility
Loading...
Searching...
No Matches
sensor_cfa_layout.h
1
/* SPDX-License-Identifier: LGPL-2.1-or-later */
2
/*
3
* Copyright (C) 2026 Frederic Laing
4
*/
5
6
#pragma once
7
8
#include <algorithm>
9
#include <string_view>
10
11
#include <
libcamera/geometry.h
>
12
13
namespace
libcamera
{
14
15
struct
SensorCfaLayout
{
16
Size
nativeCellSize;
17
Size
softwareIspInputCellSize;
18
19
unsigned
int
minimumDebinFactor()
const
20
{
21
return
2 * std::max(nativeCellSize.width, nativeCellSize.height);
22
}
23
24
bool
softwareIspNeedsCellCollapse()
const
25
{
26
return
softwareIspInputCellSize !=
Size
(1, 1);
27
}
28
};
29
30
inline
SensorCfaLayout
sensorCfaLayout(std::string_view model)
31
{
32
/*
33
* Native cell size describes the sensor construction. The software ISP
34
* input size separately describes whether that pipeline receives physical
35
* same-colour cells or an ordinary Bayer stream produced by the sensor.
36
*/
37
if
(model ==
"imx371"
)
38
return
{ { 2, 2 }, { 2, 2 } };
39
if
(model ==
"imx708"
|| model ==
"imx708_wide"
||
40
model ==
"imx708_noir"
|| model ==
"imx708_wide_noir"
)
41
return
{ { 2, 2 }, { 1, 1 } };
42
43
return
{ { 1, 1 }, { 1, 1 } };
44
}
45
46
}
/* namespace libcamera */
libcamera::Size
Describe a two-dimensional size.
Definition
geometry.h:51
geometry.h
Data structures related to geometric objects.
libcamera
Top-level libcamera namespace.
Definition
backtrace.h:17
libcamera::SensorCfaLayout
Definition
sensor_cfa_layout.h:15
include
libcamera
internal
sensor_cfa_layout.h
Generated by
1.17.0