libcamera v0.7.2+rpt20261009
Supporting cameras in Linux since 2019
Loading...
Searching...
No Matches
lsc.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 * IPU3 Lens Shading Correction algorithm
6 */
7
8#pragma once
9
10#include <vector>
11
12#include "libipa/fixedpoint.h"
13#include "libipa/lsc.h"
14
15#include "algorithm.h"
16
17namespace libcamera {
18
19namespace ipa::ipu3::algorithms {
20
21class Lsc : public Algorithm
22{
23public:
24 int init(IPAContext &context, const ValueNode &tuningData) override;
25 void queueRequest(IPAContext &context, const uint32_t frame,
26 IPAFrameContext &frameContext,
27 const ControlList &controls) override;
28 int configure(IPAContext &context, const IPAConfigInfo &configInfo) override;
29 void prepare(IPAContext &context, const uint32_t frame,
30 IPAFrameContext &frameContext,
31 ipu3_uapi_params *params) override;
32 void process(IPAContext &context, const uint32_t frame,
33 IPAFrameContext &frameContext,
34 const ipu3_uapi_stats_3a *stats,
35 ControlList &metadata) override;
36
37private:
38 std::vector<double> calculatePositions(unsigned int dimension);
39
40 unsigned int numHCells_;
41 unsigned int numVCells_;
42 unsigned int blockWidthLog2_;
43 unsigned int blockHeightLog2_;
44
45 unsigned int lastAppliedCt_;
46 unsigned int lastAppliedQuantizedCt_;
47
48 unsigned int sensorWidth_;
49 unsigned int sensorHeight_;
50 unsigned int cropWidth_;
51 unsigned int cropHeight_;
52
53 bool polynomial_;
54
55 LscAlgorithm<UQ<2, 10>> lscAlgo_;
56};
57
58} // namespace ipa::ipu3::algorithms
59
60} // namespace libcamera
Associate a list of ControlId with their values for an object.
Definition controls.h:453
A class representing a tree structure of values.
Definition value_node.h:27
The base class for all IPA algorithms.
Definition algorithm.h:23
libIPA LSC algorithm implementation
Definition lsc.h:79
IPU3 Lens Shading Correction algorithm.
Definition lsc.h:22
void queueRequest(IPAContext &context, const uint32_t frame, IPAFrameContext &frameContext, const ControlList &controls) override
Provide control values to the algorithm.
Definition lsc.cpp:121
int init(IPAContext &context, const ValueNode &tuningData) override
Initialize the Algorithm with tuning data.
Definition lsc.cpp:38
void process(IPAContext &context, const uint32_t frame, IPAFrameContext &frameContext, const ipu3_uapi_stats_3a *stats, ControlList &metadata) override
Process ISP statistics, and run algorithm operations.
Definition lsc.cpp:282
void prepare(IPAContext &context, const uint32_t frame, IPAFrameContext &frameContext, ipu3_uapi_params *params) override
Fill the params buffer with ISP processing parameters for a frame.
Definition lsc.cpp:150
int configure(IPAContext &context, const IPAConfigInfo &configInfo) override
Configure the Algorithm given an IPAConfigInfo.
Definition lsc.cpp:107
Algorithm common interface.
libipa LSC algorithm
Top-level libcamera namespace.
Definition backtrace.h:17
Global IPA context data shared between all algorithms.
Definition ipa_context.h:73
IPU3-specific FrameContext.
Definition ipa_context.h:60