Fixed the bug of thumbnail mirroring

This commit is contained in:
QIDI TECH
2023-06-28 13:47:18 +08:00
parent 297fda6005
commit 5e03535305
2 changed files with 27 additions and 24 deletions

View File

@@ -59,7 +59,7 @@ std::string compress_qidi_thumbnail_png(const ThumbnailData &data)
std::vector<uint8_t> rgba_pixels(data.pixels.size() * 4);
size_t row_size = width * 4;
for (size_t y = 0; y <height; ++y)
memcpy(rgba_pixels.data() + (height - y - 1) * row_size,
memcpy(rgba_pixels.data() + y * row_size,
data.pixels.data() + y * row_size, row_size);
const unsigned char *pixels;
pixels = (const unsigned char *) rgba_pixels.data();
@@ -68,12 +68,13 @@ std::string compress_qidi_thumbnail_png(const ThumbnailData &data)
int time = width * height-1; // 200*200-1;
for (unsigned int r = 0; r < height; ++r) {
unsigned int rr = (height - 1 - r) * width;
unsigned int rr = r * width;
for (unsigned int c = 0; c < width; ++c) {
rrrr = int(pixels[4 * (rr + c) + 0]) >> 3;
gggg = int(pixels[4 * (rr + c) + 1]) >> 2;
bbbb = int(pixels[4 * (rr + c) + 2]) >> 3;
aaaa = int(pixels[4 * (rr + c) + 3]);
unsigned int cc = width - c -1;
rrrr = int(pixels[4 * (rr + cc) + 0]) >> 3;
gggg = int(pixels[4 * (rr + cc) + 1]) >> 2;
bbbb = int(pixels[4 * (rr + cc) + 2]) >> 3;
aaaa = int(pixels[4 * (rr + cc) + 3]);
if (aaaa == 0) {
rrrr = 239 >> 3;
gggg = 243 >> 2;

View File

@@ -3471,6 +3471,7 @@ void Plater::priv::export_gcode(fs::path output_path, bool output_path_on_remova
this->restart_background_process(priv::UPDATE_BACKGROUND_PROCESS_FORCE_EXPORT);
//Y6 PrintHint
if(wxGetApp().get_mode() == comSimple) {
std::string filament_type;
bool ShowPrintHint = false;
const PrintStatistics& ps = this->fff_print.print_statistics();
@@ -3494,6 +3495,7 @@ void Plater::priv::export_gcode(fs::path output_path, bool output_path_on_remova
notification_manager->push_notification(message);
}
}
}
unsigned int Plater::priv::update_restart_background_process(bool force_update_scene, bool force_update_preview)
{