splinart functions#
-
inline auto splinart::build_img(const std::array<std::size_t, 2> &img_size, std::vector<Circle> &circles, std::size_t rep = 300, bool periodic = true, double scale_color = 0.005, double scale_value = 0.00001)#
Update the image using a cubic spline on a shape.
- Parameters:
img_size – The size of the squared output image.
circles – The list of circles to plot on th image.
rep – Number of iterations (default is 300).
periodic – Define if the first and last points of the path must be equal (default is True).
scale_color – Scale the given color (default is 0.005).
scale_value – Rescale the random radius (default value is 0.00001).
-
inline void splinart::update_path(xt::xtensor<double, 2> &path, double scale_value = 0.00001, bool periodic = false)#
Update the path of the spline.
We move each point of the path by a random vector defined inside a circle where
the center is the point of the path
the radius is a random number between [-1, 1]
- Parameters:
path – The coordinates of the cubic spline.
periodic – If True, the first and the last points of the path are the same (the default value is False).
scale_value – Rescale the random radius (default value is 0.00001).
-
inline void splinart::draw_pixel(xt::xtensor<double, 3> &img, const xt::xtensor<double, 2> &spline, xt::xtensor_fixed<double, xt::xshape<4>> color)#
Add pixels on the image.
- Parameters:
img – The image where we add pixels.
spline – The coordinates of the pixels to add.
color – Define the RGBA color of the pixels.
-
inline void splinart::imshow(xt::xtensor<double, 3> &img)#
Show the result image using the imshow function of OpenCV.
- Parameters:
img – The image to draw