This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via 52bed540fa7128ba565a2a6ab8bb3f91674c04d1 (commit) via 7949b70ee58a7ce28bf21767e1b29efe56ef68e0 (commit) via 076239276ea6205aaf69d5338bfd529d40592c4b (commit) via 2954919a806b005e125f1bc08542dc38f94138c8 (commit) via 504c3a5c6858d9af39bc640b2a16638b984226a7 (commit) via 150058b75f541d901eda178e485d65112ab77e5b (commit) via cb293ded8c994e9df465ad5af0b0777def55f680 (commit) from 89d86e0b6926dd8f6a5f650a89920e104ea52b00 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/52bed540fa7128ba565a2a6ab8bb3f91674c0...
commit 52bed540fa7128ba565a2a6ab8bb3f91674c04d1 Author: Cyril Hrubis metan@ucw.cz Date: Sun Feb 5 23:42:39 2012 +0100
gfx: Experimental AA line.
* Doesn't do corner cases * The arithmetics is off (looses precision soon)
diff --git a/libs/gfx/GP_LineAA.gen.c.t b/libs/gfx/GP_LineAA.gen.c.t new file mode 100644 index 0000000..4f08298 --- /dev/null +++ b/libs/gfx/GP_LineAA.gen.c.t @@ -0,0 +1,85 @@ +%% extends "base.c.t" + +{% block descr %}Anti Aliased Line{% endblock %} + +%% block body + +#include "core/GP_Context.h" +#include "core/GP_MixPixels.h" +#include "core/GP_FixedPoint.h" +#include "core/GP_GammaCorrection.h" + +#include "gfx/GP_HLine.h" +#include "gfx/GP_VLine.h" + +#define FP_TO_PERC(a) (GP_FP_ROUND_TO_INT((a) * 255)) + +void GP_LineAA(GP_Context *context, GP_Coord x1, GP_Coord y1, + GP_Coord x2, GP_Coord y2, GP_Pixel pixel) +{ + GP_Coord dx = x2 - x1; + GP_Coord dy = y2 - y1; + + if (dy == 0) { + //TODO!!! + //GP_HLine_Raw(context, GP_FP_ROUND_TO_INT(x1), GP_FP_ROUND_TO_INT(x2), + // GP_FP_ROUND_TO_INT(y1), pixel); + return; + } + + if (dx == 0) { + //TODO!!! + //GP_VLine(context, GP_FP_ROUND_TO_INT(x1), GP_FP_ROUND_TO_INT(y1), + // GP_FP_ROUND_TO_INT(y2), pixel); + return; + } + + if (GP_ABS(dx) < GP_ABS(dy)) { + GP_SWAP(x1, y1); + GP_SWAP(x2, y2); + GP_SWAP(dx, dy); + //TODO + return; + } + + if (x2 < x1) { + GP_SWAP(x1, x2); + GP_SWAP(y1, y2); + } + + GP_Coord grad = GP_FP_DIV(dy, dx); + + GP_Coord xend, yend, xgap, xpx1, ypx1, xpx2, ypx2; + + xend = GP_FP_ROUND(x1); + yend = y1 + GP_FP_MUL(grad, xend - x1); + xgap = GP_FP_RFRAC(x1 + GP_FP_1_2); + xpx1 = GP_FP_TO_INT(xend); + ypx1 = GP_FP_TO_INT(yend); + + GP_MixPixel_Raw_Clipped(context, xpx1, ypx1, pixel, FP_TO_PERC(GP_FP_MUL(GP_FP_RFRAC(yend), xgap))); + GP_MixPixel_Raw_Clipped(context, xpx1, ypx1 + 1, pixel, FP_TO_PERC(GP_FP_MUL(GP_FP_FRAC(yend), xgap))); + + GP_Coord intery = yend + grad; + + xend = GP_FP_ROUND(x2); + yend = y2 + GP_FP_MUL(grad, xend - x2); + xgap = GP_FP_FRAC(x2 + GP_FP_1_2); + xpx2 = GP_FP_TO_INT(xend); + ypx2 = GP_FP_TO_INT(yend); + + GP_MixPixel_Raw_Clipped(context, xpx2, ypx2, pixel, FP_TO_PERC(GP_FP_MUL(GP_FP_RFRAC(yend), xgap))); + GP_MixPixel_Raw_Clipped(context, xpx2, ypx2 + 1, pixel, FP_TO_PERC(GP_FP_MUL(GP_FP_RFRAC(yend), xgap))); + + GP_Coord x; + + for (x = xpx1 + 1; x < xpx2; x++) { + GP_MixPixel_Raw_Clipped(context, x, GP_FP_TO_INT(intery), pixel, FP_TO_PERC(GP_FP_RFRAC(intery))); + GP_MixPixel_Raw_Clipped(context, x, GP_FP_TO_INT(intery) + 1, pixel, FP_TO_PERC(GP_FP_FRAC(intery))); + + intery += grad; + } +} + + +%% endblock body diff --git a/libs/gfx/Makefile b/libs/gfx/Makefile index a3e7da2..64fd479 100644 --- a/libs/gfx/Makefile +++ b/libs/gfx/Makefile @@ -1,5 +1,8 @@ TOPDIR=../.. -CSOURCES=$(shell ls *.c) +CSOURCES=$(filter-out $(wildcard *.gen.c),$(wildcard *.c)) +GENSOURCES=GP_LineAA.gen.c LIBNAME=gfx + +include $(TOPDIR)/gen.mk include $(TOPDIR)/include.mk include $(TOPDIR)/lib.mk
http://repo.or.cz/w/gfxprim.git/commit/7949b70ee58a7ce28bf21767e1b29efe56ef6...
commit 7949b70ee58a7ce28bf21767e1b29efe56ef68e0 Author: Cyril Hrubis metan@ucw.cz Date: Sun Feb 5 23:38:32 2012 +0100
core: MixPixel() use Gamma correction for RGB pixels.
diff --git a/include/core/GP_MixPixels.gen.h.t b/include/core/GP_MixPixels.gen.h.t index f182ee5..ebcaa38 100644 --- a/include/core/GP_MixPixels.gen.h.t +++ b/include/core/GP_MixPixels.gen.h.t @@ -9,15 +9,17 @@ Macros to mix two pixels accordingly to percentage. #include "core/GP_Context.h" #include "core/GP_Pixel.h" #include "core/GP_GetPutPixel.h" +#include "core/GP_GammaCorrection.h"
%% for pt in pixeltypes %% if not pt.is_unknown() + /* * Mixes two {{ pt.name }} pixels. * * The percentage is expected as 8 bit unsigned integer [0 .. 255] */ -#define GP_MIX_PIXELS_{{ pt.name }}(pix1, pix2, perc) ({ +#define GP_MIX_PIXELS_LINEAR_{{ pt.name }}(pix1, pix2, perc) ({ %% for c in pt.chanslist GP_Pixel {{ c[0] }}; @@ -30,6 +32,32 @@ Macros to mix two pixels accordingly to percentage. GP_Pixel_CREATE_{{ pt.name }}({{ pt.chanslist[0][0] }}{% for c in pt.chanslist[1:] %}, {{ c[0] }}{% endfor %}); })
+/* + * Mixes two {{ pt.name }} pixels. + * + * The percentage is expected as 8 bit unsigned integer [0 .. 255] + */ +#define GP_MIX_PIXELS_GAMMA_{{ pt.name }}(pix1, pix2, perc) ({ +%% for c in pt.chanslist + GP_Pixel {{ c[0] }}; ++ {{ c[0] }} = GP_Gamma{{ c[2] }}ToLinear10(GP_Pixel_GET_{{ c[0] }}_{{ pt.name }}(pix1)) * (perc); + {{ c[0] }} += GP_Gamma{{ c[2] }}ToLinear10(GP_Pixel_GET_{{ c[0] }}_{{ pt.name }}(pix2)) * (255 - (perc)); + {{ c[0] }} = ({{ c[0] }} + 128) / 255; + {{ c[0] }} = GP_Linear10ToGamma{{ c[2] }}({{ c[0] }}); ++%% endfor ++ GP_Pixel_CREATE_{{ pt.name }}({{ pt.chanslist[0][0] }}{% for c in pt.chanslist[1:] %}, {{ c[0] }}{% endfor %}); +}) + +#define GP_MIX_PIXELS_{{ pt.name }}(pix1, pix2, perc) +%% if pt.is_rgb() + GP_MIX_PIXELS_GAMMA_{{ pt.name }}(pix1, pix2, perc) +%% else + GP_MIX_PIXELS_LINEAR_{{ pt.name }}(pix1, pix2, perc) +%% endif + %% endif %% endfor
@@ -40,7 +68,7 @@ static inline GP_Pixel GP_MixPixels(GP_Pixel pix1, GP_Pixel pix2, %% for pt in pixeltypes %% if not pt.is_unknown() case GP_PIXEL_{{ pt.name }}: - return GP_MIX_PIXELS_{{ pt.name }}(pix1, pix2, perc); + return GP_MIX_PIXELS_LINEAR_{{ pt.name }}(pix1, pix2, perc); %% endif %% endfor default: @@ -55,7 +83,7 @@ static inline void GP_MixPixel_Raw_{{ pt.name }}(GP_Context *context, GP_Coord x, GP_Coord y, GP_Pixel pixel, uint8_t perc) { GP_Pixel pix = GP_GetPixel_Raw_{{ pt.pixelsize.suffix }}(context, x, y); - pix = GP_MIX_PIXELS_{{ pt.name }}(pixel, pix, perc); + GP_MIX_PIXELS_{{ pt.name }}(pixel, pix, perc); GP_PutPixel_Raw_{{ pt.pixelsize.suffix }}(context, x, y, pix); }
http://repo.or.cz/w/gfxprim.git/commit/076239276ea6205aaf69d5338bfd529d40592...
commit 076239276ea6205aaf69d5338bfd529d40592c4b Author: Cyril Hrubis metan@ucw.cz Date: Sun Feb 5 23:28:59 2012 +0100
core: Add GP_MixPixel().
diff --git a/include/core/GP_MixPixels.gen.h.t b/include/core/GP_MixPixels.gen.h.t index deb6912..f182ee5 100644 --- a/include/core/GP_MixPixels.gen.h.t +++ b/include/core/GP_MixPixels.gen.h.t @@ -6,8 +6,9 @@ Macros to mix two pixels accordingly to percentage.
%% block body
- -#include "GP_Pixel.h" +#include "core/GP_Context.h" +#include "core/GP_Pixel.h" +#include "core/GP_GetPutPixel.h"
%% for pt in pixeltypes %% if not pt.is_unknown() @@ -47,4 +48,65 @@ static inline GP_Pixel GP_MixPixels(GP_Pixel pix1, GP_Pixel pix2, } }
+ +%% for pt in pixeltypes +%% if not pt.is_unknown() +static inline void GP_MixPixel_Raw_{{ pt.name }}(GP_Context *context, + GP_Coord x, GP_Coord y, GP_Pixel pixel, uint8_t perc) +{ + GP_Pixel pix = GP_GetPixel_Raw_{{ pt.pixelsize.suffix }}(context, x, y); + pix = GP_MIX_PIXELS_{{ pt.name }}(pixel, pix, perc); + GP_PutPixel_Raw_{{ pt.pixelsize.suffix }}(context, x, y, pix); +} + +%% endif +%% endfor + +%% for pt in pixeltypes +%% if not pt.is_unknown() +static inline void GP_MixPixel_Raw_Clipped_{{ pt.name }}(GP_Context *context, + GP_Coord x, GP_Coord y, GP_Pixel pixel, uint8_t perc) +{ + if (GP_PIXEL_IS_CLIPPED(context, x, y)) + return; + + GP_MixPixel_Raw_{{ pt.name }}(context, x, y, pixel, perc); +} + +%% endif +%% endfor + +static inline void GP_MixPixel_Raw(GP_Context *context, GP_Coord x, GP_Coord y, + GP_Pixel pixel, uint8_t perc) +{ + switch (context->pixel_type) { +%% for pt in pixeltypes +%% if not pt.is_unknown() + case GP_PIXEL_{{ pt.name }}: + GP_MixPixel_Raw_{{ pt.name }}(context, x, y, pixel, perc); + break; +%% endif +%% endfor + default: + GP_ABORT("Unknown pixeltype"); + } +} + +static inline void GP_MixPixel_Raw_Clipped(GP_Context *context, + GP_Coord x, GP_Coord y, + GP_Pixel pixel, uint8_t perc) +{ + switch (context->pixel_type) { +%% for pt in pixeltypes +%% if not pt.is_unknown() + case GP_PIXEL_{{ pt.name }}: + GP_MixPixel_Raw_Clipped_{{ pt.name }}(context, x, y, pixel, perc); + break; +%% endif +%% endfor + default: + GP_ABORT("Unknown pixeltype"); + } +} + %% endblock body
http://repo.or.cz/w/gfxprim.git/commit/2954919a806b005e125f1bc08542dc38f9413...
commit 2954919a806b005e125f1bc08542dc38f94138c8 Author: Cyril Hrubis metan@ucw.cz Date: Sun Feb 5 23:03:08 2012 +0100
core: Add fixed point operations.
diff --git a/include/core/GP_FixedPoint.h b/include/core/GP_FixedPoint.h index d8556d9..33029ad 100644 --- a/include/core/GP_FixedPoint.h +++ b/include/core/GP_FixedPoint.h @@ -72,6 +72,16 @@ typedef uint8_t GP_FP_Frac; #define GP_FP_SUB(a, b) ((a)-(b))
/* + * Multiplication, may overflow. + */ +#define GP_FP_MUL(a, b) ((((a) * (b)) + GP_FP_1_2)>>GP_FP_FRAC_BITS) + +/* + * Division, may overflow + */ +#define GP_FP_DIV(a, b) ((((a)<<GP_FP_FRAC_BITS) + GP_FP_1_2) / (b)) + +/* * Floor. */ #define GP_FP_FLOOR(a) ((a) & GP_FP_INT_MASK) @@ -79,7 +89,8 @@ typedef uint8_t GP_FP_Frac; /* * Floor with conversion to integer. */ -#define GP_FP_FLOOR_TO_INT(a) ((a)>>GP_FP_FRAC_BITS) +#define GP_FP_TO_INT(a) ((a)>>GP_FP_FRAC_BITS) +#define GP_FP_FLOOR_TO_INT(a) GP_FP_TO_INT(a)
/* * Ceiling. @@ -92,9 +103,14 @@ typedef uint8_t GP_FP_Frac; #define GP_FP_CEIL_TO_INT(a) (((a)>>GP_FP_FRAC_BITS) + !!(GP_FP_FRAC(a)))
/* - * Rounding wiht conversion to integer. + * Rounding. */ -#define GP_FP_ROUND_TO_INT(a) (((a) + GP_FP_1_2))>>GP_FP_FRAC_BITS +#define GP_FP_ROUND(a) GP_FP_FLOOR((a) + GP_FP_1_2) + +/* + * Rounding with conversion to integer. + */ +#define GP_FP_ROUND_TO_INT(a) ((((a) + GP_FP_1_2))>>GP_FP_FRAC_BITS)
/* * Fractional part. @@ -102,6 +118,11 @@ typedef uint8_t GP_FP_Frac; #define GP_FP_FRAC(a) ((a) & GP_FP_FRAC_MASK)
/* + * Reverse fractional part 1 - frac(x) + */ +#define GP_FP_RFRAC(a) (GP_FP_1 - GP_FP_FRAC(a)) + +/* * Returns an float. */ #define GP_FP_TO_FLOAT(a) (((float)(a))/((float)GP_FP_1))
http://repo.or.cz/w/gfxprim.git/commit/504c3a5c6858d9af39bc640b2a16638b98422...
commit 504c3a5c6858d9af39bc640b2a16638b984226a7 Author: Cyril Hrubis metan@ucw.cz Date: Sun Feb 5 22:12:19 2012 +0100
core: Redo gamma correction.
diff --git a/include/core/GP_GammaCorrection.gen.h.t b/include/core/GP_GammaCorrection.gen.h.t new file mode 100644 index 0000000..b2d0b26 --- /dev/null +++ b/include/core/GP_GammaCorrection.gen.h.t @@ -0,0 +1,27 @@ +%% extends "base.h.t" + +{% block descr %}Gamma corrections.{% endblock %} + +%% block body + + +extern uint16_t *GP_Gamma8_Linear10; +extern uint8_t *GP_Linear10_Gamma8; + +%% for i in range(1, 9) +static inline uint16_t GP_Gamma{{ i }}ToLinear10(uint8_t val) +{ + return GP_Gamma8_Linear10[val<<{{8 - i}}]; +} + +%% endfor + +%% for i in range(1, 9) +static inline uint8_t GP_Linear10ToGamma{{ i }}(uint16_t val) +{ + return (GP_Linear10_Gamma8[val] + {{ int(2 ** (7 - i))}})>>{{8 - i}}; +} + +%% endfor + +%% endblock body diff --git a/include/core/GP_GammaCorrection.h b/include/core/GP_GammaCorrection.h index d7d9d9c..e06ab9a 100644 --- a/include/core/GP_GammaCorrection.h +++ b/include/core/GP_GammaCorrection.h @@ -60,19 +60,7 @@ #define CORE_GP_GAMMA_CORRECTION_H
#include <stdint.h> -#include <math.h>
-extern uint8_t *GP_LinearToGamma_8bit; - -/* - * Coverts linear 0 255 value into 0 255 gama value. - * - * (this is used for Anti Aliased gfx primitives.) - */ -static inline uint8_t GP_LinearToGamma(uint8_t val) -{ - - return GP_LinearToGamma_8bit[val]; -} +#include "core/GP_GammaCorrection.gen.h"
#endif /* CORE_GP_GAMMA_CORRECTION_H */ diff --git a/include/core/Makefile b/include/core/Makefile index 48eb3d2..c9be7d8 100644 --- a/include/core/Makefile +++ b/include/core/Makefile @@ -1,7 +1,7 @@ TOPDIR=../.. GENHEADERS=GP_Convert_Scale.gen.h GP_Blit.gen.h GP_Pixel.gen.h GP_GetPutPixel.gen.h GP_Convert.gen.h GP_FnPerBpp.gen.h - GP_MixPixels.gen.h + GP_MixPixels.gen.h GP_GammaCorrection.gen.h LIBNAME=core include $(TOPDIR)/gen.mk include $(TOPDIR)/include.mk diff --git a/libs/core/GP_GammaCorrection.gen.c.t b/libs/core/GP_GammaCorrection.gen.c.t index 0fdd467..4b1a23e 100644 --- a/libs/core/GP_GammaCorrection.gen.c.t +++ b/libs/core/GP_GammaCorrection.gen.c.t @@ -13,18 +13,27 @@ #include <stdint.h>
/* - * 8-bit linear to gamma translation table. + * Converts 8 bit gamma to 10 bit linear. */ -static uint8_t linear_to_gamma_8bit[] = { +static uint16_t gamma8_linear10[] = { %% for i in range(0, 256) - {{ int(((float(i)/255) ** (1/2.2)) * 255 + 0.5) }}, /* {{i}} */ + {{ int(((float(i)/255) ** 2.2) * 1024 + 0.5) }}, /* {{i}} */ %% endfor };
/* - * Pointer to 8 bit translation table. + * Converts 10 bit linear to 8 bit gamma. */ -uint8_t *GP_LinearToGamma_8bit = linear_to_gamma_8bit; +static uint8_t linear10_gamma8[] = { +%% for i in range(0, 1025) + {{ int(((float(i)/1024) ** (1/2.2)) * 255 + 0.5) }}, /* {{i}} */ +%% endfor +};
+/* + * Pointers to tables + */ +uint16_t *GP_Gamma8_Linear10 = gamma8_linear10; +uint8_t *GP_Linear10_Gamma8 = linear10_gamma8;
%% endblock body diff --git a/libs/gfx/GP_RectAA.c b/libs/gfx/GP_RectAA.c index a48d72e..812c6bd 100644 --- a/libs/gfx/GP_RectAA.c +++ b/libs/gfx/GP_RectAA.c @@ -53,7 +53,7 @@ void GP_FillRectXYXY_AA_Raw(GP_Context *context, GP_Coord x0, GP_Coord y0,
/* Special case, vertical 1px line */ if (out_x0 == out_x1) { - uint8_t mix = GP_LinearToGamma(w); + uint8_t mix = w; GP_Coord i;
/* Special case 1px 100% width line */ @@ -71,7 +71,7 @@ void GP_FillRectXYXY_AA_Raw(GP_Context *context, GP_Coord x0, GP_Coord y0,
/* Special case, horizontal 1px line */ if (out_y0 == out_y1) { - uint8_t mix = GP_LinearToGamma(h); + uint8_t mix = w; GP_Coord i; /* Special case 1px 100% height line */ @@ -105,7 +105,7 @@ void GP_FillRectXYXY_AA_Raw(GP_Context *context, GP_Coord x0, GP_Coord y0,
/* if the outer and innter coordinates doesn't match, draw blurred edge */ if (in_y0 != out_y0) { - uint8_t mix = GP_LinearToGamma(GP_FP_FROM_INT(in_y0) + GP_FP_1_2 - y0); + uint8_t mix = GP_FP_FROM_INT(in_y0) + GP_FP_1_2 - y0; GP_Coord i; for (i = out_x0; i <= out_x1; i++) { @@ -116,7 +116,7 @@ void GP_FillRectXYXY_AA_Raw(GP_Context *context, GP_Coord x0, GP_Coord y0, } if (in_y1 != out_y1) { - uint8_t mix = GP_LinearToGamma(y1 - GP_FP_FROM_INT(in_y0) - GP_FP_1_2); + uint8_t mix = y1 - GP_FP_FROM_INT(in_y0) - GP_FP_1_2; GP_Coord i; for (i = out_x0; i <= out_x1; i++) { @@ -127,7 +127,7 @@ void GP_FillRectXYXY_AA_Raw(GP_Context *context, GP_Coord x0, GP_Coord y0, }
if (in_x0 != out_x0) { - uint8_t mix = GP_LinearToGamma(GP_FP_FROM_INT(in_x0) + GP_FP_1_2 - x0); + uint8_t mix = GP_FP_FROM_INT(in_x0) + GP_FP_1_2 - x0; GP_Coord i; for (i = out_y0; i <= out_y1; i++) { @@ -138,7 +138,7 @@ void GP_FillRectXYXY_AA_Raw(GP_Context *context, GP_Coord x0, GP_Coord y0, }
if (in_x1 != out_x1) { - uint8_t mix = GP_LinearToGamma(x1 - GP_FP_FROM_INT(in_x1) - GP_FP_1_2); + uint8_t mix = x1 - GP_FP_FROM_INT(in_x1) - GP_FP_1_2; GP_Coord i; for (i = out_y0; i <= out_y1; i++) {
http://repo.or.cz/w/gfxprim.git/commit/150058b75f541d901eda178e485d65112ab77...
commit 150058b75f541d901eda178e485d65112ab77e5b Author: Cyril Hrubis metan@ucw.cz Date: Sun Feb 5 19:39:06 2012 +0100
gfx: Fix includes
* Include only needed files
diff --git a/libs/gfx/GP_Arc.c b/libs/gfx/GP_Arc.c index 094497d..ac0360a 100644 --- a/libs/gfx/GP_Arc.c +++ b/libs/gfx/GP_Arc.c @@ -19,13 +19,15 @@ * Copyright (C) 2009-2011 Jiri "BlueBear" Dluhos * * jiri.bluebear.dluhos@gmail.com * * * - * Copyright (C) 2009-2011 Cyril Hrubis metan@ucw.cz * + * Copyright (C) 2009-2012 Cyril Hrubis metan@ucw.cz * * * *****************************************************************************/
-#include "GP_Gfx.h" +#include "core/GP_GetPutPixel.h" #include "core/GP_FnPerBpp.h"
+#include "gfx/GP_Arc.h" + #include "algo/Arc.algo.h"
/* Generate drawing functions for various bit depths. */ diff --git a/libs/gfx/GP_Circle.c b/libs/gfx/GP_Circle.c index 0cfc88f..66e63c5 100644 --- a/libs/gfx/GP_Circle.c +++ b/libs/gfx/GP_Circle.c @@ -19,13 +19,16 @@ * Copyright (C) 2009-2011 Jiri "BlueBear" Dluhos * * jiri.bluebear.dluhos@gmail.com * * * - * Copyright (C) 2009-2011 Cyril Hrubis metan@ucw.cz * + * Copyright (C) 2009-2012 Cyril Hrubis metan@ucw.cz * * * *****************************************************************************/
-#include "GP_Gfx.h" +#include "core/GP_GetPutPixel.h" #include "core/GP_FnPerBpp.h"
+#include "gfx/GP_Circle.h" +#include "gfx/GP_HLine.h" + #include "algo/Circle.algo.h"
/* Generate drawing functions for various bit depths. */ diff --git a/libs/gfx/GP_CircleSeg.c b/libs/gfx/GP_CircleSeg.c index 512699e..4d7dc19 100644 --- a/libs/gfx/GP_CircleSeg.c +++ b/libs/gfx/GP_CircleSeg.c @@ -23,12 +23,12 @@ * * *****************************************************************************/
-#include "GP_CircleSeg.h" -#include "GP_HLine.h" - #include "core/GP_GetPutPixel.h" #include "core/GP_FnPerBpp.h"
+#include "gfx/GP_CircleSeg.h" +#include "gfx/GP_HLine.h" + #include "algo/CircleSeg.algo.h"
static uint8_t transform_segments(GP_Context *context, uint8_t seg_flags) diff --git a/libs/gfx/GP_Ellipse.c b/libs/gfx/GP_Ellipse.c index b416906..a41ca5f 100644 --- a/libs/gfx/GP_Ellipse.c +++ b/libs/gfx/GP_Ellipse.c @@ -19,13 +19,16 @@ * Copyright (C) 2009-2011 Jiri "BlueBear" Dluhos * * jiri.bluebear.dluhos@gmail.com * * * - * Copyright (C) 2009-2011 Cyril Hrubis metan@ucw.cz * + * Copyright (C) 2009-2012 Cyril Hrubis metan@ucw.cz * * * *****************************************************************************/
-#include "GP_Gfx.h" +#include "core/GP_GetPutPixel.h" #include "core/GP_FnPerBpp.h"
+#include "gfx/GP_Ellipse.h" +#include "gfx/GP_HLine.h" + #include "algo/Ellipse.algo.h"
/* Generate drawing functions for various bit depths. */ diff --git a/libs/gfx/GP_HLine.c b/libs/gfx/GP_HLine.c index 38200d5..e9daf45 100644 --- a/libs/gfx/GP_HLine.c +++ b/libs/gfx/GP_HLine.c @@ -19,13 +19,18 @@ * Copyright (C) 2009-2011 Jiri "BlueBear" Dluhos * * jiri.bluebear.dluhos@gmail.com * * * - * Copyright (C) 2009-2011 Cyril Hrubis metan@ucw.cz * + * Copyright (C) 2009-2012 Cyril Hrubis metan@ucw.cz * * * *****************************************************************************/
-#include "GP_Gfx.h" -#include "algo/HLine.algo.h" #include "core/GP_FnPerBpp.h" +#include "core/GP_WritePixel.h" +#include "core/GP_Transform.h" + +#include "algo/HLine.algo.h" + +#include "gfx/GP_HLine.h" +#include "gfx/GP_VLine.h"
/* Generate drawing functions for various bit depths. */
diff --git a/libs/gfx/GP_Line.c b/libs/gfx/GP_Line.c index 947a337..62db8a7 100644 --- a/libs/gfx/GP_Line.c +++ b/libs/gfx/GP_Line.c @@ -19,13 +19,15 @@ * Copyright (C) 2009-2010 Jiri "BlueBear" Dluhos * * jiri.bluebear.dluhos@gmail.com * * * - * Copyright (C) 2009-2011 Cyril Hrubis metan@ucw.cz * + * Copyright (C) 2009-2012 Cyril Hrubis metan@ucw.cz * * * *****************************************************************************/
-#include "GP_Gfx.h" +#include "core/GP_GetPutPixel.h" #include "core/GP_FnPerBpp.h"
+#include "gfx/GP_Line.h" + #include "algo/Line.algo.h"
/* Generate drawing functions for various bit depths. */ diff --git a/libs/gfx/GP_PartialEllipse.c b/libs/gfx/GP_PartialEllipse.c index 5415a58..964bf93 100644 --- a/libs/gfx/GP_PartialEllipse.c +++ b/libs/gfx/GP_PartialEllipse.c @@ -23,9 +23,11 @@ * * *****************************************************************************/
-#include "GP_Gfx.h" +#include "core/GP_GetPutPixel.h" #include "core/GP_FnPerBpp.h"
+#include "gfx/GP_Ellipse.h" + #include "algo/PartialEllipse.algo.h"
/* Generate drawing functions for various bit depths. */ @@ -50,4 +52,4 @@ void GP_PartialEllipse(GP_Context *context, GP_Coord xcenter, GP_Coord ycenter, GP_TRANSFORM_SWAP(context, a, b);
GP_PartialEllipse_Raw(context, xcenter, ycenter, a, b, start, end, pixel); -} No newline at end of file +} diff --git a/libs/gfx/GP_Polygon.c b/libs/gfx/GP_Polygon.c index fa82216..328e7fa 100644 --- a/libs/gfx/GP_Polygon.c +++ b/libs/gfx/GP_Polygon.c @@ -19,11 +19,12 @@ * Copyright (C) 2009-2011 Jiri "BlueBear" Dluhos * * jiri.bluebear.dluhos@gmail.com * * * - * Copyright (C) 2009-2011 Cyril Hrubis metan@ucw.cz * + * Copyright (C) 2009-2012 Cyril Hrubis metan@ucw.cz * * * *****************************************************************************/
-#include "GP_Gfx.h" +#include "gfx/GP_Polygon.h" +#include "gfx/GP_HLine.h"
#include <limits.h> #include <stdlib.h> diff --git a/libs/gfx/GP_Rect.c b/libs/gfx/GP_Rect.c index 5e8fbc7..9c30385 100644 --- a/libs/gfx/GP_Rect.c +++ b/libs/gfx/GP_Rect.c @@ -19,11 +19,15 @@ * Copyright (C) 2009-2011 Jiri "BlueBear" Dluhos * * jiri.bluebear.dluhos@gmail.com * * * - * Copyright (C) 2009-2011 Cyril Hrubis metan@ucw.cz * + * Copyright (C) 2009-2012 Cyril Hrubis metan@ucw.cz * * * *****************************************************************************/
-#include "GP_Gfx.h" +#include "core/GP_Transform.h" + +#include "gfx/GP_HLine.h" +#include "gfx/GP_VLine.h" +#include "gfx/GP_Rect.h"
void GP_RectXYXY_Raw(GP_Context *context, GP_Coord x0, GP_Coord y0, GP_Coord x1, GP_Coord y1, GP_Pixel pixel) diff --git a/libs/gfx/GP_Tetragon.c b/libs/gfx/GP_Tetragon.c index 8e31801..e087d12 100644 --- a/libs/gfx/GP_Tetragon.c +++ b/libs/gfx/GP_Tetragon.c @@ -19,11 +19,15 @@ * Copyright (C) 2009-2011 Jiri "BlueBear" Dluhos * * jiri.bluebear.dluhos@gmail.com * * * - * Copyright (C) 2009-2011 Cyril Hrubis metan@ucw.cz * + * Copyright (C) 2009-2012 Cyril Hrubis metan@ucw.cz * * * *****************************************************************************/
-#include "GP_Gfx.h" +#include "core/GP_Transform.h" + +#include "gfx/GP_Line.h" +#include "gfx/GP_Polygon.h" +#include "gfx/GP_Tetragon.h"
void GP_Tetragon_Raw(GP_Context *context, GP_Coord x0, GP_Coord y0, GP_Coord x1, GP_Coord y1, GP_Coord x2, GP_Coord y2, diff --git a/libs/gfx/GP_Triangle.c b/libs/gfx/GP_Triangle.c index 863c9b0..724e407 100644 --- a/libs/gfx/GP_Triangle.c +++ b/libs/gfx/GP_Triangle.c @@ -19,11 +19,15 @@ * Copyright (C) 2009-2011 Jiri "BlueBear" Dluhos * * jiri.bluebear.dluhos@gmail.com * * * - * Copyright (C) 2009-2011 Cyril Hrubis metan@ucw.cz * + * Copyright (C) 2009-2012 Cyril Hrubis metan@ucw.cz * * * *****************************************************************************/
-#include "GP_Gfx.h" +#include "core/GP_Transform.h" + +#include "gfx/GP_Line.h" +#include "gfx/GP_Polygon.h" +#include "gfx/GP_Triangle.h"
void GP_Triangle_Raw(GP_Context *context, GP_Coord x0, GP_Coord y0, GP_Coord x1, GP_Coord y1, diff --git a/libs/gfx/GP_VLine.c b/libs/gfx/GP_VLine.c index 88cde1e..910033d 100644 --- a/libs/gfx/GP_VLine.c +++ b/libs/gfx/GP_VLine.c @@ -19,13 +19,16 @@ * Copyright (C) 2009-2011 Jiri "BlueBear" Dluhos * * jiri.bluebear.dluhos@gmail.com * * * - * Copyright (C) 2009-2011 Cyril Hrubis metan@ucw.cz * + * Copyright (C) 2009-2012 Cyril Hrubis metan@ucw.cz * * * *****************************************************************************/
-#include "GP_Gfx.h" +#include "core/GP_GetPutPixel.h" #include "core/GP_FnPerBpp.h"
+#include "gfx/GP_VLine.h" +#include "gfx/GP_HLine.h" + #include "algo/VLine.algo.h"
/* Generate drawing functions for various bit depths. */
http://repo.or.cz/w/gfxprim.git/commit/cb293ded8c994e9df465ad5af0b0777def55f...
commit cb293ded8c994e9df465ad5af0b0777def55f680 Author: Cyril Hrubis metan@ucw.cz Date: Sun Feb 5 19:32:20 2012 +0100
gfx: Partial Ellipse, fix warning.
diff --git a/libs/gfx/algo/PartialEllipse.algo.h b/libs/gfx/algo/PartialEllipse.algo.h index b87826e..25ba402 100644 --- a/libs/gfx/algo/PartialEllipse.algo.h +++ b/libs/gfx/algo/PartialEllipse.algo.h @@ -65,4 +65,5 @@ void FN_NAME(CONTEXT_T context, int xcenter, int ycenter, int a, int b, PUTPIXEL(context, xcenter-x, ycenter-y, pixval); } } -} No newline at end of file +} +
-----------------------------------------------------------------------
Summary of changes: include/core/GP_FixedPoint.h | 27 ++++++++- include/core/GP_GammaCorrection.gen.h.t | 27 +++++++++ include/core/GP_GammaCorrection.h | 14 +---- include/core/GP_MixPixels.gen.h.t | 98 +++++++++++++++++++++++++++++- include/core/Makefile | 2 +- libs/core/GP_GammaCorrection.gen.c.t | 19 +++++-- libs/gfx/GP_Arc.c | 6 +- libs/gfx/GP_Circle.c | 7 ++- libs/gfx/GP_CircleSeg.c | 6 +- libs/gfx/GP_Ellipse.c | 7 ++- libs/gfx/GP_HLine.c | 11 +++- libs/gfx/GP_Line.c | 6 +- libs/gfx/GP_LineAA.gen.c.t | 85 ++++++++++++++++++++++++++ libs/gfx/GP_PartialEllipse.c | 6 +- libs/gfx/GP_Polygon.c | 5 +- libs/gfx/GP_Rect.c | 8 ++- libs/gfx/GP_RectAA.c | 12 ++-- libs/gfx/GP_Tetragon.c | 8 ++- libs/gfx/GP_Triangle.c | 8 ++- libs/gfx/GP_VLine.c | 7 ++- libs/gfx/Makefile | 5 +- libs/gfx/algo/PartialEllipse.algo.h | 3 +- 22 files changed, 317 insertions(+), 60 deletions(-) create mode 100644 include/core/GP_GammaCorrection.gen.h.t create mode 100644 libs/gfx/GP_LineAA.gen.c.t
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.