#include #include #include #include #include #ifdef __cplusplus extern "C" { #endif /// Allows utilizing `stl-thumb` from C-like languages /// /// This function renders an image of the file `stl_filename_c` and stores it into the buffer `buf_ptr`. /// /// You must provide a memory buffer large enough to store the image. Images are written in 8-bit RGBA format, /// so the buffer must be at least `width`*`height`*4 bytes in size. `stl_filename_c` is a pointer to a C string with /// the file path. /// /// Returns `true` if succesful and `false` if unsuccesful. /// /// # Example in C /// ```c /// const char* stl_filename_c = "3DBenchy.stl"; /// int width = 256; /// int height = 256; /// /// int img_size = width * height * 4; /// buf_ptr = (uchar *) malloc(img_size); /// /// render_to_buffer(buf_ptr, width, height, stl_filename_c); /// ``` bool render_to_buffer(uint8_t *buf_ptr, uint32_t width, uint32_t height, const char *stl_filename_c); #ifdef __cplusplus } // extern "C" #endif