mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-06-06 13:53:05 -04:00
31 lines
539 B
C++
31 lines
539 B
C++
#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
|