edge-coloring.h 917 B

1234567891011121314151617181920212223
  1. #pragma once
  2. #include "Shape.h"
  3. #define MSDFGEN_EDGE_LENGTH_PRECISION 4
  4. namespace msdfgen {
  5. /** Assigns colors to edges of the shape in accordance to the multi-channel distance field technique.
  6. * May split some edges if necessary.
  7. * angleThreshold specifies the maximum angle (in radians) to be considered a corner, for example 3 (~172 degrees).
  8. * Values below 1/2 PI will be treated as the external angle.
  9. */
  10. void edgeColoringSimple(Shape &shape, double angleThreshold, unsigned long long seed = 0);
  11. /** The alternative "ink trap" coloring strategy is designed for better results with typefaces
  12. * that use ink traps as a design feature. It guarantees that even if all edges that are shorter than
  13. * both their neighboring edges are removed, the coloring remains consistent with the established rules.
  14. */
  15. void edgeColoringInkTrap(Shape &shape, double angleThreshold, unsigned long long seed = 0);
  16. }