diff --git a/src/interface/desktop/dialogrender.cpp b/src/interface/desktop/dialogrender.cpp index 71620bf..58293b7 100644 --- a/src/interface/desktop/dialogrender.cpp +++ b/src/interface/desktop/dialogrender.cpp @@ -95,7 +95,6 @@ DialogRender::DialogRender(QWidget *parent, SoftwareCanvasRenderer* renderer): _actions->layout()->addWidget(_save_button); // Connections - connect(this, SIGNAL(progressChanged(double)), this, SLOT(applyProgress(double))); connect(this, SIGNAL(renderEnded()), this, SLOT(applyRenderEnded())); connect(_save_button, SIGNAL(clicked()), this, SLOT(saveRender())); connect(_tonemapping_control, SIGNAL(currentIndexChanged(int)), this, SLOT(toneMappingChanged())); diff --git a/src/render/software/CanvasPictureWriter.cpp b/src/render/software/CanvasPictureWriter.cpp index b0cdb74..b71ace5 100644 --- a/src/render/software/CanvasPictureWriter.cpp +++ b/src/render/software/CanvasPictureWriter.cpp @@ -44,16 +44,19 @@ bool CanvasPictureWriter::saveCanvas(const std::string &filepath) unsigned int CanvasPictureWriter::getPixel(int x, int y) { + Color comp; + if (antialias > 1) { int basex = x * antialias; int basey = y * antialias; double factor = 1.0 / (antialias * antialias); - Color comp = COLOR_BLACK; - for (int ix = 0; ix < antialias; ix++) + comp = COLOR_BLACK; + + for (int iy = 0; iy < antialias; iy++) { - for (int iy = 0; iy < antialias; iy++) + for (int ix = 0; ix < antialias; ix++) { Color col = getRawPixel(basex + ix, basey + iy); comp.r += col.r * factor; @@ -61,13 +64,15 @@ unsigned int CanvasPictureWriter::getPixel(int x, int y) comp.b += col.b * factor; } } - - return profile->apply(comp).to32BitBGRA(); } else { - return profile->apply(getRawPixel(x, y)).to32BitBGRA(); + comp = getRawPixel(x, y); } + + comp = profile->apply(comp); + comp.normalize(); + return comp.to32BitBGRA(); } Color CanvasPictureWriter::getRawPixel(int x, int y)