| #pragma once |
| |
| #ifndef TNZ_EXTUTIL_H |
| #define TNZ_EXTUTIL_H |
| |
| |
| |
| |
| |
| #include "tcommon.h" |
| #include <tvectorimage.h> |
| |
| #undef DVAPI |
| #undef DVVAR |
| #ifdef TNZEXT_EXPORTS |
| #define DVAPI DV_EXPORT_API |
| #define DVVAR DV_EXPORT_VAR |
| #else |
| #define DVAPI DV_IMPORT_API |
| #define DVVAR DV_IMPORT_VAR |
| #endif |
| |
| #include "ext/Types.h" |
| |
| namespace ToonzExt { |
| |
| |
| |
| |
| DVAPI bool straightCornersDetector(const TStroke *stroke, |
| std::vector<double> &corners); |
| |
| |
| |
| |
| |
| |
| DVAPI bool detectStraightIntervals(const TStroke *stroke, |
| ToonzExt::Intervals &intervals, |
| double tolerance = TConsts::epsilon); |
| |
| |
| |
| |
| |
| |
| |
| |
| DVAPI bool findNearestStraightCorners(const TStroke *s, double actualW, |
| Interval &out, |
| const ToonzExt::Intervals *const cl = 0, |
| double tolerance = TConsts::epsilon); |
| |
| |
| |
| DVAPI bool isAStraightCorner(const TStroke *s, double actualW, |
| const ToonzExt::Intervals *const cl = 0, |
| double tolerance = TConsts::epsilon); |
| |
| |
| |
| |
| |
| |
| DVAPI bool cornersDetector(const TStroke *stroke, int minDegree, |
| std::vector<double> &corners); |
| |
| |
| |
| |
| |
| |
| DVAPI bool detectSpireIntervals(const TStroke *stroke, |
| ToonzExt::Intervals &intervals, int minDegree); |
| |
| |
| |
| |
| DVAPI bool findNearestSpireCorners(const TStroke *s, double actualW, |
| Interval &out, int cornerSize, |
| const ToonzExt::Intervals *const cl = 0, |
| double tolerance = TConsts::epsilon); |
| |
| |
| |
| DVAPI bool isASpireCorner(const TStroke *s, double w, int cornerSize, |
| const ToonzExt::Intervals *const cl = 0, |
| double tolerance = TConsts::epsilon); |
| |
| |
| |
| |
| DVAPI void findCorners(const TStroke *stroke, Intervals &corners, |
| Intervals &intervals, int angle, double tolerance); |
| |
| |
| |
| |
| DVAPI bool findNearestCorners(const TStroke *stroke, double w, Interval &out, |
| const Intervals &values, |
| double tolerance = TConsts::epsilon); |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| DVAPI TStroke *rotateControlPoint(const TStroke *stroke, |
| const ToonzExt::EvenInt &even, |
| double atLength); |
| |
| |
| |
| |
| DVAPI bool getAllW(const TStroke *stroke, const TPointD &pnt, double &dist2, |
| std::vector<double> ¶meters); |
| |
| |
| |
| DVAPI bool replaceStroke(TStroke *old_stroke, TStroke *new_stroke, |
| unsigned int n_, TVectorImageP &vi); |
| |
| |
| |
| |
| |
| void cloneStrokeStatus(const TStroke *from, TStroke *to); |
| |
| |
| |
| template <class T> |
| inline bool isValid(const T *s) { |
| assert(0 != s); |
| if (!s) return false; |
| return true; |
| } |
| |
| |
| |
| inline bool isValid(double w) { |
| assert(0.0 <= w && w <= 1.0); |
| if (w < 0.0 || w > 1.0) return false; |
| return true; |
| } |
| |
| |
| } |
| |
| #endif |
| |
| |
| |