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
7
#include "
botcraft/Renderer/ImageSaver.hpp
"
8
9
namespace
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
ImageSaver.hpp
Botcraft::Renderer::WriteImage
void WriteImage(const std::string &path, const int height, const int width, const int depth, const unsigned char *data, const bool vertical_revert=true)
Definition
ImageSaver.cpp:13
Botcraft
Definition
BaseNode.hpp:6
botcraft
src
Renderer
ImageSaver.cpp
Generated by
1.9.8