MCPcopy Create free account
hub / github.com/Snapchat/Valdi / parse

Method parse

libs/image_toolbox/src/image_toolbox/SVGRenderer.cpp:60–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58 }
59
60 Valdi::Result<Valdi::Ref<ReSVGHandle>> parse(const Valdi::Byte* data, size_t length) {
61 resvg_render_tree* tree = nullptr;
62 auto loadResult = resvg_parse_tree_from_data(reinterpret_cast<const char*>(data), length, _options, &tree);
63 if (loadResult != RESVG_OK) {
64 return svgErrorFromResult(loadResult);
65 }
66
67 return Valdi::makeShared<ReSVGHandle>(tree);
68 }
69
70private:
71 resvg_options* _options = nullptr;

Callers 2

getSizeMethod · 0.45
renderMethod · 0.45

Calls 1

svgErrorFromResultFunction · 0.85

Tested by

no test coverage detected