MCPcopy Create free account
hub / github.com/DiscordMessenger/dm / ImageFrame

Class ImageFrame

src/windows/ImageLoader.cpp:5–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3
4typedef void(*FreeFunction)(void*);
5struct ImageFrame
6{
7 int FrameTime;
8 uint8_t* Data;
9 FreeFunction DataFree;
10
11 ImageFrame(uint8_t* data, FreeFunction freeFunc, int frameTime = 0) :
12 FrameTime(frameTime),
13 Data(data),
14 DataFree(freeFunc)
15 {}
16
17 ImageFrame(const ImageFrame& f) = delete;
18
19 ImageFrame(ImageFrame&& f) noexcept {
20 Data = f.Data;
21 DataFree = f.DataFree;
22 FrameTime = f.FrameTime;
23 f.Data = nullptr;
24 f.DataFree = nullptr;
25 }
26
27 ~ImageFrame()
28 {
29 if (Data) {
30 assert(DataFree);
31 DataFree(Data);
32 }
33
34 Data = nullptr;
35 DataFree = nullptr;
36 }
37};
38
39struct Image
40{

Callers 2

DecodeWebpFunction · 0.85
DecodeWithStbImageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected