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 ed36869f7b525df87a66c7403485f8ddd8491457 (commit) via 9c0f4f912f97ae75a2de325e2b14a3cdde3d888d (commit) via 31309d970cc83b67dd89a2afbd985b2980624200 (commit) from 7e200feb57b68400cca6b27a5fb6d87c9692021e (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/ed36869f7b525df87a66c7403485f8ddd8491...
commit ed36869f7b525df87a66c7403485f8ddd8491457 Author: Cyril Hrubis metan@ucw.cz Date: Fri Nov 8 13:23:12 2013 +0100
filters: Ditherings: Set errno and fix abort.
* Set errno to EINVAL on unsupported dst pixel type
* Return 1 and set errno to EINVAL on unsupported src pixel type (instead of aborting in GP_Convert.gen.c on unsupproted conversion)
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/libs/filters/GP_FloydSteinberg.gen.c.t b/libs/filters/GP_FloydSteinberg.gen.c.t index f38cb8c..f63c8cc 100644 --- a/libs/filters/GP_FloydSteinberg.gen.c.t +++ b/libs/filters/GP_FloydSteinberg.gen.c.t @@ -130,6 +130,13 @@ static int floyd_steinberg_to_{{ pt.name }}_Raw(const GP_Context *src, static int floyd_steinberg(const GP_Context *src, GP_Context *dst, GP_ProgressCallback *callback) { + if (GP_PixelHasFlags(src->pixel_type, GP_PIXEL_IS_PALETTE)) { + GP_DEBUG(1, "Unsupported source pixel type %s", + GP_PixelTypeName(src->pixel_type)); + errno = EINVAL; + return 1; + } + switch (dst->pixel_type) { %% for pt in pixeltypes %% if pt.is_gray() or pt.is_rgb() and not pt.is_alpha() @@ -138,6 +145,7 @@ static int floyd_steinberg(const GP_Context *src, GP_Context *dst, %% endif %% endfor default: + errno = EINVAL; return 1; } } diff --git a/libs/filters/GP_HilbertPeano.gen.c.t b/libs/filters/GP_HilbertPeano.gen.c.t index 46a3eb9..1c11973 100644 --- a/libs/filters/GP_HilbertPeano.gen.c.t +++ b/libs/filters/GP_HilbertPeano.gen.c.t @@ -54,7 +54,7 @@ static unsigned int count_bits(unsigned int n) %% for pt in pixeltypes %% if pt.is_gray() or pt.is_rgb() and not pt.is_alpha() /* - * Hilbert Peano RGB888 to {{ pt.name }} + * Hilbert Peano to {{ pt.name }} */ static int hilbert_peano_to_{{ pt.name }}_Raw(const GP_Context *src, GP_Context *dst, @@ -140,6 +140,13 @@ static int hilbert_peano_to_{{ pt.name }}_Raw(const GP_Context *src, static int hilbert_peano(const GP_Context *src, GP_Context *dst, GP_ProgressCallback *callback) { + if (GP_PixelHasFlags(src->pixel_type, GP_PIXEL_IS_PALETTE)) { + GP_DEBUG(1, "Unsupported source pixel type %s", + GP_PixelTypeName(src->pixel_type)); + errno = EINVAL; + return 1; + } + switch (dst->pixel_type) { %% for pt in pixeltypes %% if pt.is_gray() or pt.is_rgb() and not pt.is_alpha() @@ -148,6 +155,7 @@ static int hilbert_peano(const GP_Context *src, GP_Context *dst, %% endif %% endfor default: + errno = EINVAL; return 1; } }
http://repo.or.cz/w/gfxprim.git/commit/9c0f4f912f97ae75a2de325e2b14a3cdde3d8...
commit 9c0f4f912f97ae75a2de325e2b14a3cdde3d888d Author: Cyril Hrubis metan@ucw.cz Date: Fri Nov 8 13:08:12 2013 +0100
tests: Filters: Add point filters.
Add point filters to API Coverage test and FiltersCompare test.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/tests/filters/APICoverage.gen.c.t b/tests/filters/APICoverage.gen.c.t index b4c8281..98a9286 100644 --- a/tests/filters/APICoverage.gen.c.t +++ b/tests/filters/APICoverage.gen.c.t @@ -42,7 +42,22 @@ We check for correct return value correcness though.
#include "tst_test.h"
-%% set API_List = [['MirrorH', '', 'GP_Context:in', 'GP_Context:out', +%% set API_List = [['Brightness', '', 'GP_Context:in', 'GP_Context:out', + 'float:p', 'GP_ProgressCallback'], + ['BrightnessAlloc', '', 'GP_Context:in', + 'float:p', 'GP_ProgressCallback'], + + ['Contrast', '', 'GP_Context:in', 'GP_Context:out', + 'float:p', 'GP_ProgressCallback'], + ['ContrastAlloc', '', 'GP_Context:in', + 'float:p', 'GP_ProgressCallback'], + + ['Invert', '', 'GP_Context:in', 'GP_Context:out', + 'GP_ProgressCallback'], + ['InvertAlloc', '', 'GP_Context:in', + 'GP_ProgressCallback'], + + ['MirrorH', '', 'GP_Context:in', 'GP_Context:out', 'GP_ProgressCallback'], ['MirrorHAlloc', '', 'GP_Context:in', 'GP_ProgressCallback'],
diff --git a/tests/filters/FiltersCompare.gen.c.t b/tests/filters/FiltersCompare.gen.c.t index d22890b..9acb432 100644 --- a/tests/filters/FiltersCompare.gen.c.t +++ b/tests/filters/FiltersCompare.gen.c.t @@ -47,7 +47,20 @@ The format is [[name1, [fn1, [params]], [fn2, [params]], ...],
All results from filters listed under one name are compared. */ -%% set compare_list = [['MirrorH', +%% set compare_list = [['Brightness', + ['Brightness', ['dst', 'dst', '0.1', 'NULL']], + ['BrightnessAlloc', ['src', '0.1', 'NULL']], + ], + ['Contrast', + ['Contrast', ['dst', 'dst', '1.2', 'NULL']], + ['ContrastAlloc', ['src', '1.2', 'NULL']], + ], + ['Invert', + ['Invert', ['dst', 'dst', 'NULL']], + ['InvertAlloc', ['src', 'NULL']], + ], + + ['MirrorH', ['MirrorH', ['dst', 'dst', 'NULL']], ['MirrorHAlloc', ['src', 'NULL']], ['Symmetry', ['dst', 'dst', 'GP_MIRROR_H', 'NULL']],
http://repo.or.cz/w/gfxprim.git/commit/31309d970cc83b67dd89a2afbd985b2980624...
commit 31309d970cc83b67dd89a2afbd985b2980624200 Author: Cyril Hrubis metan@ucw.cz Date: Fri Nov 8 12:53:40 2013 +0100
loaders: PNM: Optimize Save()
This adds custom function to write ASCII byte into a file which is more than five times faster than printf("%u", byte).
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/libs/loaders/GP_PNM.c b/libs/loaders/GP_PNM.c index 813de81..7e28f1b 100644 --- a/libs/loaders/GP_PNM.c +++ b/libs/loaders/GP_PNM.c @@ -291,6 +291,22 @@ static int get_ascii_int(FILE *f, int *val) }
/* + * Five times faster than printf("%u", byte) + */ +static inline int write_ascii_byte(FILE *f, uint8_t byte) +{ + if (byte >= 100) + fputc_unlocked('0' + byte/100, f); + + if (byte >= 10) + fputc_unlocked('0' + (byte%100)/10, f); + + fputc_unlocked('0' + (byte%10), f); + + return fputc_unlocked(' ', f) == EOF; +} + +/* * The PBM ASCII has the values inverted */ static int load_ascii_g1_inv(FILE *f, GP_Context *ctx, GP_ProgressCallback *cb) @@ -564,7 +580,7 @@ static int save_ascii(FILE *f, const GP_Context *ctx, if (inv) val = !val;
- if (fprintf(f, "%i ", val) < 0) { + if (write_ascii_byte(f, val)) { err = errno; GP_DEBUG(1, "Failed to write data"); return err; @@ -961,7 +977,7 @@ static int save_ascii_rgb888(FILE *f, const GP_Context *ctx, GP_LineConvert Convert, GP_ProgressCallback *cb) { uint32_t x, y; - int ret; + int ret = 0; uint8_t buf[3 * ctx->w], *addr;
for (y = 0; y < ctx->h; y++) { @@ -976,9 +992,11 @@ static int save_ascii_rgb888(FILE *f, const GP_Context *ctx, for (x = 0; x < ctx->w; x++) { addr+=3;
- ret = fprintf(f, "%u %u %u ", addr[2], addr[1], addr[0]); + ret |= write_ascii_byte(f, addr[2]); + ret |= write_ascii_byte(f, addr[1]); + ret |= write_ascii_byte(f, addr[0]);
- if (ret < 0) + if (ret) return errno; }
-----------------------------------------------------------------------
Summary of changes: libs/filters/GP_FloydSteinberg.gen.c.t | 8 ++++++++ libs/filters/GP_HilbertPeano.gen.c.t | 10 +++++++++- libs/loaders/GP_PNM.c | 26 ++++++++++++++++++++++---- tests/filters/APICoverage.gen.c.t | 17 ++++++++++++++++- tests/filters/FiltersCompare.gen.c.t | 15 ++++++++++++++- 5 files changed, 69 insertions(+), 7 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.