Restored color profile in canvas preview

This commit is contained in:
Michaël Lemaire 2014-08-18 16:33:09 +02:00
parent 9c2d545e6a
commit c9fa33984b
3 changed files with 7 additions and 2 deletions

View file

@ -3,6 +3,7 @@
#include "Color.h"
#include "CanvasLiveClient.h"
#include "Mutex.h"
#include "ColorProfile.h"
#include <cassert>
@ -18,12 +19,14 @@ CanvasPreview::CanvasPreview()
dirty_up = -1;
lock = new Mutex();
profile = new ColorProfile();
}
CanvasPreview::~CanvasPreview()
{
delete [] pixels;
delete lock;
delete profile;
}
void CanvasPreview::setSize(int real_width, int real_height, int preview_width, int preview_height)
@ -77,7 +80,7 @@ void CanvasPreview::updateLive(CanvasLiveClient *client)
{
for (x = dirty_left; x <= dirty_right; x++)
{
client->canvasPainted(x, y, pixels[y * width + x]);
client->canvasPainted(x, y, profile->apply(pixels[y * width + x]));
}
}

View file

@ -36,6 +36,8 @@ private:
int width;
int height;
ColorProfile *profile;
int dirty_left;
int dirty_right;
int dirty_down;

View file

@ -339,7 +339,7 @@ void Rasterizer::renderScanLines(CanvasPortion *canvas, RenderScanlines* scanlin
Color frag_color = *color;
if (cury == starty || cury == endy)
{
frag_color.mask(Color(0.0, 0.0, 0.0, 0.1));
frag_color.mask(Color(0.0, 0.0, 0.0, 0.3));
}
fragment.setColor(frag_color);