2
0

rasterization.h 923 B

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