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 51f403b8ec7418bee0bc1e80fd80136ad9d88586 (commit) from 443c7577a6a1961dde7b5a150e9a3ec25d317260 (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/51f403b8ec7418bee0bc1e80fd80136ad9d88...
commit 51f403b8ec7418bee0bc1e80fd80136ad9d88586 Author: Cyril Hrubis metan@ucw.cz Date: Sun Mar 3 23:43:18 2013 +0100
filters: FilterMirrorH: Small fixes, more to come.
diff --git a/libs/filters/GP_Rotate.c b/libs/filters/GP_Rotate.c index 7bfa309..a164886 100644 --- a/libs/filters/GP_Rotate.c +++ b/libs/filters/GP_Rotate.c @@ -16,14 +16,16 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301 USA * * * - * Copyright (C) 2009-2011 Cyril Hrubis metan@ucw.cz * + * Copyright (C) 2009-2013 Cyril Hrubis metan@ucw.cz * * * *****************************************************************************/
+#include <errno.h> + #include "core/GP_Core.h" #include "core/GP_FnPerBpp.h"
-#include "GP_Rotate.h" +#include "filters/GP_Rotate.h"
#include <string.h>
@@ -32,34 +34,39 @@ int GP_FilterMirrorH_Raw(const GP_Context *src, GP_Context *dst, { uint32_t bpr = src->bytes_per_row; uint8_t buf[bpr]; - uint32_t y; + unsigned int y;
GP_DEBUG(1, "Mirroring image horizontally %ux%u", src->w, src->h);
#warning FIXME: non byte aligned pixels - + /* Note that this should work both for src != dst and src == dst */ for (y = 0; y < src->h/2; y++) { - uint8_t *sl1 = src->pixels + bpr * y; - uint8_t *sl2 = src->pixels + bpr * (src->h - y - 1); - uint8_t *dl1 = dst->pixels + bpr * y; - uint8_t *dl2 = dst->pixels + bpr * (src->h - y - 1); + uint8_t *sl1 = GP_PIXEL_ADDR(src, 0, y); + uint8_t *sl2 = GP_PIXEL_ADDR(src, 0, src->h - y - 1); + uint8_t *dl1 = GP_PIXEL_ADDR(dst, 0, y); + uint8_t *dl2 = GP_PIXEL_ADDR(dst, 0, src->h - y - 1); + + int i;
memcpy(buf, sl1, bpr); memcpy(dl1, sl2, bpr); memcpy(dl2, buf, bpr); - if (GP_ProgressCallbackReport(callback, 2 * y, src->h, src->w)) + if (GP_ProgressCallbackReport(callback, 2 * y, src->h, src->w)) { + GP_DEBUG(1, "Operation aborted"); + errno = ECANCELED; return 1; + } }
/* Copy the middle odd line */ if (src != dst && src->h % 2) { y = src->h / 2;
- uint8_t *sl = src->pixels + bpr * y; - uint8_t *dl = dst->pixels + bpr * y; - + uint8_t *sl = GP_PIXEL_ADDR(src, 0, y); + uint8_t *dl = GP_PIXEL_ADDR(dst, 0, y); + memcpy(dl, sl, bpr); }
@@ -76,10 +83,8 @@ int GP_FilterMirrorH(const GP_Context *src, GP_Context *dst, GP_ASSERT(src->w <= dst->w && src->h <= dst->h, "Destination is not large enough");
- if (GP_FilterMirrorH_Raw(src, dst, callback)) { - GP_DEBUG(1, "Operation aborted"); + if (GP_FilterMirrorH_Raw(src, dst, callback)) return 1; - }
return 0; }
-----------------------------------------------------------------------
Summary of changes: libs/filters/GP_Rotate.c | 35 ++++++++++++++++++++--------------- 1 files changed, 20 insertions(+), 15 deletions(-)
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.