Minor change to SLAPrinter interface

This commit is contained in:
tamasmeszaros 2020-08-04 12:54:21 +02:00
parent 830d89576c
commit 9486901b93
3 changed files with 5 additions and 5 deletions

View File

@ -126,9 +126,9 @@ uqptr<sla::RasterBase> SL1Archive::create_raster() const
return sla::create_raster_grayscale_aa(res, pxdim, gamma, tr); return sla::create_raster_grayscale_aa(res, pxdim, gamma, tr);
} }
sla::EncodedRaster SL1Archive::encode_raster(const sla::RasterBase &rst) const sla::RasterEncoder SL1Archive::get_encoder() const
{ {
return rst.encode(sla::PNGRasterEncoder()); return sla::PNGRasterEncoder{};
} }
void SL1Archive::export_print(Zipper& zipper, void SL1Archive::export_print(Zipper& zipper,

View File

@ -13,7 +13,7 @@ class SL1Archive: public SLAPrinter {
protected: protected:
uqptr<sla::RasterBase> create_raster() const override; uqptr<sla::RasterBase> create_raster() const override;
sla::EncodedRaster encode_raster(const sla::RasterBase &rst) const override; sla::RasterEncoder get_encoder() const override;
public: public:

View File

@ -374,7 +374,7 @@ protected:
std::vector<sla::EncodedRaster> m_layers; std::vector<sla::EncodedRaster> m_layers;
virtual uqptr<sla::RasterBase> create_raster() const = 0; virtual uqptr<sla::RasterBase> create_raster() const = 0;
virtual sla::EncodedRaster encode_raster(const sla::RasterBase &rst) const = 0; virtual sla::RasterEncoder get_encoder() const = 0;
public: public:
virtual ~SLAPrinter() = default; virtual ~SLAPrinter() = default;
@ -389,7 +389,7 @@ public:
[this, &drawfn](sla::EncodedRaster& enc, size_t idx) { [this, &drawfn](sla::EncodedRaster& enc, size_t idx) {
auto rst = create_raster(); auto rst = create_raster();
drawfn(*rst, idx); drawfn(*rst, idx);
enc = encode_raster(*rst); enc = rst->encode(get_encoder());
}); });
} }
}; };