mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-13 07:19:45 +03:00
ipa: libipa: pwl: Add a constructor that moves a Point vector
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>
This commit is contained in:
parent
0706c67711
commit
31c9998bf0
2 changed files with 13 additions and 0 deletions
|
@ -114,6 +114,17 @@ Pwl::Pwl(const std::vector<Point> &points)
|
|||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* \copydoc Pwl::Pwl(const std::vector<Point> &points)
|
||||
*
|
||||
* The contents of the \a points vector is moved to the newly constructed Pwl
|
||||
* instance.
|
||||
*/
|
||||
Pwl::Pwl(std::vector<Point> &&points)
|
||||
: points_(std::move(points))
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Populate the piecewise linear function from yaml data
|
||||
* \param[in] params Yaml data to populate the piecewise linear function with
|
||||
|
|
|
@ -47,6 +47,8 @@ public:
|
|||
|
||||
Pwl();
|
||||
Pwl(const std::vector<Point> &points);
|
||||
Pwl(std::vector<Point> &&points);
|
||||
|
||||
int readYaml(const libcamera::YamlObject ¶ms);
|
||||
|
||||
void append(double x, double y, double eps = 1e-6);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue