author | Francesco Abbate <francesco.bbt@gmail.com> | 2012年06月27日 15:23:28 +0200 |
---|---|---|
committer | Francesco Abbate <francesco.bbt@gmail.com> | 2012年06月27日 15:23:28 +0200 |
commit | f31d5249020fd59ae6f997c870efa9baac05ca05 (patch) | |
tree | 08f9224a1c163655869ec300a83e01d473cb0f4a | |
parent | 48eb5ef5254e89892d2eb1457aa2de5b3fd67aa8 (diff) | |
download | gsl-shell-f31d5249020fd59ae6f997c870efa9baac05ca05.tar.gz |
-rw-r--r-- | agg-plot/agg_pixfmt_rgb24_lcd.h | 17 |
diff --git a/agg-plot/agg_pixfmt_rgb24_lcd.h b/agg-plot/agg_pixfmt_rgb24_lcd.h index c7dbbffe..39fbe8c6 100644 --- a/agg-plot/agg_pixfmt_rgb24_lcd.h +++ b/agg-plot/agg_pixfmt_rgb24_lcd.h @@ -27,6 +27,7 @@ #include <string.h>
#include <stdlib.h>
+#include <stdio.h>
#include "agg_basics.h"
#include "agg_color_rgba.h"
@@ -138,18 +139,10 @@ namespace agg for (/* */; cx <= cx_max; cx++)
{
- int alpha = m_lut->convolution(covers, cx, 0, len - 1) * c.a;
- if (alpha)
- {
- if (alpha == 255*255)
- {
- *p = (int8u)rgb[i];
- }
- else
- {
- *p = (int8u)((((rgb[i] - *p) * alpha) + (*p << 16)) >> 16);
- }
- }
+ unsigned c_conv = m_lut->convolution(covers, cx, 0, len - 1);
+ unsigned alpha = (c_conv + 1) * (c.a + 1);
+ unsigned dst_col = rgb[i], src_col = (*p);
+ *p = (int8u)((((dst_col - src_col) * alpha) + (src_col << 16)) >> 16);
p ++;
i = (i + 1) % 3;
|