diff options
Diffstat (limited to 'src/v4l2/v4l2_compat_manager.cpp')
0 files changed, 0 insertions, 0 deletions
![]() |
index : libcamera/libcamera.git | |
libcamera official repository | git repository hosting on libcamera.org |
summaryrefslogtreecommitdiff |
/* SPDX-License-Identifier: BSD-2-Clause */
/*
* Copyright (C) 2019, Raspberry Pi (Trading) Limited
*
* pwl.hpp - piecewise linear functions interface
*/
#pragma once
#include <math.h>
#include <vector>
#include <boost/property_tree/ptree.hpp>
namespace RPi {
class Pwl
{
public:
struct Interval {
Interval(double _start, double _end) : start(_start), end(_end)
{
}
double start, end;
bool Contains(double value)
{
return value >= start && value <= end;
}
double Clip(double value)
{
return value < start ? start
: (value > end ? end : value);
}
double Len() const { return end - start; }
};
struct Point {
Point() : x(0), y(0) {}
Point(double _x, double _y) : x(_x), y(_y) {}
double x, y;
Point operator-(Point const &p) const
{
return Point(x - p.x, y - p.y);
}
Point operator+(Point const &p) const
{
return Point(x + p.x, y + p.y);
}
double operator%(Point const &p) const
{
return x * p.x + y * p.y;
}
Point operator*(double f) const { return Point(x * f, y * f); }