rasterization.h 1.6 KB

1234567891011121314151617181920212223242526
  1. #pragma once
  2. #include "Vector2.h"
  3. #include "Shape.h"
  4. #include "Projection.h"
  5. #include "Scanline.h"
  6. #include "BitmapRef.hpp"
  7. namespace msdfgen {
  8. /// Rasterizes the shape into a monochrome bitmap.
  9. void rasterize(const BitmapRef<float, 1> &output, const Shape &shape, const Projection &projection, FillRule fillRule = FILL_NONZERO);
  10. /// Fixes the sign of the input signed distance field, so that it matches the shape's rasterized fill.
  11. void distanceSignCorrection(const BitmapRef<float, 1> &sdf, const Shape &shape, const Projection &projection, FillRule fillRule = FILL_NONZERO);
  12. void distanceSignCorrection(const BitmapRef<float, 3> &sdf, const Shape &shape, const Projection &projection, FillRule fillRule = FILL_NONZERO);
  13. void distanceSignCorrection(const BitmapRef<float, 4> &sdf, const Shape &shape, const Projection &projection, FillRule fillRule = FILL_NONZERO);
  14. // Old version of the function API's kept for backwards compatibility
  15. void rasterize(const BitmapRef<float, 1> &output, const Shape &shape, const Vector2 &scale, const Vector2 &translate, FillRule fillRule = FILL_NONZERO);
  16. void distanceSignCorrection(const BitmapRef<float, 1> &sdf, const Shape &shape, const Vector2 &scale, const Vector2 &translate, FillRule fillRule = FILL_NONZERO);
  17. void distanceSignCorrection(const BitmapRef<float, 3> &sdf, const Shape &shape, const Vector2 &scale, const Vector2 &translate, FillRule fillRule = FILL_NONZERO);
  18. void distanceSignCorrection(const BitmapRef<float, 4> &sdf, const Shape &shape, const Vector2 &scale, const Vector2 &translate, FillRule fillRule = FILL_NONZERO);
  19. }