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