summaryrefslogtreecommitdiff
path: root/Documentation/coding-style.rst
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-07-03 18:33:55 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-08-31 22:44:11 +0300
commitf69b19667f017a94980657ebbd6a00f5448e69ff (patch)
tree04a7a2f7aab581f351eaf39fba5ada1f2e109186 /Documentation/coding-style.rst
parent2b314587638f0a14b95cf579ba963c2237560537 (diff)
libcamera: pipeline: simple: Open all video devices at match() time
Move opening of video devices at match() time, the same way as subdevs are opened, to make the handling of V4L2 video devices and subdevices more consistent. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Martin Kepplinger <martin.kepplinger@puri.sm>
Diffstat (limited to 'Documentation/coding-style.rst')
0 files changed, 0 insertions, 0 deletions
l kwd">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); } Point operator/(double f) const { return Point(x / f, y / f); } double Len2() const { return x * x + y * y; } double Len() const { return sqrt(Len2()); } }; Pwl() {} Pwl(std::vector<Point> const &points) : points_(points) {} void Read(boost::property_tree::ptree const &params); void Append(double x, double y, const double eps = 1e-6); void Prepend(double x, double y, const double eps = 1e-6); Interval Domain() const; Interval Range() const; bool Empty() const; // Evaluate Pwl, optionally supplying an initial guess for the // "span". The "span" may be optionally be updated. If you want to know // the "span" value but don't have an initial guess you can set it to // -1. double Eval(double x, int *span_ptr = nullptr, bool update_span = true) const; // Find perpendicular closest to xy, starting from span+1 so you can // call it repeatedly to check for multiple closest points (set span to // -1 on the first call). Also returns "pseudo" perpendiculars; see // PerpType enum. enum class PerpType { None, // no perpendicular found Start, // start of Pwl is closest point End, // end of Pwl is closest point Vertex, // vertex of Pwl is closest point Perpendicular // true perpendicular found }; PerpType Invert(Point const &xy, Point &perp, int &span, const double eps = 1e-6) const; // Compose two Pwls together, doing "this" first and "other" after. Pwl Compose(Pwl const &other, const double eps = 1e-6) const; // Apply function to (x,y) values at every control point. void Map(std::function<void(double x, double y)> f) const; // Apply function to (x, y0, y1) values wherever either Pwl has a // control point. static void Map2(Pwl const &pwl0, Pwl const &pwl1, std::function<void(double x, double y0, double y1)> f);