mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-25 07:37:37 +08:00
Added some comments and sequential version of png slice export.
This commit is contained in:
parent
835e89f8c1
commit
7fe9a56ef8
@ -1301,8 +1301,10 @@ public:
|
|||||||
void saveLayer(unsigned lyr, const std::string& path);
|
void saveLayer(unsigned lyr, const std::string& path);
|
||||||
};
|
};
|
||||||
|
|
||||||
template<> // Implementation for PNG raster output
|
// Implementation for PNG raster output
|
||||||
class FilePrinter<Print::FilePrinterFormat::PNG> {
|
// Be aware that if a large number of layers are allocated, it can wery well
|
||||||
|
// exhaust the available memory.
|
||||||
|
template<> class FilePrinter<Print::FilePrinterFormat::PNG> {
|
||||||
|
|
||||||
struct Layer {
|
struct Layer {
|
||||||
Raster first;
|
Raster first;
|
||||||
@ -1498,8 +1500,8 @@ void Print::print_to(std::string dirpath,
|
|||||||
}
|
}
|
||||||
|
|
||||||
printer.finishLayer(layer_id); // Finish the layer for later saving it.
|
printer.finishLayer(layer_id); // Finish the layer for later saving it.
|
||||||
// printer.saveLayer(layer_id, dir); We could save the layer immediately
|
|
||||||
|
|
||||||
|
// printer.saveLayer(layer_id, dir); We could save the layer immediately
|
||||||
};
|
};
|
||||||
|
|
||||||
// Print all the layers in parallel
|
// Print all the layers in parallel
|
||||||
@ -1507,6 +1509,9 @@ void Print::print_to(std::string dirpath,
|
|||||||
layers.size(),
|
layers.size(),
|
||||||
process_layer);
|
process_layer);
|
||||||
|
|
||||||
|
// Sequential version (for testing)
|
||||||
|
// for(unsigned l = 0; l < layers.size(); ++l) process_layer(l);
|
||||||
|
|
||||||
// Save the print into the file system.
|
// Save the print into the file system.
|
||||||
printer.save(dir);
|
printer.save(dir);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user