Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
render_to_png_async.cpp File Reference
#include "render_to_png_async.h"
#include "../opengl/gl.h"
#include <igl_stb_image.h>
+ Include dependency graph for render_to_png_async.cpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

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)
 

Function Documentation

◆ 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 //img->flip();
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().

+ Here is the caller graph for this function: