Class GradientFiller
java.lang.Object
io.github.shimeoki.jfx.rasterization.triangle.GradientFiller
- All Implemented Interfaces:
Filler
One of the standard implementations of
Filler to fill the
triangles with a gradient from three colors.
Linearly interpolates the color based on the barycentric coordinates. The colors are numbered and mapped to the corresponding numbered coordinates of the barycentrics.
- Since:
- 2.0.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionGradientFiller(Colorf c1, Colorf c2, Colorf c3) Creates a newGradientFillerinstance. -
Method Summary
Modifier and TypeMethodDescriptioncolor(Barycentrics b, Point2i p) Gets the color for the point on specified barycentrics and/or pixel coordinates.
-
Constructor Details
-
GradientFiller
Creates a newGradientFillerinstance.- Parameters:
c1- first color of the gradientc2- second color of the gradientc3- third color of the gradient- Throws:
NullPointerException- if at least one parameter isnull- Since:
- 2.0.0
-
-
Method Details
-
color
Description copied from interface:FillerGets the color for the point on specified barycentrics and/or pixel coordinates.The parameters can be not copies, but references to the objects, used by the triangler.
-