mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
Reducing copies when writing png data.
This commit is contained in:
parent
24145cc14f
commit
04e03c840d
6 changed files with 88 additions and 12 deletions
|
@ -3,11 +3,18 @@
|
|||
|
||||
#include <ostream>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
class ExPolygon;
|
||||
|
||||
// Raw byte buffer paired with its size. Suitable for compressed PNG data.
|
||||
struct RawBytes {
|
||||
std::unique_ptr<std::uint8_t> buffer = nullptr;
|
||||
size_t size = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Raster captures an anti-aliased monochrome canvas where vectorial
|
||||
* polygons can be rasterized. Fill color is always white and the background is
|
||||
|
@ -87,6 +94,8 @@ public:
|
|||
|
||||
/// Save the raster on the specified stream.
|
||||
void save(std::ostream& stream, Compression comp = Compression::RAW);
|
||||
|
||||
RawBytes save(Compression comp = Compression::RAW);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue