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 bb4ceb0a3292d5eebec518820141e1690142585d (commit) via 5c4d958af36978c2a964dfd3d3988eee1faf53c8 (commit) from d20e72b9039d42747114efd7fa188d9ae416ab4a (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/bb4ceb0a3292d5eebec518820141e16901425...
commit bb4ceb0a3292d5eebec518820141e1690142585d Author: Cyril Hrubis metan@ucw.cz Date: Sun Apr 21 11:47:09 2013 +0200
gfx: Remove unused and broken GP_Symbol().
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/include/gfx/GP_Gfx.h b/include/gfx/GP_Gfx.h index df86280..f2a1b77 100644 --- a/include/gfx/GP_Gfx.h +++ b/include/gfx/GP_Gfx.h @@ -50,7 +50,6 @@ #include "GP_Ellipse.h" #include "GP_Arc.h" #include "GP_Polygon.h" -#include "GP_Symbol.h"
#include "GP_PutPixelAA.h" #include "GP_VLineAA.h" diff --git a/include/gfx/GP_Symbol.h b/include/gfx/GP_Symbol.h deleted file mode 100644 index 8a9f2df..0000000 --- a/include/gfx/GP_Symbol.h +++ /dev/null @@ -1,63 +0,0 @@ -/***************************************************************************** - * This file is part of gfxprim library. * - * * - * Gfxprim is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Lesser General Public * - * License as published by the Free Software Foundation; either * - * version 2.1 of the License, or (at your option) any later version. * - * * - * Gfxprim is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with gfxprim; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - * Copyright (C) 2009-2011 Jiri "BlueBear" Dluhos * - * jiri.bluebear.dluhos@gmail.com * - * * - * Copyright (C) 2009-2011 Cyril Hrubis metan@ucw.cz * - * * - *****************************************************************************/ - - /* - * Draws a symbol into rectangle. - */ - -#ifndef GP_SYMBOL_H -#define GP_SYMBOL_H - -#include "core/GP_Types.h" - -typedef enum GP_SymbolType { - GP_SYM_TRIANGLE_UP, - GP_SYM_TRIANGLE_DOWN, - GP_SYM_TRIANGLE_LEFT, - GP_SYM_TRIANGLE_RIGHT, - GP_SYM_MAX, -} GP_SymbolType; - -/* Symbol */ - -void GP_Symbol(GP_Context *context, GP_SymbolType sym, - GP_Coord x, GP_Coord y, - GP_Size w, GP_Size h, GP_Pixel pixel); - -void GP_Symbol_Raw(GP_Context *context, GP_SymbolType sym, - GP_Coord x, GP_Coord y, - GP_Size w, GP_Size h, GP_Pixel pixel); - -/* Filled Symbol */ - -void GP_FillSymbol(GP_Context *context, GP_SymbolType sym, - GP_Coord x, GP_Coord y, - GP_Size w, GP_Size h, GP_Pixel pixel); - -void GP_FillSymbol_Raw(GP_Context *context, GP_SymbolType sym, - GP_Coord x, GP_Coord y, - GP_Size w, GP_Size h, GP_Pixel pixel); - -#endif /* GP_SYMBOL_H */ diff --git a/libs/gfx/GP_Symbol.c b/libs/gfx/GP_Symbol.c deleted file mode 100644 index fcf61c7..0000000 --- a/libs/gfx/GP_Symbol.c +++ /dev/null @@ -1,193 +0,0 @@ -/***************************************************************************** - * This file is part of gfxprim library. * - * * - * Gfxprim is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Lesser General Public * - * License as published by the Free Software Foundation; either * - * version 2.1 of the License, or (at your option) any later version. * - * * - * Gfxprim is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with gfxprim; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - * Copyright (C) 2009-2010 Jiri "BlueBear" Dluhos * - * jiri.bluebear.dluhos@gmail.com * - * * - * Copyright (C) 2009-2010 Cyril Hrubis metan@ucw.cz * - * * - *****************************************************************************/ - -#include "GP_Gfx.h" - -#define DO_TRIANGLE_UP(x, y, w, h) - x, y + h, x + w, y + h, x + w/2, y - -#define DO_TRIANGLE_DOWN(x, y, w, h) - x, y, x + w, y, x + w/2, y + h - - -#define DO_TRIANGLE_LEFT(x, y, w, h) - x + w, y, x + w, y + h, x, y + h/2 - - -#define DO_TRIANGLE_RIGHT(x, y, w, h) - x, y, x, y + h, x + w, y + h/2 - -#define DO_TETRAGON_UP(x, y, w, h) - DO_TRIANGLE_UP(x, y, w, h), x + w/2 + 1, y - -#define DO_TETRAGON_DOWN(x, y, w, h) - DO_TRIANGLE_DOWN(x, y, w, h), x + w/2 + 1, y + h - -#define DO_TETRAGON_LEFT(x, y, w, h) - DO_TRIANGLE_LEFT(x, y, w, h), x , y + h/2 + 1 - -#define DO_TETRAGON_RIGHT(x, y, w, h) - DO_TRIANGLE_RIGHT(x, y, w, h), x + w , y + h/2 + 1 - -#define DO_DECREMENT(a) do { - if ((a) == 0) - return; - (a)--; -} while (0) - -/* - * Generate code for triangle - */ -#define TRIANGLE(context, base, x, y, w, h, fn_pref, - TRIANGLE_PARAMS, TETRAGON_PARAMS, pixel) do { - if (base % 2) - fn_pref##Tetragon(context, TETRAGON_PARAMS(x, y, w, h), pixel);- else - fn_pref##Triangle(context, TRIANGLE_PARAMS(x, y, w, h), pixel);-} while (0) - -#define TRIANGLE_RAW(context, base, x, y, w, h, fn_pref, - TRIANGLE_PARAMS, TETRAGON_PARAMS, pixel) do { - if (base % 2) - fn_pref##Tetragon_Raw(context, TETRAGON_PARAMS(x, y, w, h), pixel);- else - fn_pref##Triangle_Raw(context, TRIANGLE_PARAMS(x, y, w, h), pixel);-} while (0) - -void GP_Symbol_Raw(GP_Context *context, GP_SymbolType sym, - GP_Coord x, GP_Coord y, GP_Size w, GP_Size h, - GP_Pixel pixel) -{ - DO_DECREMENT(w); - DO_DECREMENT(h); - - switch (sym) { - case GP_SYM_TRIANGLE_UP: - TRIANGLE_RAW(context, w, x, y, w, h, GP_, - DO_TRIANGLE_UP, DO_TETRAGON_UP, pixel); - break; - case GP_SYM_TRIANGLE_DOWN: - TRIANGLE_RAW(context, w, x, y, w, h, GP_, - DO_TRIANGLE_DOWN, DO_TETRAGON_DOWN, pixel); - break; - case GP_SYM_TRIANGLE_LEFT: - TRIANGLE_RAW(context, h, x, y, w, h, GP_, - DO_TRIANGLE_LEFT, DO_TETRAGON_LEFT, pixel); - break; - case GP_SYM_TRIANGLE_RIGHT: - TRIANGLE_RAW(context, h, x, y, w, h, GP_, - DO_TRIANGLE_RIGHT, DO_TETRAGON_RIGHT, pixel); - break; - default: - break; - } -} - -void GP_FillSymbol_Raw(GP_Context *context, GP_SymbolType sym, - GP_Coord x, GP_Coord y, GP_Size w, GP_Size h, - GP_Pixel pixel) -{ - DO_DECREMENT(w); - DO_DECREMENT(h); - - switch (sym) { - case GP_SYM_TRIANGLE_UP: - TRIANGLE_RAW(context, w, x, y, w, h, GP_Fill, - DO_TRIANGLE_UP, DO_TETRAGON_UP, pixel); - break; - case GP_SYM_TRIANGLE_DOWN: - TRIANGLE_RAW(context, w, x, y, w, h, GP_Fill, - DO_TRIANGLE_DOWN, DO_TETRAGON_DOWN, pixel); - break; - case GP_SYM_TRIANGLE_LEFT: - TRIANGLE_RAW(context, h, x, y, w, h, GP_Fill, - DO_TRIANGLE_LEFT, DO_TETRAGON_LEFT, pixel); - break; - case GP_SYM_TRIANGLE_RIGHT: - TRIANGLE_RAW(context, h, x, y, w, h, GP_Fill, - DO_TRIANGLE_RIGHT, DO_TETRAGON_RIGHT, pixel); - break; - default: - break; - } -} - -void GP_Symbol(GP_Context *context, GP_SymbolType sym, - GP_Coord x, GP_Coord y, GP_Size w, GP_Size h, - GP_Pixel pixel) -{ - DO_DECREMENT(w); - DO_DECREMENT(h); - - switch (sym) { - case GP_SYM_TRIANGLE_UP: - TRIANGLE(context, w, x, y, w, h, GP_, - DO_TRIANGLE_UP, DO_TETRAGON_UP, pixel); - break; - case GP_SYM_TRIANGLE_DOWN: - TRIANGLE(context, w, x, y, w, h, GP_, - DO_TRIANGLE_DOWN, DO_TETRAGON_DOWN, pixel); - break; - case GP_SYM_TRIANGLE_LEFT: - TRIANGLE(context, h, x, y, w, h, GP_, - DO_TRIANGLE_LEFT, DO_TETRAGON_LEFT, pixel); - break; - case GP_SYM_TRIANGLE_RIGHT: - TRIANGLE(context, h, x, y, w, h, GP_, - DO_TRIANGLE_RIGHT, DO_TETRAGON_RIGHT, pixel); - break; - default: - break; - } -} - -void GP_FillSymbol(GP_Context *context, GP_SymbolType sym, - GP_Coord x, GP_Coord y, - GP_Size w, GP_Size h, GP_Pixel pixel) -{ - DO_DECREMENT(w); - DO_DECREMENT(h); - - switch (sym) { - case GP_SYM_TRIANGLE_UP: - TRIANGLE(context, w, x, y, w, h, GP_Fill, - DO_TRIANGLE_UP, DO_TETRAGON_UP, pixel); - break; - case GP_SYM_TRIANGLE_DOWN: - TRIANGLE(context, w, x, y, w, h, GP_Fill, - DO_TRIANGLE_DOWN, DO_TETRAGON_DOWN, pixel); - break; - case GP_SYM_TRIANGLE_LEFT: - TRIANGLE(context, h, x, y, w, h, GP_Fill, - DO_TRIANGLE_LEFT, DO_TETRAGON_LEFT, pixel); - break; - case GP_SYM_TRIANGLE_RIGHT: - TRIANGLE(context, h, x, y, w, h, GP_Fill, - DO_TRIANGLE_RIGHT, DO_TETRAGON_RIGHT, pixel); - break; - default: - break; - } -} diff --git a/pylib/gfxprim/gfx/gfx.i b/pylib/gfxprim/gfx/gfx.i index 9d3b0c4..e09e633 100644 --- a/pylib/gfxprim/gfx/gfx.i +++ b/pylib/gfxprim/gfx/gfx.i @@ -22,7 +22,6 @@ %include "GP_Ellipse.h" %include "GP_Arc.h" %include "GP_Polygon.h" -%include "GP_Symbol.h"
%include "GP_PutPixelAA.h" %include "GP_VLineAA.h"
http://repo.or.cz/w/gfxprim.git/commit/5c4d958af36978c2a964dfd3d3988eee1faf5...
commit 5c4d958af36978c2a964dfd3d3988eee1faf53c8 Author: Cyril Hrubis metan@ucw.cz Date: Sun Apr 21 11:39:41 2013 +0200
filters: Write correct template for rotate by 180.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/libs/filters/GP_Rotate.c b/libs/filters/GP_Rotate.c index 99fac5b..4adb911 100644 --- a/libs/filters/GP_Rotate.c +++ b/libs/filters/GP_Rotate.c @@ -139,17 +139,6 @@ GP_Context *GP_FilterMirrorVAlloc(const GP_Context *src, return res; }
-int GP_FilterRotate180_Raw(const GP_Context *src, GP_Context *dst, - GP_ProgressCallback *callback) -{ - #warning FIXME: Callbacks, faster algorighm? - - GP_FilterMirrorV_Raw(src, dst, NULL); - GP_FilterMirrorH_Raw(dst, dst, callback); - - return 0; -} - int GP_FilterRotate90(const GP_Context *src, GP_Context *dst, GP_ProgressCallback *callback) { diff --git a/libs/filters/GP_Rotate.gen.c.t b/libs/filters/GP_Rotate.gen.c.t index 709a60d..391d04f 100644 --- a/libs/filters/GP_Rotate.gen.c.t +++ b/libs/filters/GP_Rotate.gen.c.t @@ -61,6 +61,46 @@ int GP_FilterRotate90_Raw(const GP_Context *src, GP_Context *dst, return 1; }
+%% macro swap_pixels(ps, src, dst, x0, y0, x1, y1) + GP_Pixel pix0 = GP_GetPixel_Raw_{{ ps.suffix }}({{ src }}, {{ x0 }}, {{ y0 }}); + GP_Pixel pix1 = GP_GetPixel_Raw_{{ ps.suffix }}({{ src }}, {{ x1 }}, {{ y1 }}); + GP_PutPixel_Raw_{{ ps.suffix }}({{ dst }}, {{ x0 }}, {{ y0 }}, pix1); + GP_PutPixel_Raw_{{ ps.suffix }}({{ dst }}, {{ x1 }}, {{ y1 }}, pix0); +%% endmacro + +%% for ps in pixelsizes +static int GP_FilterRotate180_Raw_{{ ps.suffix }}(const GP_Context *src, GP_Context *dst, + GP_ProgressCallback *callback) +{ + uint32_t x, y; + + GP_DEBUG(1, "Rotating image by 180 %ux%u", src->w, src->h); + + for (x = 0; x < src->w; x++) { + for (y = 0; y < src->h; y++) { + uint32_t xr = src->w - x - 1; + uint32_t yr = src->h - y - 1; + + {{ swap_pixels(ps, 'src', 'dst', 'x', 'y', 'xr', 'yr') }} + } + + if (GP_ProgressCallbackReport(callback, x, src->w, src->h)) + return 1; + } + + GP_ProgressCallbackDone(callback); + return 0; +} + +%% endfor + +int GP_FilterRotate180_Raw(const GP_Context *src, GP_Context *dst, + GP_ProgressCallback *callback) +{ + GP_FN_RET_PER_BPP_CONTEXT(GP_FilterRotate180_Raw, src, src, dst, callback); + return 1; +} + %% for ps in pixelsizes static int GP_FilterRotate270_Raw_{{ ps.suffix }}(const GP_Context *src, GP_Context *dst, GP_ProgressCallback *callback)
-----------------------------------------------------------------------
Summary of changes: include/gfx/GP_Gfx.h | 1 - include/gfx/GP_Symbol.h | 63 ------------- libs/filters/GP_Rotate.c | 11 --- libs/filters/GP_Rotate.gen.c.t | 40 ++++++++ libs/gfx/GP_Symbol.c | 193 ---------------------------------------- pylib/gfxprim/gfx/gfx.i | 1 - 6 files changed, 40 insertions(+), 269 deletions(-) delete mode 100644 include/gfx/GP_Symbol.h delete mode 100644 libs/gfx/GP_Symbol.c
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.