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 1f9af7dcef377ae227faa484f8f7183583bfefe4 (commit) via 64874ffe03a6cdf99dc21faaa6ff2243538b78f9 (commit) from 2dacc1816fc4a182ba2054ec12b2c2b7de223565 (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/1f9af7dcef377ae227faa484f8f7183583bfe...
commit 1f9af7dcef377ae227faa484f8f7183583bfefe4 Author: Cyril Hrubis metan@ucw.cz Date: Tue Jun 18 23:35:54 2013 +0200
tests: core: Fix copy & paste error in name.
Fix copy and paste error in Convert Scale testsuite name.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/tests/core/Convert_Scale.gen.c.t b/tests/core/Convert_Scale.gen.c.t index f61e9bd..2da4e03 100644 --- a/tests/core/Convert_Scale.gen.c.t +++ b/tests/core/Convert_Scale.gen.c.t @@ -93,7 +93,7 @@ static int check_convert_{{ i }}_{{ j }}(void) %% endfor
const struct tst_suite tst_suite = { - .suite_name = "Pixel Conversions Testsuite", + .suite_name = "Convert Scale Testsuite", .tests = { %% for i in range(1, max_in) %% for j in range(1, max_out)
http://repo.or.cz/w/gfxprim.git/commit/64874ffe03a6cdf99dc21faaa6ff2243538b7...
commit 64874ffe03a6cdf99dc21faaa6ff2243538b78f9 Author: Cyril Hrubis metan@ucw.cz Date: Tue Jun 18 23:34:17 2013 +0200
loaders: PBM: Add support for Rawbits PBM + tests.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/libs/loaders/GP_PNM.c b/libs/loaders/GP_PNM.c index dc4c29c..374bad0 100644 --- a/libs/loaders/GP_PNM.c +++ b/libs/loaders/GP_PNM.c @@ -290,7 +290,7 @@ static int get_ascii_int(FILE *f, int *val) }
/* - * The PBM has the values inverted + * The PBM ASCII has the values inverted */ static int load_ascii_g1_inv(FILE *f, GP_Context *ctx, GP_ProgressCallback *cb) { @@ -316,6 +316,35 @@ static int load_ascii_g1_inv(FILE *f, GP_Context *ctx, GP_ProgressCallback *cb) return 0; }
+//TODO: This is temporary till blit works with bitendian +#include "core/GP_BitSwap.h" + +static int load_raw_g1_inv(FILE *f, GP_Context *ctx, GP_ProgressCallback *cb) +{ + uint32_t x, y; + uint8_t *addr; + int val; + + for (y = 0; y < ctx->h; y++) { + for (x = 0; x < ctx->w; x+=8) { + + if ((val = fgetc(f)) == EOF) + return EIO; + + addr = GP_PIXEL_ADDR(ctx, x, y); + *addr = ~GP_BIT_SWAP_B1(val); + } + + if (GP_ProgressCallbackReport(cb, y, ctx->h, ctx->w)) { + GP_DEBUG(1, "Operation aborted"); + return ECANCELED; + } + } + + GP_ProgressCallbackDone(cb); + return 0; +} + static int load_ascii_g1(FILE *f, GP_Context *ctx, GP_ProgressCallback *cb) { uint32_t x, y; @@ -572,7 +601,12 @@ static GP_Context *read_bitmap(FILE *f, struct pnm_header *header, int flag, goto err1; }
- if ((err = load_ascii_g1_inv(f, ret, callback))) + if (header->magic == '1') + err = load_ascii_g1_inv(f, ret, callback); + else + err = load_raw_g1_inv(f, ret, callback); + + if (err) goto err1;
if (flag) diff --git a/tests/loaders/PBM.c b/tests/loaders/PBM.c index 290d5a9..ac87f25 100644 --- a/tests/loaders/PBM.c +++ b/tests/loaders/PBM.c @@ -69,6 +69,27 @@ struct testcase white_1x1 = { .path = "white_1x1.pbm", };
+struct testcase black_1x1_bin = { + .w = 1, + .h = 1, + .pix = 0, + .path = "black_1x1_bin.pbm", +}; + +struct testcase black_2x2_bin = { + .w = 2, + .h = 2, + .pix = 0, + .path = "black_2x2_bin.pbm", +}; + +struct testcase black_3x9_bin = { + .w = 3, + .h = 9, + .pix = 0, + .path = "black_3x9_bin.pbm", +}; + struct testcase_save_load save_load = { .w = 100, .h = 100, @@ -108,7 +129,25 @@ const struct tst_suite tst_suite = { .res_path = "data/pbm/valid/black_1x1_4.pbm", .data = &black_1x1_4, .flags = TST_TMPDIR | TST_CHECK_MALLOC}, + + {.name = "PBM Load 1x1 (black) Raw", + .tst_fn = test_load, + .res_path = "data/pbm/valid/black_1x1_bin.pbm", + .data = &black_1x1_bin, + .flags = TST_TMPDIR | TST_CHECK_MALLOC}, + + {.name = "PBM Load 2x2 (black) Raw", + .tst_fn = test_load, + .res_path = "data/pbm/valid/black_2x2_bin.pbm", + .data = &black_2x2_bin, + .flags = TST_TMPDIR | TST_CHECK_MALLOC}, + {.name = "PBM Load 3x9 (black) Raw", + .tst_fn = test_load, + .res_path = "data/pbm/valid/black_3x9_bin.pbm", + .data = &black_3x9_bin, + .flags = TST_TMPDIR | TST_CHECK_MALLOC}, + {.name = "PBM Load corrupt", .tst_fn = test_load_fail, .res_path = "data/pbm/corrupt/short.pbm", diff --git a/tests/loaders/data/pbm/valid/black_1x1_bin.pbm b/tests/loaders/data/pbm/valid/black_1x1_bin.pbm new file mode 100644 index 0000000..238c2bf --- /dev/null +++ b/tests/loaders/data/pbm/valid/black_1x1_bin.pbm @@ -0,0 +1,4 @@ +P4 +# CREATOR: GIMP PNM Filter Version 1.1 +1 1 + No newline at end of file diff --git a/tests/loaders/data/pbm/valid/black_2x2_bin.pbm b/tests/loaders/data/pbm/valid/black_2x2_bin.pbm new file mode 100644 index 0000000..d827eeb --- /dev/null +++ b/tests/loaders/data/pbm/valid/black_2x2_bin.pbm @@ -0,0 +1,4 @@ +P4 +# CREATOR: GIMP PNM Filter Version 1.1 +2 2 +ÀÀ No newline at end of file diff --git a/tests/loaders/data/pbm/valid/black_3x9_bin.pbm b/tests/loaders/data/pbm/valid/black_3x9_bin.pbm new file mode 100644 index 0000000..6e56972 --- /dev/null +++ b/tests/loaders/data/pbm/valid/black_3x9_bin.pbm @@ -0,0 +1,4 @@ +P4 +# CREATOR: GIMP PNM Filter Version 1.1 +3 9 +ààààààààà No newline at end of file
-----------------------------------------------------------------------
Summary of changes: libs/loaders/GP_PNM.c | 38 ++++++++++++++++++++++- tests/core/Convert_Scale.gen.c.t | 2 +- tests/loaders/PBM.c | 39 ++++++++++++++++++++++++ tests/loaders/data/pbm/valid/black_1x1_bin.pbm | 4 ++ tests/loaders/data/pbm/valid/black_2x2_bin.pbm | 4 ++ tests/loaders/data/pbm/valid/black_3x9_bin.pbm | 4 ++ 6 files changed, 88 insertions(+), 3 deletions(-) create mode 100644 tests/loaders/data/pbm/valid/black_1x1_bin.pbm create mode 100644 tests/loaders/data/pbm/valid/black_2x2_bin.pbm create mode 100644 tests/loaders/data/pbm/valid/black_3x9_bin.pbm
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.