You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
584B

  1. #pragma once
  2. #include <memory>
  3. #include <nanovg.h>
  4. #include <nanosvg.h>
  5. #include <common.hpp>
  6. namespace rack {
  7. struct Svg {
  8. NSVGimage* handle = NULL;
  9. ~Svg();
  10. /** Don't call this directly. Use `Svg::load()` for caching. */
  11. void loadFile(const std::string& filename);
  12. /** Loads SVG data from a string. */
  13. void loadString(const std::string& str);
  14. void draw(NVGcontext* vg);
  15. /** Loads Svg from a cache. */
  16. static std::shared_ptr<Svg> load(const std::string& filename);
  17. };
  18. DEPRECATED typedef Svg SVG;
  19. void svgDraw(NVGcontext* vg, NSVGimage* svg);
  20. } // namespace rack