Added tech ENABLE_THUMBNAIL_GENERATOR -> 1st installment of generation of thumbnail from plater (WIP)

This commit is contained in:
Enrico Turri 2019-10-22 16:02:31 +02:00
parent 2d610f9b84
commit 32a42f2808
10 changed files with 231 additions and 0 deletions

View file

@ -0,0 +1,31 @@
#include "libslic3r/libslic3r.h"
#include "ThumbnailData.hpp"
#if ENABLE_THUMBNAIL_GENERATOR
namespace Slic3r {
void ThumbnailData::set(unsigned int w, unsigned int h)
{
if (!pixels.empty())
reset();
if ((w == 0) || (h == 0))
return;
width = w;
height = h;
// defaults to white texture
pixels = std::vector<unsigned char>(width * height * 4, 255);
}
void ThumbnailData::reset()
{
width = 0;
height = 0;
pixels.clear();
}
} // namespace Slic3r
#endif // ENABLE_THUMBNAIL_GENERATOR