libcamera v0.7.2+1-2f862c3e-dirty (2026-10-05T14:46:06UTC)-nvm
Supporting cameras in Linux since 2019
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
13namespace libcamera {
14
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
30inline 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 */
Describe a two-dimensional size.
Definition geometry.h:51
Data structures related to geometric objects.
Top-level libcamera namespace.
Definition backtrace.h:17
Definition sensor_cfa_layout.h:15