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, generate has been updated via b24c82a3c5df97a39f72ec848917e4eb56f34d8c (commit) via 50865b7cb15b959c035b59ad6cbfaffa23bf69e5 (commit) via 448b2fe286974b47356304c85b66982b933f8ada (commit) from bc1b6594de0de8e6f717e824e3ded14e95b95870 (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/b24c82a3c5df97a39f72ec848917e4eb56f34...
commit b24c82a3c5df97a39f72ec848917e4eb56f34d8c Author: Cyril Hrubis metan@ucw.cz Date: Sun Oct 2 18:19:43 2011 +0200
Add parameters for nonsymetric blur.
diff --git a/demos/grinder/grinder.c b/demos/grinder/grinder.c index 3c0c075..a0e8f2c 100644 --- a/demos/grinder/grinder.c +++ b/demos/grinder/grinder.c @@ -314,8 +314,8 @@ static GP_RetCode blur(GP_Context **c, const char *params) sigma_y = sigma; }
- if (sigma_x <= 0 || sigma_y <= 0) { - print_error("blur: sigma_x and sigma_y parameter must be >= 0"); + if (sigma_x <= 0 && sigma_y <= 0) { + print_error("blur: at least one of sigma_x and sigma_y must be >= 0"); return GP_EINVAL; }
http://repo.or.cz/w/gfxprim.git/commit/50865b7cb15b959c035b59ad6cbfaffa23bf6...
commit 50865b7cb15b959c035b59ad6cbfaffa23bf69e5 Author: Cyril Hrubis metan@ucw.cz Date: Sun Oct 2 18:19:18 2011 +0200
Fix gaussian blur only in one direction.
diff --git a/libs/filters/GP_Linear.c b/libs/filters/GP_Linear.c index 1538ee2..48dc0ee 100644 --- a/libs/filters/GP_Linear.c +++ b/libs/filters/GP_Linear.c @@ -84,22 +84,23 @@ void GP_FilterGaussianBlur_Raw(GP_Context *src, GP_Context *res, new_callback = &gaussian_callback;
/* compute kernel and apply on horizontal direction */ - float kernel_x[size_x]; - gaussian_kernel_init(sigma_x, kernel_x); - GP_FilterLinearConvolution(src, res, new_callback, kernel_x, size_x, 1); - + if (sigma_x > 0) { + float kernel_x[size_x]; + gaussian_kernel_init(sigma_x, kernel_x); + GP_FilterLinearConvolution(src, res, new_callback, kernel_x, size_x, 1); + } + if (new_callback != NULL) new_callback->callback = gaussian_callback_2;
/* compute kernel and apply on vertical direction */ - float kernel_y[size_y]; - gaussian_kernel_init(sigma_y, kernel_y); - GP_FilterLinearConvolution(res, res, new_callback, kernel_y, 1, size_y); - - if (callback != NULL) { - callback->percentage = 100; - callback->callback(callback); + if (sigma_y > 0) { + float kernel_y[size_y]; + gaussian_kernel_init(sigma_y, kernel_y); + GP_FilterLinearConvolution(res, res, new_callback, kernel_y, 1, size_y); } + + GP_ProgressCallbackDone(callback); }
GP_Context *GP_FilterGaussianBlur(GP_Context *src,
http://repo.or.cz/w/gfxprim.git/commit/448b2fe286974b47356304c85b66982b933f8...
commit 448b2fe286974b47356304c85b66982b933f8ada Author: Cyril Hrubis metan@ucw.cz Date: Sun Oct 2 18:13:39 2011 +0200
grinder: gaussian blur: add params for two sigmas.
diff --git a/demos/grinder/grinder.c b/demos/grinder/grinder.c index a2f6d4d..3c0c075 100644 --- a/demos/grinder/grinder.c +++ b/demos/grinder/grinder.c @@ -149,8 +149,8 @@ static int scale_check_size(const struct param *self __attribute__((unused)),
static struct param scale_params[] = { {"alg", PARAM_ENUM, "algorithm to be used", scale_algs, NULL}, - {"w", PARAM_INT, "new width", NULL, scale_check_size}, - {"h", PARAM_INT, "new height", NULL, scale_check_size}, + {"w", PARAM_INT, "new width (only width may be passed)", NULL, scale_check_size}, + {"h", PARAM_INT, "new height (only height may be passed)", NULL, scale_check_size}, {NULL, 0, NULL, NULL, NULL} };
@@ -294,24 +294,32 @@ static GP_RetCode invert(GP_Context **c, const char *params) }
static struct param blur_params[] = { - {"sigma", PARAM_FLOAT, "sigma parameter (eg. radii of blur)", NULL, NULL}, + {"sigma", PARAM_FLOAT, "sigma parameter, radii of blur (sets both)", NULL, NULL}, + {"sigma_x", PARAM_FLOAT, "sigma parameter for horizontal direction", NULL, NULL}, + {"sigma_y", PARAM_FLOAT, "sigma parameter for vertical direction", NULL, NULL}, {NULL, 0, NULL, NULL, NULL} };
static GP_RetCode blur(GP_Context **c, const char *params) { float sigma = 0; + float sigma_x = 0; + float sigma_y = 0;
- if (param_parse(params, blur_params, "blur", param_err, &sigma)) + if (param_parse(params, blur_params, "blur", param_err, &sigma, &sigma_x, &sigma_y)) return GP_EINVAL;
- if (sigma <= 0) { - print_error("blur: sigma parameter must be >= 0"); + if (sigma > 0) { + sigma_x = sigma; + sigma_y = sigma; + } + + if (sigma_x <= 0 || sigma_y <= 0) { + print_error("blur: sigma_x and sigma_y parameter must be >= 0"); return GP_EINVAL; } - - GP_FilterGaussianBlur_Raw(*c, *c, progress_callback, sigma, sigma);
+ GP_FilterGaussianBlur_Raw(*c, *c, progress_callback, sigma_x, sigma_y);
return GP_ESUCCESS; }
-----------------------------------------------------------------------
Summary of changes: demos/grinder/grinder.c | 24 ++++++++++++++++-------- libs/filters/GP_Linear.c | 23 ++++++++++++----------- 2 files changed, 28 insertions(+), 19 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.