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 65def9162f29b2c9e8b4d49192289cc5fa95c3e1 (commit) via 70a17f43a0900e703f5bcd2eeafb55721000eb8d (commit) via ba3c107efd52870c43fe8cd2255c5c6f2bec0379 (commit) via 84bb1080f66c943353a9e3aac213f0837a2ca583 (commit) from 07fc6dce72522e9b86d09dffb4c61be6db3a127c (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/65def9162f29b2c9e8b4d49192289cc5fa95c...
commit 65def9162f29b2c9e8b4d49192289cc5fa95c3e1 Author: Cyril Hrubis metan@ucw.cz Date: Tue Sep 24 18:48:56 2013 +0200
build: Cleanup check_symbols.sh, add Gamma syms.
Now check_symbols.sh prints ALL CAPS warning and instructions how to fix the problem.
Also add the Gamma table symbols for now, so that the output from the script is clean.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/build/Makefile b/build/Makefile index 075c19d..36c797a 100644 --- a/build/Makefile +++ b/build/Makefile @@ -13,7 +13,7 @@ DYNAMIC_LIB=$(LIB_NAME).so.$(LIB_VERSION).$(LIB_RELEASE) SONAME=$(LIB_NAME).so.$(LIB_MAJOR) SYMLINKS=$(LIB_NAME).so.$(LIB_MAJOR) $(LIB_NAME).so
-all: $(STATIC_LIB) $(DYNAMIC_LIB) $(SYMLINKS) +all: $(STATIC_LIB) $(DYNAMIC_LIB) $(SYMLINKS)
rebuild: all
@@ -24,7 +24,7 @@ ifdef VERBOSE rm -rf $(STATIC_LIB) $(DYNAMIC_LIB) $(SYMLINKS) else @echo "RM $(STATIC_LIB) $(DYNAMIC_LIB) $(SYMLINKS)" - @rm -rf $(STATIC_LIB) $(DYNAMIC_LIB) $(SYMLINKS) + @rm -rf $(STATIC_LIB) $(DYNAMIC_LIB) $(SYMLINKS) endif
$(STATIC_LIB): $(LIB_OBJECTS) diff --git a/build/check_symbols.sh b/build/check_symbols.sh index 7f8ff8d..245b324 100755 --- a/build/check_symbols.sh +++ b/build/check_symbols.sh @@ -3,6 +3,9 @@ # Purpose of this script is to check library exported symbols #
+FOUND="" +WARN="WARNING : WARNING : WARNING : WARNING : WARNING : WARNING : WARNING : WARNING" + SYMTMPFILE=symbols.txt
function grep_sym @@ -38,7 +41,14 @@ function check_symbols
for i in `cat $symfile`; do if ! grep "^$i$" $@ 2>&1 > /dev/null; then + if [ -z "$FOUND" ]; then + echo "$WARN" + echo + echo "Following new API symbols found:" + echo + fi find_symbol "$i" + FOUND="yes" fi done } @@ -60,3 +70,10 @@ do_check libGP_backends.so syms/Backend_symbols.txt do_check libGP_grabbers.so syms/Grabbers_symbols.txt
do_check libGP_loaders.so syms/Loaders_symbols.txt + +if [ -n "$FOUND" ]; then + echo + echo "Set them static or update lists of exported functions in syms/Foo_symbols.txt" + echo + echo "$WARN" +fi diff --git a/build/syms/Core_symbols.txt b/build/syms/Core_symbols.txt index 10f0e5d..1235998 100644 --- a/build/syms/Core_symbols.txt +++ b/build/syms/Core_symbols.txt @@ -73,3 +73,6 @@ GP_NrThreadsSet GP_ProgressCallbackMP
SWIG_exception + +GP_Gamma8_Linear10 +GP_Linear10_Gamma8
http://repo.or.cz/w/gfxprim.git/commit/70a17f43a0900e703f5bcd2eeafb55721000e...
commit 70a17f43a0900e703f5bcd2eeafb55721000eb8d Author: Cyril Hrubis metan@ucw.cz Date: Tue Sep 24 18:30:01 2013 +0200
build: Update list of Text symbols.
Add GP_FontC64.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/build/syms/Text_symbols.txt b/build/syms/Text_symbols.txt index 4aa0fe3..1b371e6 100644 --- a/build/syms/Text_symbols.txt +++ b/build/syms/Text_symbols.txt @@ -18,7 +18,8 @@ GP_Print
GP_DefaultStyle
-GP_FontTiny -GP_FontTinyMono GP_DefaultProportionalFont GP_DefaultConsoleFont +GP_FontTiny +GP_FontTinyMono +GP_FontC64
http://repo.or.cz/w/gfxprim.git/commit/ba3c107efd52870c43fe8cd2255c5c6f2bec0...
commit ba3c107efd52870c43fe8cd2255c5c6f2bec0379 Author: Cyril Hrubis metan@ucw.cz Date: Tue Sep 24 18:25:39 2013 +0200
doc: Update dithering docs.
* Update filters C API pages
* Start python filter docs
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/doc/Makefile b/doc/Makefile index 9ec16a1..3aec846 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -4,6 +4,7 @@ SOURCES=general.txt context.txt loaders.txt filters.txt basic_types.txt gen.txt pixels.txt coordinate_system.txt coding_style.txt get_put_pixel.txt blits.txt progress_callback.txt text_api.txt event_queue.txt compilation.txt filters_resize.txt + filters_dithering.txt filters_python.txt
SOURCES+=core_python.txt gfx_python.txt loaders_python.txt backends_python.txt
diff --git a/doc/asciidoc.conf b/doc/asciidoc.conf index 4829c02..4f58bfc 100644 --- a/doc/asciidoc.conf +++ b/doc/asciidoc.conf @@ -44,7 +44,6 @@ endif::disable-javascript[] <li><a href="general.html">Home</a></li> <li><a href="compilation.html">Compilation</a></li> </ul> - <h4>API Pages</h4> <ul> <li><a href="drawing_api.html">Gfx</a></li> @@ -54,12 +53,12 @@ endif::disable-javascript[] <li><a href="backends.html">Backends</a></li> <li><a href="input.html">Input</a></li> </ul> - <h4>Python bindings</h4> <ul> <li><a href="core_python.html">Core</a></li> - <li><a href="gfx_python.html">Gfx</a></li> <li><a href="loaders_python.html">Loaders</a></li> + <li><a href="filters_python.html">Filters</a></li> + <li><a href="gfx_python.html">Gfx</a></li> <li><a href="backends_python.html">Backends</a></li> </ul> </div> diff --git a/doc/example_py_dithering.txt b/doc/example_py_dithering.txt new file mode 100644 index 0000000..d187c7d --- /dev/null +++ b/doc/example_py_dithering.txt @@ -0,0 +1,8 @@ +Dithering Example +----------------- +.A simple program that loads image, dithers it and saves result + +[source,python] +------------------------------------------------------------------ +include::../demos/py_simple/dither.py[] +------------------------------------------------------------------ diff --git a/doc/filters.txt b/doc/filters.txt index c456bf5..c69ccdd 100644 --- a/doc/filters.txt +++ b/doc/filters.txt @@ -904,144 +904,9 @@ finally downscale it to desired size. Dithering ~~~~~~~~~
-Currently there are two dithering algorithms implemented. Both takes an RGB888 -24bit image as input and are able to produce any RGB or Grayscale image. -This filters doesn't work 'in-place' as the result has different pixel type. - -Floyd-Steinberg -^^^^^^^^^^^^^^^ - -Classical Floyd-Steinberg. Produces good results and is a little faster than -the Hilbert-Peano dithering. - -The error is distributed to neighbor pixels as follows: - -[width="10%"] -|=================== -| | X | 7/16 -| 3/16 | 5/16 | 1/16 -|=================== - -And is throwed away at the image borders. - -[source,c] -------------------------------------------------------------------------------- -#include <GP_Filters.h> - -int GP_FilterFloydSteinberg_RGB888(const GP_Context *src, - GP_Context *dst, - GP_ProgressCallback *callback); -------------------------------------------------------------------------------- - -Renders Floyd Steinberg dithering directly into passed context. The -destination must be at least as large as source. - -If operation was aborted by a callback, non-zero is returned. - -[source,c] -------------------------------------------------------------------------------- -#include <GP_Filters.h> - -GP_Context *GP_FilterFloydSteinberg_RGB888_Alloc(const GP_Context *src, - GP_PixelType pixel_type, - GP_ProgressCallback *callback); -------------------------------------------------------------------------------- - -Returns pointer to allocated context of given pixel_type. - -If malloc(2) has failed, or operation was aborted by a callback 'NULL' is -returned. - -Hilbert-Peano -^^^^^^^^^^^^^ - -Hilbert-Peano space filling curve based dithering. - -The error value is distributed around the Hilbert curve. - -The result is a little more noisy, but doesn't create repeating patterns like -Floyd-Steinberg which looks generally better to human eye. On the other hand -edges tend to be less sharp. - -[source,c] -------------------------------------------------------------------------------- -#include <GP_Filters.h> - -int GP_FilterHilbertPeano_RGB888(const GP_Context *src, - GP_Context *dst, - GP_ProgressCallback *callback); -------------------------------------------------------------------------------- - -Renders Hilbert Peano dithering directly into passed context. The -destination must be at least as large as source. - -If operation was aborted by a callback, non-zero is returned. - -[source,c] -------------------------------------------------------------------------------- -#include <GP_Filters.h> - -GP_Context *GP_FilterHilbertPeano_RGB888_Alloc(const GP_Context *src, - GP_PixelType pixel_type, - GP_ProgressCallback *callback); -------------------------------------------------------------------------------- - -Returns pointer to allocated context of given pixel_type. - -If malloc(2) has failed, or operation was aborted by a callback 'NULL' is -returned. - -Example Images -^^^^^^^^^^^^^^ -All following images were generated using 'grinder'. -(Click for bigger size) - -.Original Image; Floyd-Steinberg, Hilbert-Peano: 1-bit, 2-bit, 4-bit, 8-bit Grayscale; 1-bit, 2-bit, 3-bit (per channel) RGB -image:images/dither/lenna_small.png[ - "Original Image", - link="images/dither/lenna.png"] -image:images/dither/lenna_G1_FS_small.png[ - "1-bit Grayscale Floyd-Steinberg", - link="images/dither/lenna_G1_FS.png"] -image:images/dither/lenna_G1_HP_small.png[ - "1-bit Grayscale Hilbert-Peano", - link="images/dither/lenna_G1_HP.png"] -image:images/dither/lenna_G2_FS_small.png[ - "2-bit Grayscale Floyd-Steinberg", - link="images/dither/lenna_G2_FS.png"] -image:images/dither/lenna_G2_HP_small.png[ - "2-bit Grayscale Hilbert-Peano", - link="images/dither/lenna_G2_HP.png"] -image:images/dither/lenna_G4_FS_small.png[ - "4-bit Grayscale Floyd-Steinberg", - link="images/dither/lenna_G4_FS.png"] -image:images/dither/lenna_G4_HP_small.png[ - "4-bit Grayscale Hilbert-Peano", - link="images/dither/lenna_G4_HP.png"] -image:images/dither/lenna_G8_FS_small.png[ - "8-bit Grayscale Floyd-Steinberg", - link="images/dither/lenna_G8_FS.png"] -image:images/dither/lenna_G8_HP_small.png[ - "7-bit Grayscale Hilbert-Peano", - link="images/dither/lenna_G8_HP.png"] -image:images/dither/lenna_RGB111_FS_small.png[ - "1-bit RGB Floyd-Steinberg", - link="images/dither/lenna_RGB111_FS.png"] -image:images/dither/lenna_RGB111_HP_small.png[ - "1-bit RGB Hilbert-Peano", - link="images/dither/lenna_RGB111_HP.png"] -image:images/dither/lenna_RGB222_FS_small.png[ - "2-bit RGB Floyd-Steinberg", - link="images/dither/lenna_RGB222_FS.png"] -image:images/dither/lenna_RGB222_HP_small.png[ - "2-bit RGB Hilbert-Peano", - link="images/dither/lenna_RGB222_HP.png"] -image:images/dither/lenna_RGB333_FS_small.png[ - "3-bit RGB Floyd-Steinberg", - link="images/dither/lenna_RGB333_FS.png"] -image:images/dither/lenna_RGB333_HP_small.png[ - "3-bit RGB Hilbert-Peano", - link="images/dither/lenna_RGB333_HP.png"] +link:filters_dithering.html[Dithering filters] are filters for better loosy +(source pixel type has more bits to represent color or grayscale value) pixel +type conversions.
Median ~~~~~~ diff --git a/doc/filters_dithering.txt b/doc/filters_dithering.txt new file mode 100644 index 0000000..91ac47f --- /dev/null +++ b/doc/filters_dithering.txt @@ -0,0 +1,159 @@ +Dithering +--------- + +Currently there are two dithering algorithms implemented. Both takes an RGB888 +24bit image as input and are able to produce any RGB or Grayscale image. +This filters doesn't work 'in-place' as the result has different pixel type. + +Floyd-Steinberg +~~~~~~~~~~~~~~~ + +Classical Floyd-Steinberg. Produces good results and is a little faster than +the Hilbert-Peano dithering. + +The error is distributed to neighbor pixels as follows: + +[width="10%"] +|=================== +| | X | 7/16 +| 3/16 | 5/16 | 1/16 +|=================== + +And is throwed away at the image borders. + +[source,c] +------------------------------------------------------------------------------- +#include <GP.h> +/* or */ +#include <filters/GP_Dither.h> + +int GP_FilterFloydSteinberg(const GP_Context *src, GP_Context *dst, + GP_ProgressCallback *callback); +------------------------------------------------------------------------------- + +Renders Floyd Steinberg dithering directly into passed context. The +destination must be at least as large as source. + +If operation was aborted by a callback, non-zero is returned. + +Not all pixel types all supported. If particular combination is not supported +the function returns non-zero and sets errno to 'ENOSYS'. + +[source,c] +------------------------------------------------------------------------------- +#include <GP.h> +/* or */ +#include <filters/GP_Dither.h> + +GP_Context *GP_FilterFloydSteinbergAlloc(const GP_Context *src, + GP_PixelType pixel_type, + GP_ProgressCallback *callback); +------------------------------------------------------------------------------- + +Returns pointer to allocated context of given pixel_type. + +If 'malloc(2)' has failed, or operation was aborted by a callback 'NULL' is +returned. + +Not all pixel types all supported. If particular combination is not supported +the function returns 'NULL' and sets errno to 'ENOSYS'. + +Hilbert-Peano +~~~~~~~~~~~~~ + +Hilbert-Peano space filling curve based dithering. + +The error value is distributed around the Hilbert curve. + +The result is a little more noisy, but doesn't create repeating patterns like +Floyd-Steinberg which looks generally better to human eye. On the other hand +edges tend to be less sharp. + +[source,c] +------------------------------------------------------------------------------- +#include <GP.h> +/* or */ +#include <filters/GP_Dither.h> + +int GP_FilterHilbertPeano(const GP_Context *src, GP_Context *dst, + GP_ProgressCallback *callback); +------------------------------------------------------------------------------- + +Renders Hilbert Peano dithering directly into passed context. The +destination must be at least as large as source. + +If operation was aborted by a callback, non-zero is returned. + +Not all pixel types all supported. If particular combination is not supported +the function returns 'NULL' and sets errno to 'ENOSYS'. + +[source,c] +------------------------------------------------------------------------------- +#include <GP.h> +/* or */ +#include <filters/GP_Dither.h> + +GP_Context *GP_FilterHilbertPeanoAlloc(const GP_Context *src, + GP_PixelType pixel_type, + GP_ProgressCallback *callback); +------------------------------------------------------------------------------- + +Returns pointer to allocated context of given pixel_type. + +If 'malloc(2)' has failed, or operation was aborted by a callback 'NULL' is +returned. + +Not all pixel types all supported. If particular combination is not supported +the function returns 'NULL' and sets errno to 'ENOSYS'. + +Example Images +^^^^^^^^^^^^^^ +All following images were generated using 'grinder'. +(Click for bigger size) + +.Original Image; Floyd-Steinberg, Hilbert-Peano: 1-bit, 2-bit, 4-bit, 8-bit Grayscale; 1-bit, 2-bit, 3-bit (per channel) RGB +image:images/dither/lenna_small.png[ + "Original Image", + link="images/dither/lenna.png"] +image:images/dither/lenna_G1_FS_small.png[ + "1-bit Grayscale Floyd-Steinberg", + link="images/dither/lenna_G1_FS.png"] +image:images/dither/lenna_G1_HP_small.png[ + "1-bit Grayscale Hilbert-Peano", + link="images/dither/lenna_G1_HP.png"] +image:images/dither/lenna_G2_FS_small.png[ + "2-bit Grayscale Floyd-Steinberg", + link="images/dither/lenna_G2_FS.png"] +image:images/dither/lenna_G2_HP_small.png[ + "2-bit Grayscale Hilbert-Peano", + link="images/dither/lenna_G2_HP.png"] +image:images/dither/lenna_G4_FS_small.png[ + "4-bit Grayscale Floyd-Steinberg", + link="images/dither/lenna_G4_FS.png"] +image:images/dither/lenna_G4_HP_small.png[ + "4-bit Grayscale Hilbert-Peano", + link="images/dither/lenna_G4_HP.png"] +image:images/dither/lenna_G8_FS_small.png[ + "8-bit Grayscale Floyd-Steinberg", + link="images/dither/lenna_G8_FS.png"] +image:images/dither/lenna_G8_HP_small.png[ + "7-bit Grayscale Hilbert-Peano", + link="images/dither/lenna_G8_HP.png"] +image:images/dither/lenna_RGB111_FS_small.png[ + "1-bit RGB Floyd-Steinberg", + link="images/dither/lenna_RGB111_FS.png"] +image:images/dither/lenna_RGB111_HP_small.png[ + "1-bit RGB Hilbert-Peano", + link="images/dither/lenna_RGB111_HP.png"] +image:images/dither/lenna_RGB222_FS_small.png[ + "2-bit RGB Floyd-Steinberg", + link="images/dither/lenna_RGB222_FS.png"] +image:images/dither/lenna_RGB222_HP_small.png[ + "2-bit RGB Hilbert-Peano", + link="images/dither/lenna_RGB222_HP.png"] +image:images/dither/lenna_RGB333_FS_small.png[ + "3-bit RGB Floyd-Steinberg", + link="images/dither/lenna_RGB333_FS.png"] +image:images/dither/lenna_RGB333_HP_small.png[ + "3-bit RGB Hilbert-Peano", + link="images/dither/lenna_RGB333_HP.png"] diff --git a/doc/filters_python.txt b/doc/filters_python.txt new file mode 100644 index 0000000..a7c1ae4 --- /dev/null +++ b/doc/filters_python.txt @@ -0,0 +1,35 @@ +Python Filters module +--------------------- + +The python binding maps mostly to the C API with the 'GP_Filter' prefix +stripped. + +The filter functions could be called directly as +filters.Foo(img, ..)+ or +from submodule as +img.filters.Foo(..)+. Note that in the second case the +image is passed automatically as a first parameter. + +Ditherings +~~~~~~~~~~ + +[source,python] +------------------------------------------------------------------------------- +import gfxprim.core as core +import gfxprim.filters as filters + + # Returns img dithered to 1-bit Grayscale as a new image + res = img.filters.FloydSteinbergAlloc(core.C.PIXEL_G1, None) + + # Returns img dithered to 1-bit Grayscale as a new image + res = img.filters.HilbertPeanoAlloc(core.C.PIXEL_G1, None) + +------------------------------------------------------------------------------- + +Returns new 1-bit Grayscale image which is result from Floyd-Steinberg, +Hilbert-Peano dithering. + +The first parameter is pixel type, the second is progress callback. + +For more information and example images see link:filters_dithering.html[C +dithering documentation]. + +TIP: See complete link:example_py_dithering.html[example].
http://repo.or.cz/w/gfxprim.git/commit/84bb1080f66c943353a9e3aac213f0837a2ca...
commit 84bb1080f66c943353a9e3aac213f0837a2ca583 Author: Cyril Hrubis metan@ucw.cz Date: Tue Sep 24 17:43:57 2013 +0200
filters: ditherings: Cleanups.
Change the API of Floyd-Steinberg and Hilbert-Peano ditherings to match rest of the functions function.
* Rename the functions * Fix all usages * Update list of filters exported symbols * Fix python bindings * Add ditherings to API Coverage tests
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/build/syms/Filters_symbols.txt b/build/syms/Filters_symbols.txt index 839c437..970c881 100644 --- a/build/syms/Filters_symbols.txt +++ b/build/syms/Filters_symbols.txt @@ -21,44 +21,15 @@ GP_FilterDifference_Raw GP_FilterEdgePrewitt
GP_FilterEdgeSharpening - GP_FilterEdgeSharpeningAlloc
GP_FilterEdgeSobel
-GP_FilterFloydSteinberg_RGB888 -GP_FilterFloydSteinberg_RGB888_Alloc -GP_FilterFloydSteinberg_RGB888_Raw -GP_FilterFloydSteinberg_RGB888_to_BGR888_Raw -GP_FilterFloydSteinberg_RGB888_to_G1_Raw -GP_FilterFloydSteinberg_RGB888_to_G2_Raw -GP_FilterFloydSteinberg_RGB888_to_G4_Raw -GP_FilterFloydSteinberg_RGB888_to_G8_Raw -GP_FilterFloydSteinberg_RGB888_to_RGB565_Raw -GP_FilterFloydSteinberg_RGB888_to_RGB666_Raw -GP_FilterFloydSteinberg_RGB888_to_RGB888_Raw -GP_FilterFloydSteinberg_RGB888_to_xRGB14666_Raw -GP_FilterFloydSteinberg_RGB888_to_xRGB2222_Raw -GP_FilterFloydSteinberg_RGB888_to_xRGB7333_Raw -GP_FilterFloydSteinberg_RGB888_to_xRGB8888_Raw -GP_FilterFloydSteinberg_RGB888_to_G16_Raw - -GP_FilterHilbertPeano_RGB888 -GP_FilterHilbertPeano_RGB888_Alloc -GP_FilterHilbertPeano_RGB888_Raw -GP_FilterHilbertPeano_RGB888_to_BGR888_Raw -GP_FilterHilbertPeano_RGB888_to_G1_Raw -GP_FilterHilbertPeano_RGB888_to_G2_Raw -GP_FilterHilbertPeano_RGB888_to_G4_Raw -GP_FilterHilbertPeano_RGB888_to_G8_Raw -GP_FilterHilbertPeano_RGB888_to_RGB565_Raw -GP_FilterHilbertPeano_RGB888_to_RGB666_Raw -GP_FilterHilbertPeano_RGB888_to_RGB888_Raw -GP_FilterHilbertPeano_RGB888_to_xRGB14666_Raw -GP_FilterHilbertPeano_RGB888_to_xRGB2222_Raw -GP_FilterHilbertPeano_RGB888_to_xRGB7333_Raw -GP_FilterHilbertPeano_RGB888_to_xRGB8888_Raw -GP_FilterHilbertPeano_RGB888_to_G16_Raw +GP_FilterFloydSteinberg +GP_FilterFloydSteinbergAlloc + +GP_FilterHilbertPeano +GP_FilterHilbertPeanoAlloc
GP_FilterGaussianBlurEx GP_FilterGaussianBlurExAlloc diff --git a/demos/c_simple/loaders_register.c b/demos/c_simple/loaders_register.c index 877bff9..4b36461 100644 --- a/demos/c_simple/loaders_register.c +++ b/demos/c_simple/loaders_register.c @@ -121,7 +121,7 @@ int main(int argc, char *argv[]) return 1; }
- gc = GP_FilterFloydSteinberg_RGB888_Alloc(c, GP_PIXEL_G2, NULL); + gc = GP_FilterFloydSteinbergAlloc(c, GP_PIXEL_G2, NULL);
if (gc == NULL) { fprintf(stderr, "FloydSteinberg: %sn", strerror(errno)); diff --git a/demos/c_simple/v4l2_show.c b/demos/c_simple/v4l2_show.c index 50ea514..c564f95 100644 --- a/demos/c_simple/v4l2_show.c +++ b/demos/c_simple/v4l2_show.c @@ -108,7 +108,7 @@ int main(int argc, char *argv[]) break; case 2: GP_FilterGaussianBlur(img, img, 1, 1, NULL); - res = GP_FilterFloydSteinberg_RGB888_Alloc(img, GP_PIXEL_G2, NULL); + res = GP_FilterFloydSteinbergAlloc(img, GP_PIXEL_G2, NULL); break; }
diff --git a/demos/grinder/grinder.c b/demos/grinder/grinder.c index c406ef5..7bc3071 100644 --- a/demos/grinder/grinder.c +++ b/demos/grinder/grinder.c @@ -465,8 +465,8 @@ static int dither(GP_Context **c, const char *params) }
GP_Context *bw; - bw = GP_FilterFloydSteinberg_RGB888_Alloc(*c, dither_pixel_types[fmt], - progress_callback); + bw = GP_FilterFloydSteinbergAlloc(*c, dither_pixel_types[fmt], + progress_callback);
//TODO: so far we convert the context back to RGB888 //(so we can do further work with it) diff --git a/demos/py_simple/dither.py b/demos/py_simple/dither.py index d7ca1b8..0437931 100755 --- a/demos/py_simple/dither.py +++ b/demos/py_simple/dither.py @@ -13,7 +13,7 @@ def main(): # Load Image img = loaders.Load(sys.argv[1]) # Use Floyd-Steinberg dithering - res = filters.FloydSteinberg_RGB888_Alloc(img, core.C.PIXEL_G1, None) + res = img.filters.FloydSteinbergAlloc(core.C.PIXEL_G1, None) # Save result into grayscale png res.loaders.SavePNG("out.png")
diff --git a/demos/spiv/spiv.c b/demos/spiv/spiv.c index 2d4e4ef..8be792a 100644 --- a/demos/spiv/spiv.c +++ b/demos/spiv/spiv.c @@ -318,8 +318,8 @@ static void update_display(struct loader_params *params, GP_Context *img, if (params->use_dithering) { callback.priv = "Dithering"; GP_SubContext(context, &sub_display, cx, cy, img->w, img->h); - GP_FilterFloydSteinberg_RGB888(img, &sub_display, NULL); - // GP_FilterHilbertPeano_RGB888(img, &sub_display, NULL); + GP_FilterFloydSteinberg(img, &sub_display, NULL); + // GP_FilterHilbertPeano(img, &sub_display, NULL); } else { if (GP_PixelHasFlags(img->pixel_type, GP_PIXEL_HAS_ALPHA)) pattern_fill(context, cx, cy, img->w, img->h); diff --git a/include/filters/GP_Dither.h b/include/filters/GP_Dither.h index 2c4d321..848ea83 100644 --- a/include/filters/GP_Dither.h +++ b/include/filters/GP_Dither.h @@ -16,7 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301 USA * * * - * Copyright (C) 2009-2012 Cyril Hrubis metan@ucw.cz * + * Copyright (C) 2009-2013 Cyril Hrubis metan@ucw.cz * * * *****************************************************************************/
@@ -50,13 +50,6 @@ */
/* - * Semi internal raw version, use at your own risk. - */ -int GP_FilterFloydSteinberg_RGB888_Raw(const GP_Context *src, - GP_Context *dst, - GP_ProgressCallback *callback); - -/* * Converts RGB888 24bit image to any RGB or Grayscale bitmap. * * The source pixel_type MUST BE GP_PIXEL_RGB888. @@ -65,17 +58,17 @@ int GP_FilterFloydSteinberg_RGB888_Raw(const GP_Context *src, * * If operation was aborted from within a callback, non-zero is returned. */ -int GP_FilterFloydSteinberg_RGB888(const GP_Context *src, - GP_Context *dst, - GP_ProgressCallback *callback); +int GP_FilterFloydSteinberg(const GP_Context *src, + GP_Context *dst, + GP_ProgressCallback *callback);
/* * If malloc() has failed, or operation was aborted by a callback, NULL is * returned. */ -GP_Context *GP_FilterFloydSteinberg_RGB888_Alloc(const GP_Context *src, - GP_PixelType pixel_type, - GP_ProgressCallback *callback); +GP_Context *GP_FilterFloydSteinbergAlloc(const GP_Context *src, + GP_PixelType pixel_type, + GP_ProgressCallback *callback);
/* * Hilbert-Peano space filling curve based dithering. @@ -88,13 +81,6 @@ GP_Context *GP_FilterFloydSteinberg_RGB888_Alloc(const GP_Context *src, */
/* - * Semi internal raw version, use at your own risk. - */ -int GP_FilterHilbertPeano_RGB888_Raw(const GP_Context *src, - GP_Context *dst, - GP_ProgressCallback *callback); - -/* * Converts RGB888 24bit image to any RGB or Grayscale bitmap. * * The source pixel_type MUST BE GP_PIXEL_RGB888. @@ -103,16 +89,16 @@ int GP_FilterHilbertPeano_RGB888_Raw(const GP_Context *src, * * If the operation was aborted from within a callback, non-zero is returned. */ -int GP_FilterHilbertPeano_RGB888(const GP_Context *src, - GP_Context *dst, - GP_ProgressCallback *callback); +int GP_FilterHilbertPeano(const GP_Context *src, + GP_Context *dst, + GP_ProgressCallback *callback);
/* * If malloc() has failed, or operation was aborted by a callback, NULL is * returned. */ -GP_Context *GP_FilterHilbertPeano_RGB888_Alloc(const GP_Context *src, - GP_PixelType pixel_type, - GP_ProgressCallback *callback); +GP_Context *GP_FilterHilbertPeanoAlloc(const GP_Context *src, + GP_PixelType pixel_type, + GP_ProgressCallback *callback);
#endif /* FILTERS_GP_DITHER_H */ diff --git a/libs/filters/GP_Dither.c b/libs/filters/GP_Dither.c deleted file mode 100644 index a050513..0000000 --- a/libs/filters/GP_Dither.c +++ /dev/null @@ -1,85 +0,0 @@ -/***************************************************************************** - * This file is part of gfxprim library. * - * * - * Gfxprim is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Lesser General Public * - * License as published by the Free Software Foundation; either * - * version 2.1 of the License, or (at your option) any later version. * - * * - * Gfxprim is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with gfxprim; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - * Copyright (C) 2009-2012 Cyril Hrubis metan@ucw.cz * - * * - *****************************************************************************/ - -#include "GP_Dither.h" - -int GP_FilterFloydSteinberg_RGB888(const GP_Context *src, - GP_Context *dst, - GP_ProgressCallback *callback) -{ - GP_CHECK(src->pixel_type == GP_PIXEL_RGB888); - GP_CHECK(src->w <= dst->w); - GP_CHECK(src->h <= dst->h); - - return GP_FilterFloydSteinberg_RGB888_Raw(src, dst, callback); -} - - -GP_Context *GP_FilterFloydSteinberg_RGB888_Alloc(const GP_Context *src, - GP_PixelType pixel_type, - GP_ProgressCallback *callback) -{ - GP_Context *ret; - - ret = GP_ContextAlloc(src->w, src->h, pixel_type); - - if (ret == NULL) - return NULL; - - if (GP_FilterFloydSteinberg_RGB888_Raw(src, ret, callback)) { - GP_ContextFree(ret); - return NULL; - } - - return ret; -} - - -int GP_FilterHilbertPeano_RGB888(const GP_Context *src, - GP_Context *dst, - GP_ProgressCallback *callback) -{ - GP_CHECK(src->pixel_type == GP_PIXEL_RGB888); - GP_CHECK(src->w <= dst->w); - GP_CHECK(src->h <= dst->h); - - return GP_FilterHilbertPeano_RGB888_Raw(src, dst, callback); -} - -GP_Context *GP_FilterHilbertPeano_RGB888_Alloc(const GP_Context *src, - GP_PixelType pixel_type, - GP_ProgressCallback *callback) -{ - GP_Context *ret; - - ret = GP_ContextAlloc(src->w, src->h, pixel_type); - - if (ret == NULL) - return NULL; - - if (GP_FilterHilbertPeano_RGB888_Raw(src, ret, callback)) { - GP_ContextFree(ret); - return NULL; - } - - return ret; -} diff --git a/libs/filters/GP_FloydSteinberg.gen.c.t b/libs/filters/GP_FloydSteinberg.gen.c.t index 2d4d401..32a2534 100644 --- a/libs/filters/GP_FloydSteinberg.gen.c.t +++ b/libs/filters/GP_FloydSteinberg.gen.c.t @@ -26,11 +26,13 @@
%% block body
+#include <string.h> +#include <errno.h> + #include "core/GP_Core.h" #include "core/GP_Pixel.h" -#include "GP_Filter.h" - -#include <string.h> +#include "filters/GP_Filter.h" +#include "filters/GP_Dither.h"
%% macro distribute_error(errors, x, y, w, err) if ({{ x }} + 1 < {{ w }}) @@ -46,16 +48,17 @@ %% endmacro
%% for pt in pixeltypes -%% if pt.is_gray() or pt.is_rgb() and not pt.is_alpha() +%% if pt.is_gray() or pt.is_rgb() and not pt.is_alpha() /* * Floyd Steinberg RGB888 to {{ pt.name }} */ -int GP_FilterFloydSteinberg_RGB888_to_{{ pt.name }}_Raw(const GP_Context *src, GP_Context *dst, +static int floyd_steinberg_RGB888_to_{{ pt.name }}_Raw(const GP_Context *src, + GP_Context *dst, GP_ProgressCallback *callback) { -%% for c in pt.chanslist +%% for c in pt.chanslist float errors_{{ c[0] }}[2][src->w]; -%% endfor +%% endfor
GP_DEBUG(1, "Floyd Steinberg %s to %s %ux%u", GP_PixelTypeName(src->pixel_type), @@ -64,51 +67,51 @@ int GP_FilterFloydSteinberg_RGB888_to_{{ pt.name }}_Raw(const GP_Context *src, G
GP_Coord x, y;
-%% for c in pt.chanslist +%% for c in pt.chanslist memset(errors_{{ c[0] }}[0], 0, src->w * sizeof(float)); memset(errors_{{ c[0] }}[1], 0, src->w * sizeof(float)); -%% endfor +%% endfor
for (y = 0; y < (GP_Coord)src->h; y++) { for (x = 0; x < (GP_Coord)src->w; x++) { GP_Pixel pix = GP_GetPixel_Raw_24BPP(src, x, y);
-%% for c in pt.chanslist -%% if pt.is_gray() +%% for c in pt.chanslist +%% if pt.is_gray() float val_{{ c[0] }} = GP_Pixel_GET_R_RGB888(pix) + GP_Pixel_GET_G_RGB888(pix) + GP_Pixel_GET_B_RGB888(pix); -%% else +%% else float val_{{ c[0] }} = GP_Pixel_GET_{{ c[0] }}_RGB888(pix); -%% endif +%% endif val_{{ c[0] }} += errors_{{ c[0] }}[y%2][x];
float err_{{ c[0] }} = val_{{ c[0] }}; -%% if pt.is_gray() +%% if pt.is_gray() GP_Pixel res_{{ c[0] }} = {{ 2 ** c[2] - 1}} * val_{{ c[0] }} / (3 * 255); err_{{ c[0] }} -= res_{{ c[0] }} * (3 * 255) / {{ 2 ** c[2] - 1}}; -%% else +%% else GP_Pixel res_{{ c[0] }} = {{ 2 ** c[2] - 1}} * val_{{ c[0] }} / 255; err_{{ c[0] }} -= res_{{ c[0] }} * 255 / {{ 2 ** c[2] - 1}}; -%% endif +%% endif
{{ distribute_error("errors_%s"|format(c[0]), 'x', 'y', '(GP_Coord)src->w', 'err_%s'|format(c[0])) }}
{{ clamp_val("res_%s"|format(c[0]), c[2]) }} -%% endfor +%% endfor
-%% if pt.is_gray() +%% if pt.is_gray() GP_PutPixel_Raw_{{ pt.pixelsize.suffix }}(dst, x, y, res_V); -%% else +%% else GP_Pixel res = GP_Pixel_CREATE_{{ pt.name }}(res_{{ pt.chanslist[0][0] }}{% for c in pt.chanslist[1:] %}, res_{{ c[0] }}{% endfor %});
GP_PutPixel_Raw_{{ pt.pixelsize.suffix }}(dst, x, y, res); -%% endif +%% endif }
-%% for c in pt.chanslist +%% for c in pt.chanslist memset(errors_{{ c[0] }}[y%2], 0, src->w * sizeof(float)); -%% endfor +%% endfor
if (GP_ProgressCallbackReport(callback, y, src->h, src->w)) return 1; @@ -118,23 +121,61 @@ int GP_FilterFloydSteinberg_RGB888_to_{{ pt.name }}_Raw(const GP_Context *src, G return 0; }
-%% endif +%% endif %% endfor
-int GP_FilterFloydSteinberg_RGB888_Raw(const GP_Context *src, - GP_Context *dst, - GP_ProgressCallback *callback) +static int floyd_steinberg(const GP_Context *src, GP_Context *dst, + GP_ProgressCallback *callback) { switch (dst->pixel_type) { -%% for pt in pixeltypes -%% if pt.is_gray() or pt.is_rgb() and not pt.is_alpha() +%% for pt in pixeltypes +%% if pt.is_gray() or pt.is_rgb() and not pt.is_alpha() case GP_PIXEL_{{ pt.name }}: - return GP_FilterFloydSteinberg_RGB888_to_{{ pt.name }}_Raw(src, dst, callback); -%% endif -%% endfor + return floyd_steinberg_RGB888_to_{{ pt.name }}_Raw(src, dst, callback); +%% endif +%% endfor default: return 1; } }
+int GP_FilterFloydSteinberg(const GP_Context *src, GP_Context *dst, + GP_ProgressCallback *callback) +{ + GP_CHECK(src->w <= dst->w); + GP_CHECK(src->h <= dst->h); + + if (src->pixel_type != GP_PIXEL_RGB888) { + errno = ENOSYS; + return 1; + } + + return floyd_steinberg(src, dst, callback); +} + + +GP_Context *GP_FilterFloydSteinbergAlloc(const GP_Context *src, + GP_PixelType pixel_type, + GP_ProgressCallback *callback) +{ + GP_Context *ret; + + if (src->pixel_type != GP_PIXEL_RGB888) { + errno = ENOSYS; + return NULL; + } + + ret = GP_ContextAlloc(src->w, src->h, pixel_type); + + if (ret == NULL) + return NULL; + + if (floyd_steinberg(src, ret, callback)) { + GP_ContextFree(ret); + return NULL; + } + + return ret; +} + %% endblock body diff --git a/libs/filters/GP_HilbertPeano.gen.c.t b/libs/filters/GP_HilbertPeano.gen.c.t index 90ed943..c1660e4 100644 --- a/libs/filters/GP_HilbertPeano.gen.c.t +++ b/libs/filters/GP_HilbertPeano.gen.c.t @@ -26,10 +26,13 @@
%% block body
+#include <errno.h> + #include "core/GP_Core.h" #include "core/GP_GetPutPixel.h" -#include "GP_HilbertCurve.h" -#include "GP_Filter.h" +#include "filters/GP_HilbertCurve.h" +#include "filters/GP_Filter.h" +#include "filters/GP_Dither.h"
/* * Returns closest greater square of two, used to determine the curve size. @@ -49,11 +52,11 @@ 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() +%% if pt.is_gray() or pt.is_rgb() and not pt.is_alpha() /* * Hilbert Peano RGB888 to {{ pt.name }} */ -int GP_FilterHilbertPeano_RGB888_to_{{ pt.name }}_Raw(const GP_Context *src, +static int hilbert_peano_RGB888_to_{{ pt.name }}_Raw(const GP_Context *src, GP_Context *dst, GP_ProgressCallback *callback) { @@ -70,41 +73,41 @@ int GP_FilterHilbertPeano_RGB888_to_{{ pt.name }}_Raw(const GP_Context *src, unsigned int cnt = 0;
/* error counters */ -%% for c in pt.chanslist +%% for c in pt.chanslist int err_{{ c[0] }} = 0; -%% endfor +%% endfor
while (GP_HilbertCurveContinues(&state)) { if (state.x < src->w && state.y < src->h) { GP_Pixel pix = GP_GetPixel_Raw_24BPP(src, state.x, state.y);
-%% for c in pt.chanslist -%% if pt.is_gray() +%% for c in pt.chanslist +%% if pt.is_gray() int pix_{{ c[0] }} = GP_Pixel_GET_R_RGB888(pix) + GP_Pixel_GET_G_RGB888(pix) + GP_Pixel_GET_B_RGB888(pix); -%% else +%% else int pix_{{ c[0] }} = GP_Pixel_GET_{{ c[0] }}_RGB888(pix); -%% endif +%% endif
pix_{{ c[0] }} += err_{{ c[0] }};
-%% if pt.is_gray() +%% if pt.is_gray() int res_{{ c[0] }} = ({{ 2 ** c[2] - 1}} * pix_{{ c[0] }} + 382) / {{ 3 * 255 }}; err_{{ c[0] }} = pix_{{ c[0] }} - {{ 3 * 255 }} * res_{{ c[0] }} / {{ 2 ** c[2] - 1 }}; -%% else +%% else int res_{{ c[0] }} = ({{ 2 ** c[2] - 1}} * pix_{{ c[0] }} + 127) / 255; err_{{ c[0] }} = pix_{{ c[0] }} - 255 * res_{{ c[0] }} / {{ 2 ** c[2] - 1 }}; -%% endif -%% endfor +%% endif +%% endfor
-%% if pt.is_gray() +%% if pt.is_gray() GP_PutPixel_Raw_{{ pt.pixelsize.suffix }}(dst, state.x, state.y, res_V); -%% else +%% else GP_Pixel res = GP_Pixel_CREATE_{{ pt.name }}(res_{{ pt.chanslist[0][0] }}{% for c in pt.chanslist[1:] %}, res_{{ c[0] }}{% endfor %});
GP_PutPixel_Raw_{{ pt.pixelsize.suffix }}(dst, state.x, state.y, res); -%% endif +%% endif cnt++;
if (GP_ProgressCallbackReport(callback, cnt/src->h, src->w, src->h)) @@ -116,9 +119,9 @@ int GP_FilterHilbertPeano_RGB888_to_{{ pt.name }}_Raw(const GP_Context *src, return 0; } } else { -%% for c in pt.chanslist +%% for c in pt.chanslist err_{{ c[0] }} = 0; -%% endfor +%% endfor }
GP_HilbertCurveNext(&state); @@ -128,23 +131,60 @@ int GP_FilterHilbertPeano_RGB888_to_{{ pt.name }}_Raw(const GP_Context *src, return 0; }
-%% endif +%% endif %% endfor
-int GP_FilterHilbertPeano_RGB888_Raw(const GP_Context *src, - GP_Context *dst, - GP_ProgressCallback *callback) +static int hilbert_peano(const GP_Context *src, GP_Context *dst, + GP_ProgressCallback *callback) { switch (dst->pixel_type) { %% for pt in pixeltypes -%% if pt.is_gray() or pt.is_rgb() and not pt.is_alpha() +%% if pt.is_gray() or pt.is_rgb() and not pt.is_alpha() case GP_PIXEL_{{ pt.name }}: - return GP_FilterHilbertPeano_RGB888_to_{{ pt.name }}_Raw(src, dst, callback); -%% endif + return hilbert_peano_RGB888_to_{{ pt.name }}_Raw(src, dst, callback); +%% endif %% endfor default: return 1; } }
+int GP_FilterHilbertPeano(const GP_Context *src, GP_Context *dst, + GP_ProgressCallback *callback) +{ + GP_CHECK(src->w <= dst->w); + GP_CHECK(src->h <= dst->h); + + if (src->pixel_type != GP_PIXEL_RGB888) { + errno = ENOSYS; + return 1; + } + + return hilbert_peano(src, dst, callback); +} + +GP_Context *GP_FilterHilbertPeanoAlloc(const GP_Context *src, + GP_PixelType pixel_type, + GP_ProgressCallback *callback) +{ + GP_Context *ret; + + if (src->pixel_type != GP_PIXEL_RGB888) { + errno = ENOSYS; + return NULL; + } + + ret = GP_ContextAlloc(src->w, src->h, pixel_type); + + if (ret == NULL) + return NULL; + + if (hilbert_peano(src, ret, callback)) { + GP_ContextFree(ret); + return NULL; + } + + return ret; +} + %% endblock body diff --git a/pylib/gfxprim/filters/__init__.py b/pylib/gfxprim/filters/__init__.py index 4ce1880..67022ba 100644 --- a/pylib/gfxprim/filters/__init__.py +++ b/pylib/gfxprim/filters/__init__.py @@ -34,7 +34,9 @@ def _init(module): 'Laplace', 'LaplaceAlloc', 'EdgeSharpening', 'EdgeSharpeningAlloc', 'Median', 'MedianAlloc', 'MedianEx', 'MedianExAlloc', - 'Sigma', 'SigmaAlloc', 'SigmaEx', 'SigmaExAlloc']: + 'Sigma', 'SigmaAlloc', 'SigmaEx', 'SigmaExAlloc', + 'FloydSteinberg', 'FloydSteinbergAlloc', + 'HilbertPeano', 'HilbertPeanoAlloc']: extend_submodule(FiltersSubmodule, name, c_filters.__getattribute__('GP_Filter' + name))
# Imports from the SWIG module diff --git a/pylib/gfxprim/filters/filters.i b/pylib/gfxprim/filters/filters.i index 9610342..7417ec4 100644 --- a/pylib/gfxprim/filters/filters.i +++ b/pylib/gfxprim/filters/filters.i @@ -71,13 +71,9 @@ FILTER_FUNC(ResizeLinearInt); FILTER_FUNC(ResizeLinearLFInt); %include "GP_ResizeLinear.h"
-/* TODO: Ditherings */ -%newobject GP_FilterFloydSteinberg_RGB888_Alloc; -ERROR_ON_NULL(GP_FilterFloydSteinberg_RGB888_Alloc); -%newobject GP_FilterHilbertPeano_RGB888_Alloc; -ERROR_ON_NULL(GP_FilterHilbertPeano_RGB888_Alloc); -ERROR_ON_NONZERO(GP_FilterFloydSteinberg_RGB888); -ERROR_ON_NONZERO(GP_FilterHilbertPeano_RGB888); +/* Ditherings */ +FILTER_FUNC(FloydSteinberg); +FILTER_FUNC(GP_FilterHilbertPeano); %include "GP_Dither.h"
/* Laplace and Laplace Edge Sharpening */ diff --git a/tests/filters/APICoverage.gen.c.t b/tests/filters/APICoverage.gen.c.t index ab22dd0..323f614 100644 --- a/tests/filters/APICoverage.gen.c.t +++ b/tests/filters/APICoverage.gen.c.t @@ -96,6 +96,16 @@ 'GP_ProgressCallback'], ['ResizeNNAlloc', 'GP_Context:in', 'int:w', 'int:h', 'GP_ProgressCallback'], + + ['FloydSteinberg', 'GP_Context:in', 'GP_Context:out', + 'GP_ProgressCallback'], + ['FloydSteinbergAlloc', 'GP_Context:in', 'GP_PixelType:G8', + 'GP_ProgressCallback'], + + ['HilbertPeano', 'GP_Context:in', 'GP_Context:out', + 'GP_ProgressCallback'], + ['HilbertPeanoAlloc', 'GP_Context:in', 'GP_PixelType:G8', + 'GP_ProgressCallback'], ]
%% macro prep_context(id, pt) @@ -110,6 +120,10 @@ int {{ id }} = 2; %% endmacro
+%% macro prep_pixel_type(id) + GP_PixelType {{ id }} = GP_PIXEL_{{ id }}; +%% endmacro + %% macro prep_median_weights(id)
unsigned int {{ id }}_w[] = { @@ -161,6 +175,9 @@ %% if (param.split(':', 1)[0] == 'GP_FilterKernel2D') {{ prep_filter_kernel_2d(param.split(':', 1)[1]) }} %% endif +%% if (param.split(':', 1)[0] == 'GP_PixelType') +{{ prep_pixel_type(param.split(':', 1)[1]) }} +%% endif %% endmacro
{% macro get_param(param) %}{% if len(param.split(':', 1)) == 1 %}NULL{% else %}{{ param.split(':', 1)[1] }}{% endif %}{% endmacro %} @@ -190,7 +207,7 @@ const struct tst_suite tst_suite = { %% for fn in API_List %% for pt in pixeltypes %% if not pt.is_unknown() - {.name = "Filter {{ fn[0] }} {{ pt.name }}", + {.name = "Filter {{ fn[0] }} {{ pt.name }}", .tst_fn = Filter_{{ fn[0] }}_{{ pt.name }}}, %% endif %% endfor
-----------------------------------------------------------------------
Summary of changes: build/Makefile | 4 +- build/check_symbols.sh | 17 ++ build/syms/Core_symbols.txt | 3 + build/syms/Filters_symbols.txt | 39 +---- build/syms/Text_symbols.txt | 5 +- demos/c_simple/loaders_register.c | 2 +- demos/c_simple/v4l2_show.c | 2 +- demos/grinder/grinder.c | 4 +- demos/py_simple/dither.py | 2 +- demos/spiv/spiv.c | 4 +- doc/Makefile | 1 + doc/asciidoc.conf | 5 +- ...le_py_backends.txt => example_py_dithering.txt} | 8 +- doc/filters.txt | 141 +----------------- doc/filters_dithering.txt | 159 ++++++++++++++++++++ doc/filters_python.txt | 35 +++++ include/filters/GP_Dither.h | 40 ++---- libs/filters/GP_Dither.c | 85 ----------- libs/filters/GP_FloydSteinberg.gen.c.t | 103 +++++++++---- libs/filters/GP_HilbertPeano.gen.c.t | 92 ++++++++---- pylib/gfxprim/filters/__init__.py | 4 +- pylib/gfxprim/filters/filters.i | 10 +- tests/filters/APICoverage.gen.c.t | 19 +++- 23 files changed, 416 insertions(+), 368 deletions(-) copy doc/{example_py_backends.txt => example_py_dithering.txt} (51%) create mode 100644 doc/filters_dithering.txt create mode 100644 doc/filters_python.txt delete mode 100644 libs/filters/GP_Dither.c
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.