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

Method makeFromBitmap

snap_drawing/src/snap_drawing/cpp/Utils/Image.cpp:224–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222}
223
224Valdi::Result<Ref<Image>> Image::makeFromBitmap(const Valdi::Ref<Valdi::IBitmap>& bitmap, bool shouldCopy) {
225 auto info = bitmap->getInfo();
226
227 auto data = bitmapToData(bitmap, info, shouldCopy);
228 if (!data) {
229 return data.moveError();
230 }
231
232 return makeFromPixelsData(info, data.value());
233}
234
235Valdi::Ref<Valdi::IBitmap> Image::getBitmap() {
236 auto imageInfo = _skImage->imageInfo();

Callers

nothing calls this directly

Calls 3

bitmapToDataFunction · 0.85
getInfoMethod · 0.65
valueMethod · 0.65

Tested by

no test coverage detected