render-sdf.h 1.3 KB

1234567891011121314151617181920212223
  1. #pragma once
  2. #include "Vector2.hpp"
  3. #include "Range.hpp"
  4. #include "BitmapRef.hpp"
  5. namespace msdfgen {
  6. /// Reconstructs the shape's appearance into output from the distance field sdf.
  7. void renderSDF(const BitmapRef<float, 1> &output, const BitmapConstRef<float, 1> &sdf, Range sdfPxRange = 0, float sdThreshold = .5f);
  8. void renderSDF(const BitmapRef<float, 3> &output, const BitmapConstRef<float, 1> &sdf, Range sdfPxRange = 0, float sdThreshold = .5f);
  9. void renderSDF(const BitmapRef<float, 1> &output, const BitmapConstRef<float, 3> &sdf, Range sdfPxRange = 0, float sdThreshold = .5f);
  10. void renderSDF(const BitmapRef<float, 3> &output, const BitmapConstRef<float, 3> &sdf, Range sdfPxRange = 0, float sdThreshold = .5f);
  11. void renderSDF(const BitmapRef<float, 1> &output, const BitmapConstRef<float, 4> &sdf, Range sdfPxRange = 0, float sdThreshold = .5f);
  12. void renderSDF(const BitmapRef<float, 4> &output, const BitmapConstRef<float, 4> &sdf, Range sdfPxRange = 0, float sdThreshold = .5f);
  13. /// Snaps the values of the floating-point bitmaps into one of the 256 values representable in a standard 8-bit bitmap.
  14. void simulate8bit(const BitmapRef<float, 1> &bitmap);
  15. void simulate8bit(const BitmapRef<float, 3> &bitmap);
  16. void simulate8bit(const BitmapRef<float, 4> &bitmap);
  17. }