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

Method makeFromSVG

snap_drawing/src/snap_drawing/cpp/Utils/Image.cpp:193–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191}
192
193Valdi::Result<Ref<Image>> Image::makeFromSVG(const Valdi::BytesView& data, int preferredWidth, int preferredHeight) {
194 auto bitmap = rasterizeSVG(
195 data, BitmapFactory::getInstance(Valdi::ColorType::ColorTypeRGBA8888), preferredWidth, preferredHeight);
196 if (!bitmap) {
197 return bitmap.moveError();
198 }
199
200 return makeFromBitmap(bitmap.moveValue(), false);
201}
202
203Valdi::Result<Ref<Image>> Image::makeFromPixelsData(const Valdi::BitmapInfo& bitmapInfo,
204 const Valdi::BytesView& pixelsData,

Callers

nothing calls this directly

Calls 1

rasterizeSVGFunction · 0.85

Tested by

no test coverage detected