Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Slic3r::ThumbnailData Struct Reference

#include <src/libslic3r/GCode/ThumbnailData.hpp>

+ Collaboration diagram for Slic3r::ThumbnailData:

Public Member Functions

 ThumbnailData ()
 
void set (unsigned int w, unsigned int h)
 
void reset ()
 
bool is_valid () const
 

Public Attributes

unsigned int width
 
unsigned int height
 
std::vector< unsigned char > pixels
 

Detailed Description

Constructor & Destructor Documentation

◆ ThumbnailData()

Slic3r::ThumbnailData::ThumbnailData ( )
inline
15{ reset(); }
void reset()
Definition ThumbnailData.cpp:19

References reset().

+ Here is the call graph for this function:

Member Function Documentation

◆ is_valid()

bool Slic3r::ThumbnailData::is_valid ( ) const
27{
28 return (width != 0) && (height != 0) && ((unsigned int)pixels.size() == 4 * width * height);
29}
unsigned int height
Definition ThumbnailData.hpp:12
std::vector< unsigned char > pixels
Definition ThumbnailData.hpp:13
unsigned int width
Definition ThumbnailData.hpp:11

References height, pixels, and width.

Referenced by Slic3r::GUI::GLCanvas3D::_render_thumbnail_framebuffer(), Slic3r::GUI::GLCanvas3D::_render_thumbnail_framebuffer_ext(), Slic3r::GUI::GLCanvas3D::_render_thumbnail_legacy(), and Slic3r::_3MF_Exporter::_save_model_to_file().

+ Here is the caller graph for this function:

◆ reset()

void Slic3r::ThumbnailData::reset ( )
20{
21 width = 0;
22 height = 0;
23 pixels.clear();
24}

References height, pixels, and width.

Referenced by ThumbnailData().

+ Here is the caller graph for this function:

◆ set()

void Slic3r::ThumbnailData::set ( unsigned int  w,
unsigned int  h 
)
6{
7 if ((w == 0) || (h == 0))
8 return;
9
10 if ((width != w) || (height != h))
11 {
12 width = w;
13 height = h;
14 // defaults to white texture
15 pixels = std::vector<unsigned char>(width * height * 4, 255);
16 }
17}

References height, pixels, and width.

Referenced by Slic3r::GUI::GLCanvas3D::_render_thumbnail_framebuffer(), Slic3r::GUI::GLCanvas3D::_render_thumbnail_framebuffer_ext(), and Slic3r::GUI::GLCanvas3D::_render_thumbnail_legacy().

+ Here is the caller graph for this function:

Member Data Documentation

◆ height

◆ pixels

◆ width


The documentation for this struct was generated from the following files: