libcamera v0.7.2+rpt20260817
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 <stdint.h>
12#include <string>
13#include <vector>
14
15#include <libcamera/base/span.h>
16
17#include <libcamera/geometry.h>
18
20
21#include "interpolator.h"
22
23namespace libcamera {
24
25namespace ipa {
26
28 std::vector<std::string> keys;
29 unsigned int numHSamples;
30 unsigned int numVSamples;
32};
33
35{
36public:
37 using Components = std::map<std::string, std::vector<float>, std::less<>>;
38 using ComponentsMap = std::map<unsigned int, Components>;
39
40 virtual ~LscImplementation() {}
41
42 virtual int parseLscData(const ValueNode &tuningData,
43 const LscDescriptor &descriptor) = 0;
44
45 virtual ComponentsMap
46 sampleForCrop(const Rectangle &cropRectangle,
47 std::vector<double> xPos, std::vector<double> yPos) = 0;
48};
49
50} /* namespace ipa */
51
52} /* 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:35
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:37
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:38
virtual ~LscImplementation()
Virtual class destructor.
Definition lsc_base.h:40
virtual ComponentsMap sampleForCrop(const Rectangle &cropRectangle, std::vector< double > xPos, std::vector< 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:27
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:30
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:28
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:29
Size sensorSize
The physical sensor size. This is the largest frame size used to generate the LSC table....
Definition lsc_base.h:31
Data structure to manage tree of values.