libcamera v0.8.0+rpt20261104
Supporting cameras in Linux since 2019
Loading...
Searching...
No Matches
lsc_base.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: LGPL-2.1-or-later */
2/*
3 * Copyright (C) 2026 Ideas on Board Oy
4 *
5 * Base classes and types for LSC algorithm implementations
6 */
7
8#pragma once
9
10#include <map>
11#include <span>
12#include <stdint.h>
13#include <string>
14#include <vector>
15
16#include <libcamera/geometry.h>
17
19
20#include "interpolator.h"
21
22namespace libcamera {
23
24namespace ipa {
25
27 std::vector<std::string> keys;
28 unsigned int numHSamples;
29 unsigned int numVSamples;
31};
32
34{
35public:
36 using Components = std::map<std::string, std::vector<float>, std::less<>>;
37 using ComponentsMap = std::map<unsigned int, Components>;
38
39 virtual ~LscImplementation() {}
40
41 virtual int parseLscData(const ValueNode &tuningData,
42 const LscDescriptor &descriptor) = 0;
43
44 virtual ComponentsMap
45 sampleForCrop(const Rectangle &cropRectangle,
46 std::span<const double> xPos, std::span<const double> yPos) = 0;
47};
48
49} /* namespace ipa */
50
51} /* namespace libcamera */
Describe a rectangle's position and dimensions.
Definition geometry.h:247
Describe a two-dimensional size.
Definition geometry.h:51
A class representing a tree structure of values.
Definition value_node.h:27
Pure virtual base class for LSC algorithm implementations.
Definition lsc_base.h:34
std::map< std::string, std::vector< float >, std::less<> > Components
Associate colour components with a list of gains in float format.
Definition lsc_base.h:36
virtual int parseLscData(const ValueNode &tuningData, const LscDescriptor &descriptor)=0
Parse tuningData.
std::map< unsigned int, Components > ComponentsMap
Associate a colour temperature to a LSC table.
Definition lsc_base.h:37
virtual ~LscImplementation()
Virtual class destructor.
Definition lsc_base.h:39
virtual ComponentsMap sampleForCrop(const Rectangle &cropRectangle, std::span< const double > xPos, std::span< const double > yPos)=0
Re-sample the LSC components for cropRectangle.
Data structures related to geometric objects.
Helper class for linear interpolating a set of objects.
Top-level libcamera namespace.
Definition backtrace.h:17
Describe the ISP LSC engine.
Definition lsc_base.h:26
unsigned int numVSamples
Number of vertical gain samples of the ISP LSC grid. Used for validating the list of gains parsed fro...
Definition lsc_base.h:29
std::vector< std::string > keys
The list of colour components to which a list of gains is associated with in the tuning file....
Definition lsc_base.h:27
unsigned int numHSamples
Number of horizontal gain samples of the ISP LSC grid. Used for validating the list of gains parsed f...
Definition lsc_base.h:28
Size sensorSize
The physical sensor size. This is the largest frame size used to generate the LSC table....
Definition lsc_base.h:30
Data structure to manage tree of values.