Rasterizer skeleton

This commit is contained in:
tamasmeszaros 2018-05-16 18:51:28 +02:00
parent d9ff63c022
commit e1b9c13024
5 changed files with 184 additions and 49 deletions

View file

@ -0,0 +1,40 @@
#include "Rasterizer.hpp"
#include <png.h>
namespace Slic3r {
class Raster::Impl {
};
Raster::Raster(const Raster::Resolution &r, const Raster::PixelDim &pd):
impl_(new Impl), resolution_(r), pxdim_(pd) {}
Raster::~Raster() {}
Raster::Raster(const Raster &cpy): resolution_(cpy.resolution_),
pxdim_(cpy.pxdim_) {
*impl_ = *(cpy.impl_);
}
Raster::Raster(Raster &&m):
impl_(std::move(m.impl_)), resolution_(m.resolution_), pxdim_(m.pxdim_) {}
void Raster::clear()
{
}
void Raster::draw(const Polygon &poly)
{
png_image ifo;
}
void Raster::finish()
{
}
}

View file

@ -0,0 +1,43 @@
#ifndef RASTERIZER_HPP
#define RASTERIZER_HPP
#include <Polygon.hpp>
namespace Slic3r {
class Raster {
class Impl;
std::unique_ptr<Impl> impl_;
public:
struct Resolution {
unsigned width_px;
unsigned height_px;
inline Resolution(unsigned w, unsigned h): width_px(w), height_px(h) {}
};
struct PixelDim {
double w_mm;
double h_mm;
inline PixelDim(double px_width_mm, double px_height_mm ):
w_mm(px_width_mm), h_mm(px_height_mm) {}
};
inline explicit Raster(const Resolution& r, const PixelDim& pd );
~Raster();
Raster(const Raster& cpy);
Raster(Raster&& m);
void clear();
void draw(const Polygon& poly);
void finish();
private:
Resolution resolution_;
PixelDim pxdim_;
};
}
#endif // RASTERIZER_HPP