PolygonGenerator: Finished main implementation

It's been 84 years, but the polygon generator not only works, but now has bezier support. The UI could still use some work, but this was the hardest part. I guess complex masking should be possible now, if perhaps slightly cumbersome until the UI is smoothed out.
This commit is contained in:
itsmattkc
2022-01-24 22:17:19 -08:00
parent 1e7d5a1751
commit 3f7381f7cb
14 changed files with 523 additions and 93 deletions
+30
View File
@@ -26,6 +26,36 @@
namespace olive {
Bezier::Bezier() :
x_(0),
y_(0),
cp1_x_(0),
cp1_y_(0),
cp2_x_(0),
cp2_y_(0)
{
}
Bezier::Bezier(double x, double y) :
x_(x),
y_(y),
cp1_x_(0),
cp1_y_(0),
cp2_x_(0),
cp2_y_(0)
{
}
Bezier::Bezier(double x, double y, double cp1_x, double cp1_y, double cp2_x, double cp2_y) :
x_(x),
y_(y),
cp1_x_(cp1_x),
cp1_y_(cp1_y),
cp2_x_(cp2_x),
cp2_y_(cp2_y)
{
}
double Bezier::QuadraticXtoT(double x, double a, double b, double c)
{
// Clamp to prevent infinite loop