MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / SaveImagePNG

Function SaveImagePNG

deps/LLGL/tests/Test_Image.cpp:39–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39void SaveImagePNG(const LLGL::Image& img, const std::string& filename, std::uint32_t slice = 0)
40{
41 int w = static_cast<int>(img.GetExtent().width);
42 int h = static_cast<int>(img.GetExtent().height);
43 int comp = static_cast<int>(LLGL::ImageFormatSize(img.GetFormat()));
44 auto buf = reinterpret_cast<const char*>(img.GetData()) + img.GetDepthStride() * slice;
45
46 stbi_write_png(filename.c_str(), w, h, comp, buf, img.GetRowStride());
47}
48
49void Test_PixelOperations()
50{

Callers 3

Test_PixelOperationsFunction · 0.85
Test_BlitFunction · 0.85
Test_ResizeFunction · 0.85

Calls 6

stbi_write_pngFunction · 0.85
GetDepthStrideMethod · 0.80
c_strMethod · 0.80
GetRowStrideMethod · 0.80
GetFormatMethod · 0.45
GetDataMethod · 0.45

Tested by

no test coverage detected