#include "render_to_png_async.h"
#include "../opengl/gl.h"
#include <igl_stb_image.h>
Go to the source code of this file.
◆ render_to_png_async_helper()
| static IGL_INLINE bool render_to_png_async_helper |
( |
unsigned char * |
img, |
|
|
int |
width, |
|
|
int |
height, |
|
|
const std::string |
png_file, |
|
|
const bool |
alpha, |
|
|
const bool |
fast |
|
) |
| |
|
static |
17{
18
19 if(!alpha)
20 {
21 for(
int i = 0;i<
width;i++)
22 for(
int j = 0;j<
height;j++)
23 {
24 img[4*(i+j*
width)+3] = 255;
25 }
26 }
27
28 bool ret = igl::stbi_write_png(png_file.c_str(), width, height, 4, img, width*sizeof(unsigned char));
29 delete [] img;
30 return ret;
31}
coord_t width(const BoundingBox &box)
Definition Arrange.cpp:539
coord_t height(const BoundingBox &box)
Definition Arrange.cpp:540
Referenced by igl::png::render_to_png_async().