From d0e6525dd1849063d44fc871788fcbd184552974 Mon Sep 17 00:00:00 2001 From: jylam Date: Thu, 28 Aug 2008 13:11:25 +0000 Subject: [PATCH] * Factorized some code and added temporary debug stuff git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@2787 92316355-f0b4-4df1-b90c-862c8a59935f --- pipi/paint/line.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/pipi/paint/line.c b/pipi/paint/line.c index 08a0617..6f385c9 100644 --- a/pipi/paint/line.c +++ b/pipi/paint/line.c @@ -280,12 +280,19 @@ static void draw_antialiased_line_float(pipi_image_t *img, struct line* s) /* Is that an horrible mess ? Yes, it is. */ #undef PLOT #define PLOT(x, y, c) \ - s->buf_f[(((int)(x)*4))+((int)(y))*(img->w*4)] = \ - (c*s->colorf[0]) + (1-c) * s->buf_f[(((int)(x)*4))+((int)(y))*(img->w*4)]; \ - s->buf_f[(1+((int)(x)*4))+((int)(y))*(img->w*4)] = \ - (c*s->colorf[1]) + (1-c) * s->buf_f[(1+((int)(x)*4))+((int)(y))*(img->w*4)]; \ - s->buf_f[(2+((int)(x)*4))+((int)(y))*(img->w*4)] = \ - (c*s->colorf[2]) + (1-c) * s->buf_f[(2+((int)(x)*4))+((int)(y))*(img->w*4)]; + { int qwer = (((int)(x)*4))+((int)(y))*(img->w*4);\ + int qweg = (1+((int)(x)*4))+((int)(y))*(img->w*4); \ + int qweb = (2+((int)(x)*4))+((int)(y))*(img->w*4); \ + s->buf_f[qwer] = (c*s->colorf[0]) + (1-c) * s->buf_f[qwer]; \ + s->buf_f[qweg] = (c*s->colorf[1]) + (1-c) * s->buf_f[qweg]; \ + s->buf_f[qweb] = (c*s->colorf[2]) + (1-c) * s->buf_f[qweb]; \ + if(s->buf_f[qwer] > 0.8f) s->buf_f[qwer] = 0.8f; /* DEBUG LOL !*/ \ + if(s->buf_f[qwer] < 0.2f) s->buf_f[qwer] = 0.2f; \ + if(s->buf_f[qweg] > 0.8f) s->buf_f[qweg] = 0.8f; \ + if(s->buf_f[qweg] < 0.2f) s->buf_f[qweg] = 0.2f; \ + if(s->buf_f[qweb] > 0.8f) s->buf_f[qweb] = 0.8f; \ + if(s->buf_f[qweb] < 0.2f) s->buf_f[qweb] = 0.2f; \ + } #include "aline_template.h" }