# HG changeset patch # User nenolod # Date 1162372280 28800 # Node ID 6880934d11bfcba6ee4a1366a6a3dcba8550cec6 # Parent c93118f6ef278ca236073902271274f216f3f678 [svn] - add "Clear Surface" instruction. diff -r c93118f6ef27 -r 6880934d11bf ChangeLog --- a/ChangeLog Wed Nov 01 01:03:30 2006 -0800 +++ b/ChangeLog Wed Nov 01 01:11:20 2006 -0800 @@ -1,3 +1,11 @@ +2006-11-01 09:03:30 +0000 William Pitcock + revision [352] + - update Mosaic effect helptext. + + trunk/src/paranormal/general.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + + 2006-11-01 09:00:19 +0000 William Pitcock revision [350] - make mosaic sizable. diff -r c93118f6ef27 -r 6880934d11bf src/paranormal/builtins.c --- a/src/paranormal/builtins.c Wed Nov 01 01:03:30 2006 -0800 +++ b/src/paranormal/builtins.c Wed Nov 01 01:11:20 2006 -0800 @@ -58,6 +58,7 @@ &builtin_general_fade, &builtin_general_blur, &builtin_general_mosaic, + &builtin_general_clear, /* **************** wave **************** */ &builtin_wave_horizontal, &builtin_wave_vertical, diff -r c93118f6ef27 -r 6880934d11bf src/paranormal/general.c --- a/src/paranormal/general.c Wed Nov 01 01:03:30 2006 -0800 +++ b/src/paranormal/general.c Wed Nov 01 01:11:20 2006 -0800 @@ -21,8 +21,7 @@ general_fade_exec (const struct pn_actuator_option *opts, gpointer data) { - int amt = opts[0].val.ival > 255 || opts[0].val.ival < 0 ? - 3 : opts[0].val.ival; + int amt = opts[0].val.ival > 255 || opts[0].val.ival < 0 ? 3 : opts[0].val.ival; int i, j; for (j=0; jheight; j++) @@ -113,7 +112,7 @@ register guchar *srcptr = pn_image_data->surface[0]; register guchar *destptr = pn_image_data->surface[1]; register int sum; - int radius = opts[0].val.ival; + int radius = opts[0].val.ival > 255 || opts[0].val.ival < 0 ? 6 : opts[0].val.ival; for (j=0; jheight; j += radius) for (i=0; iwidth; i += radius) @@ -147,3 +146,20 @@ 0, general_mosaic_opts, NULL, NULL, general_mosaic_exec }; + +/* **************** general_clear **************** */ +static void +general_clear_exec (const struct pn_actuator_option *opts, + gpointer data) +{ + memset(pn_image_data->surface[0], '\0', + (pn_image_data->height * pn_image_data->width)); +} + +struct pn_actuator_desc builtin_general_clear = +{ + "general_clear", "Clear Surface", "Clears the surface.", + 0, NULL, + NULL, NULL, general_clear_exec +}; +