mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 23:06:13 +08:00
Fix unused warning:
../src/slic3r/GUI/Jobs/CreateFontStyleImagesJob.cpp:99:86: warning: lambda capture 'h' is not used [-Wunused-lambda-capture]
This commit is contained in:
parent
d91d13c769
commit
b7f662c311
@ -98,13 +98,15 @@ void CreateFontStyleImagesJob::process(Ctl &ctl)
|
|||||||
// copy rastered data to pixels
|
// copy rastered data to pixels
|
||||||
sla::RasterEncoder encoder = [&offset = image.offset, &pix = pixels, w=width,h=height]
|
sla::RasterEncoder encoder = [&offset = image.offset, &pix = pixels, w=width,h=height]
|
||||||
(const void *ptr, size_t width, size_t height, size_t num_components) {
|
(const void *ptr, size_t width, size_t height, size_t num_components) {
|
||||||
|
size_t size {static_cast<size_t>(w*h)};
|
||||||
assert((offset.x() + width) <= w);
|
assert((offset.x() + width) <= w);
|
||||||
assert((offset.y() + height) <= h);
|
assert((offset.y() + height) <= h);
|
||||||
const unsigned char *ptr2 = (const unsigned char *) ptr;
|
const unsigned char *ptr2 = (const unsigned char *) ptr;
|
||||||
for (size_t x = 0; x < width; ++x)
|
for (size_t x = 0; x < width; ++x)
|
||||||
for (size_t y = 0; y < height; ++y) {
|
for (size_t y = 0; y < height; ++y) {
|
||||||
size_t index = (offset.y() + y)*w + offset.x() + x;
|
size_t index = (offset.y() + y)*w + offset.x() + x;
|
||||||
assert(index < w * h);
|
assert(index < size);
|
||||||
|
if (index >= size) continue;
|
||||||
pix[index] = ptr2[y * width + x];
|
pix[index] = ptr2[y * width + x];
|
||||||
}
|
}
|
||||||
return sla::EncodedRaster();
|
return sla::EncodedRaster();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user