CompiledShape.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #pragma once
  2. #include <stddef.h>
  3. #include "Vector2.h"
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. /*typedef struct {
  8. void *userPtr;
  9. void *(*reallocPtr)(void *userPtr, void *memoryPtr, size_t memorySize);
  10. void *(*freePtr)(void *userPtr, void *memoryPtr);
  11. } MSDFGEN_Allocator;*/
  12. typedef struct {
  13. int colorMask;
  14. MSDFGEN_Vector2 endpoint0, endpoint1;
  15. MSDFGEN_Vector2 cornerVec0, cornerVec1;
  16. MSDFGEN_Vector2 direction;
  17. MSDFGEN_Vector2 invDerivative;
  18. } MSDFGEN_CompiledLinearEdge;
  19. typedef struct {
  20. int colorMask;
  21. MSDFGEN_Vector2 endpoint0, endpoint1;
  22. MSDFGEN_Vector2 cornerVec0, cornerVec1;
  23. MSDFGEN_Vector2 direction0, direction1;
  24. MSDFGEN_Vector2 derivative0, derivative1;
  25. } MSDFGEN_CompiledQuadraticEdge;
  26. typedef struct {
  27. int colorMask;
  28. MSDFGEN_Vector2 endpoint0, endpoint1;
  29. MSDFGEN_Vector2 cornerVec0, cornerVec1;
  30. MSDFGEN_Vector2 direction0, direction1;
  31. MSDFGEN_Vector2 derivative0, derivative1, derivative2;
  32. } MSDFGEN_CompiledCubicEdge;
  33. typedef struct {
  34. MSDFGEN_CompiledLinearEdge *linearEdges;
  35. MSDFGEN_CompiledQuadraticEdge *quadraticEdges;
  36. MSDFGEN_CompiledCubicEdge *cubicEdges;
  37. size_t nLinearEdges, nQuadraticEdges, nCubicEdges;
  38. } MSDFGEN_CompiledShape;
  39. /*void MSDFGEN_Shape_initialize(MSDFGEN_Shape *shapePtr);
  40. void MSDFGEN_Shape_clear(MSDFGEN_Shape *shapePtr, MSDFGEN_Allocator allocator);*/
  41. void MSDFGEN_compileLinearEdge(MSDFGEN_CompiledLinearEdge *dstEdgePtr, int colorMask, MSDFGEN_Vector2 point0, MSDFGEN_Vector2 point1, MSDFGEN_Vector2 prevEdgeDirection1, MSDFGEN_Vector2 nextEdgeDirection0);
  42. void MSDFGEN_compileQuadraticEdge(MSDFGEN_CompiledQuadraticEdge *dstEdgePtr, int colorMask, MSDFGEN_Vector2 point0, MSDFGEN_Vector2 point1, MSDFGEN_Vector2 point2, MSDFGEN_Vector2 prevEdgeDirection1, MSDFGEN_Vector2 nextEdgeDirection0);
  43. void MSDFGEN_compileCubicEdge(MSDFGEN_CompiledCubicEdge *dstEdgePtr, int colorMask, MSDFGEN_Vector2 point0, MSDFGEN_Vector2 point1, MSDFGEN_Vector2 point2, MSDFGEN_Vector2 point3, MSDFGEN_Vector2 prevEdgeDirection1, MSDFGEN_Vector2 nextEdgeDirection0);
  44. /*void MSDFGEN_Shape_addLinearEdge(MSDFGEN_Shape *shapePtr, const MSDFGEN_Shape::LinearEdge *edgePtr, MSDFGEN_Allocator allocator);
  45. void MSDFGEN_Shape_addQuadraticEdge(MSDFGEN_Shape *shapePtr, const MSDFGEN_Shape::QuadraticEdge *edgePtr, MSDFGEN_Allocator allocator);
  46. void MSDFGEN_Shape_addCubicEdge(MSDFGEN_Shape *shapePtr, const MSDFGEN_Shape::CubicEdge *edgePtr, MSDFGEN_Allocator allocator);*/
  47. #ifdef __cplusplus
  48. }
  49. #endif