Botcraft 1.21.4
Loading...
Searching...
No Matches
ImageSaver.cpp
Go to the documentation of this file.
1#define STB_IMAGE_WRITE_IMPLEMENTATION
2#ifdef _WIN32
3#define STBI_MSC_SECURE_CRT
4#endif
5#include <stb_image/stb_image_write.h>
6
8
9namespace Botcraft
10{
11 namespace Renderer
12 {
13 void WriteImage(const std::string& path, const int height, const int width, const int depth, const unsigned char* data, const bool vertical_revert)
14 {
15 stbi_flip_vertically_on_write(vertical_revert);
16 stbi_write_png(path.c_str(), width, height, depth, data, depth * width);
17 }
18 } // Renderer
19} // Botcraft
void WriteImage(const std::string &path, const int height, const int width, const int depth, const unsigned char *data, const bool vertical_revert=true)