MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / save

Method save

lib/core/bitmap.cc:28–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28void Bitmap::save()
29{
30 if (endsWith(filename, ".png"))
31 stbi_write_png(
32 filename.c_str(), width, height, 4, &_bitmap[0], width * 4);
33 else if (endsWith(filename, ".bmp"))
34 stbi_write_bmp(filename.c_str(), width, height, 4, &_bitmap[0]);
35 else if (endsWith(filename, ".tga"))
36 stbi_write_tga(filename.c_str(), width, height, 4, &_bitmap[0]);
37 else if (endsWith(filename, ".jpg"))
38 stbi_write_jpg(filename.c_str(), width, height, 4, &_bitmap[0], 80);
39 else
40 error("don't know how to write that image format");
41}

Callers 2

visualiseSectorsToFileFunction · 0.45
mainAnalyseDriveResponseFunction · 0.45

Calls 2

endsWithFunction · 0.85
errorFunction · 0.85

Tested by

no test coverage detected