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 b704cc579b2db0db8015f46acbc8c69ffcf81aa7 (commit) via 12843d60dfc09f14d451d1e73cd0beb3e491b4db (commit) from 7609f2afad8b10921084c8d2fe14283873e75ff2 (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/b704cc579b2db0db8015f46acbc8c69ffcf81...
commit b704cc579b2db0db8015f46acbc8c69ffcf81aa7 Author: Cyril Hrubis metan@ucw.cz Date: Sat Jul 21 18:50:50 2012 +0200
demos: Add median filter to grinder.
diff --git a/demos/grinder/grinder.c b/demos/grinder/grinder.c index a2192b7..f001ff6 100644 --- a/demos/grinder/grinder.c +++ b/demos/grinder/grinder.c @@ -591,6 +591,42 @@ static GP_RetCode add_noise(GP_Context **c, const char *params) return GP_ESUCCESS; }
+/* median filter */ + +static struct param median_params[] = { + {"radius", PARAM_INT, "median radius for both x and y", NULL, NULL}, + {"radius_x", PARAM_INT, "median radius for x", NULL, NULL}, + {"radius_y", PARAM_INT, "median radius for y", NULL, NULL}, + {NULL, 0, NULL, NULL, NULL} +}; + +static GP_RetCode median(GP_Context **c, const char *params) +{ + int rad = -1, rad_x, rad_y; + + if (param_parse(params, median_params, "median", param_err, &rad, &rad_x, &rad_y)) + return GP_EINVAL; + + if (rad != -1) { + rad_x = rad; + rad_y = rad; + } + + if (rad_x < 0 || rad_y < 0) + return GP_EINVAL; + + GP_Context *ret = GP_FilterMedianAlloc(*c, rad_x, rad_y, progress_callback); + + if (ret == NULL) + return GP_ENOMEM; + + GP_ContextFree(*c); + *c = ret; + + return GP_ESUCCESS; +} + + /* arithmetics */
static const char *arithmetic_ops[] = { @@ -702,6 +738,7 @@ static struct filter filter_table[] = { {"dither", "dithers bitmap", dither_params, dither}, {"arithmetic", "arithmetic operation", arithmetic_params, arithmetic}, {"histogram", "save histogram into image file", histogram_params, histogram}, + {"median", "median filter", median_params, median}, {"jpg", "save jpg image", save_jpg_params, save_jpg}, {"png", "save png image", save_png_params, save_png}, {NULL, NULL, NULL, NULL}
http://repo.or.cz/w/gfxprim.git/commit/12843d60dfc09f14d451d1e73cd0beb3e491b...
commit 12843d60dfc09f14d451d1e73cd0beb3e491b4db Author: Cyril Hrubis metan@ucw.cz Date: Sat Jul 21 18:50:22 2012 +0200
pywrap: Update filter.i for median filter.
diff --git a/pylib/gfxprim/filters/filters.i b/pylib/gfxprim/filters/filters.i index dec3bba..caecd35 100644 --- a/pylib/gfxprim/filters/filters.i +++ b/pylib/gfxprim/filters/filters.i @@ -56,3 +56,7 @@ %newobject GP_FilterBlurAlloc; %newobject GP_FilterBlurExAlloc; %include "GP_Blur.h" + +%newobject GP_FilterMedianAlloc; +%newobject GP_FilterMedianExAlloc; +%include "GP_Median.h"
-----------------------------------------------------------------------
Summary of changes: demos/grinder/grinder.c | 37 +++++++++++++++++++++++++++++++++++++ pylib/gfxprim/filters/filters.i | 4 ++++ 2 files changed, 41 insertions(+), 0 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.