MCPcopy Create free account
hub / github.com/Samsung/rlottie / createBitmap

Method createBitmap

src/vector/vimageloader.cpp:117–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115 ~Impl() { moduleFree(); }
116
117 VBitmap createBitmap(unsigned char *data, int width, int height,
118 int channel)
119 {
120 // premultiply alpha
121 if (channel == 4)
122 convertToBGRAPremul(data, width, height);
123 else
124 convertToBGRA(data, width, height);
125
126 // create a bitmap of same size.
127 VBitmap result =
128 VBitmap(width, height, VBitmap::Format::ARGB32_Premultiplied);
129
130 // copy the data to bitmap buffer
131 memcpy(result.data(), data, width * height * 4);
132
133 // free the image data
134 imageFree(data);
135
136 return result;
137 }
138
139 VBitmap load(const char *fileName)
140 {

Callers

nothing calls this directly

Calls 1

dataMethod · 0.45

Tested by

no test coverage detected