summaryrefslogtreecommitdiff
path: root/src/ipa/libipa/pwl.h
AgeCommit message (Collapse)Author
2024-06-16ipa: libipa: pwl: Add a constructor that moves a Point vectorLaurent Pinchart
The Pwl::Pwl(const std::vector<Point> &) constructor is inefficient as it makes a copy of the given points vector. Add a second constructor that takes an rvalue reference to a points vector to provide move semantics. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-06-16ipa: libipa: pwl: Add a size() functionLaurent Pinchart
Add a size() function to the Pwl class to return the number of points in the piecewise linear function. This is useful, for instance, to validate that all points added with append() or prepend() have been taken into account. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-06-16ipa: libipa: pwl: Make the empty() function inlineLaurent Pinchart
The Pwl::empty() function is a one-liner that can be easily optimized by the compiler given the chance. Make it inline. While at it, move the function documentation block to match the class declaration order. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-06-12ipa: libipa: Copy pwl from rpi, and clean it up to match libcameraPaul Elder
Copy the piecewise linear function code from Raspberry Pi, and clean it up to align it more with the libcamera style. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com> Acked-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>