splinart package#
Subpackages#
Submodules#
splinart.color module#
Define the default color of the output.
splinart.compute module#
Material to update the output image using a cunbic spline equation.
- splinart.compute.update_img(img, path, xs_func, x=None, nrep=300, periodic=True, scale_color=0.005, color=(0.0, 0.41568627450980394, 0.6196078431372549, 1.0), scale_value=1e-05)#
Update the image using a cubic spline on a shape.
- Parameters:
- imgnp.ndarray
The output image.
- pathnp.ndarray
The y coordinate of the cubic spline if x is not None, the coordinates of the cubic spline if x is None.
- xnp.ndarray
The x coordinates of the cubic spline if given. (the default value is None)
- xs_funcfunction
The function that return the x coordinate of the sampling points where to compute the y coordinates given the spline equation.
- nrepint
Number of iteration (default is 300).
- periodicbool
Define if the first and last points of the path must be equal (default is True).
- scale_colorfloat
Scale the given color (default is 0.005).
- colorlist(4)
Define the RGBA color to plot the spline.
- scale_valuefloat
Rescale the random radius (default value is 0.00001).
See also
- splinart.compute.update_path(path, periodic=False, scale_value=1e-05)#
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:
- pathnp.ndarray
The y coordinate of the cubic spline.
- periodicbool
If True, the first and the last points of the path are the same (the default value is False).
- scale_valuefloat
Rescale the random radius (default value is 0.00001).
splinart.draw module#
Material to update the image with given points and save or plot this image.
- splinart.draw.draw_pixel(img, xs, ys, scale_color=0.0005, color=(0.0, 0.41568627450980394, 0.6196078431372549, 1.0))#
Add pixels on the image.
- Parameters:
- imgnp.ndarray
The image where we add pixels.
- xsnp.ndarray
The x coordinate of the pixels to add.
- ysnp.ndarray
The y coordinate of the pixels to add.
- scale_colorfloat
Scale the given color (default is 0.0005).
- colorlist(4)
Define the RGBA color of the pixels.
- splinart.draw.save_img(img, path, filename)#
Save the image in a png file.
- Parameters:
- imgnp.ndarray
The image to save.
- pathstr
The save directory.
- filenamestr
The file name with the png extension.
- splinart.draw.show_img(img)#
Plot the image using matplotlib.
- Parameters:
- imgnp.ndarray
The image to save.
splinart.version module#
Module contents#
Splinart package.
- splinart.circle(center, radius, npoints=50)#
Discretization of a circle.
- Parameters:
- centerlist(2)
2d coordinates of the center.
- radiusfloat
Radius of the circle.
- npointsint
Number of discretization points (the default value is 50).
- Returns:
- np.ndarray
The theta angle.
- np.ndarray
The 2d coordinates of the circle.
- splinart.line(begin, end, ypos=0.5, npoints=50)#
Discretization of a horizontal line.
- Parameters:
- beginfloat
The left point of the line.
- endfloat
The right point of the line.
- yposfloat
The position of the y coordinate (the default value is 0.5).
- npointsint
Number of discretization points (the default value is 50).
- Returns:
- np.ndarray
The 2d coordinates of the line.
- splinart.save_img(img, path, filename)#
Save the image in a png file.
- Parameters:
- imgnp.ndarray
The image to save.
- pathstr
The save directory.
- filenamestr
The file name with the png extension.
- splinart.show_img(img)#
Plot the image using matplotlib.
- Parameters:
- imgnp.ndarray
The image to save.
- splinart.update_img(img, path, xs_func, x=None, nrep=300, periodic=True, scale_color=0.005, color=(0.0, 0.41568627450980394, 0.6196078431372549, 1.0), scale_value=1e-05)#
Update the image using a cubic spline on a shape.
- Parameters:
- imgnp.ndarray
The output image.
- pathnp.ndarray
The y coordinate of the cubic spline if x is not None, the coordinates of the cubic spline if x is None.
- xnp.ndarray
The x coordinates of the cubic spline if given. (the default value is None)
- xs_funcfunction
The function that return the x coordinate of the sampling points where to compute the y coordinates given the spline equation.
- nrepint
Number of iteration (default is 300).
- periodicbool
Define if the first and last points of the path must be equal (default is True).
- scale_colorfloat
Scale the given color (default is 0.005).
- colorlist(4)
Define the RGBA color to plot the spline.
- scale_valuefloat
Rescale the random radius (default value is 0.00001).
See also
update_path