Fix pixel converage calculation in subpixel LCD pixfmt buffer - gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
diff options
context:
space:
mode:
authorFrancesco Abbate <francesco.bbt@gmail.com>2012年06月27日 15:23:28 +0200
committerFrancesco Abbate <francesco.bbt@gmail.com>2012年06月27日 15:23:28 +0200
commitf31d5249020fd59ae6f997c870efa9baac05ca05 (patch)
tree08f9224a1c163655869ec300a83e01d473cb0f4a
parent48eb5ef5254e89892d2eb1457aa2de5b3fd67aa8 (diff)
downloadgsl-shell-f31d5249020fd59ae6f997c870efa9baac05ca05.tar.gz
Fix pixel converage calculation in subpixel LCD pixfmt buffer
Diffstat
-rw-r--r--agg-plot/agg_pixfmt_rgb24_lcd.h 17
1 files changed, 5 insertions, 12 deletions
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;
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月16日 06:20:36 +0000

AltStyle によって変換されたページ (->オリジナル) /