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 4da03cd71c2d22bc18b3d33e8a804de206beb57a (commit) via f4da24627bdbc2c598e29a04db851d0fc0d8ef7d (commit) via 92b4a111042c16733e2c23b1ed41e7a56ac52023 (commit) via 2212fd623e8e09bf468d3b72e4468a604511a9c9 (commit) via 8114cdf5bd54ace1d44cbe94e8b980d924fd4d20 (commit) via 73403e601211315ce51c3e41ddfec233cb8415ee (commit) via 069c44a2fb6118fbcfabcf0cf5bac8f1f93c7108 (commit) from 5c9dc009be46441c7144aeed9461616baeb931a2 (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/4da03cd71c2d22bc18b3d33e8a804de206beb...
commit 4da03cd71c2d22bc18b3d33e8a804de206beb57a Author: Cyril Hrubis metan@ucw.cz Date: Fri Sep 27 21:08:01 2013 +0200
doc: Work on python filter docs (add GaussianBlur)
* Add Gaussian blur example images generator (gfxprim must be installed to regenerate the images)
* Add Gaussian blur python example + docs
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/doc/Makefile b/doc/Makefile index 3aec846..dee519e 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -24,12 +24,17 @@ PAGES+=$(subst .txt,.html,$(EXAMPLE_SOURCES))
.PHONY: toolcheck clean
- all: toolcheck examples.html $(PAGES) api.html
$(PAGES): asciidoc.conf
# +# Dependencies +# +filters_python.html: images/blur/images.txt + + +# # Check if we have all the needed tools # toolcheck: diff --git a/doc/example_py_blur.txt b/doc/example_py_blur.txt new file mode 100644 index 0000000..cfe5577 --- /dev/null +++ b/doc/example_py_blur.txt @@ -0,0 +1,8 @@ +Gaussian Blur Example +--------------------- +.A simple program that loads image, blurs it and saves result + +[source,python] +------------------------------------------------------------------ +include::../demos/py_simple/blur.py[] +------------------------------------------------------------------ diff --git a/doc/filters_python.txt b/doc/filters_python.txt index a7c1ae4..324f160 100644 --- a/doc/filters_python.txt +++ b/doc/filters_python.txt @@ -8,6 +8,29 @@ 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.
+Blurs +~~~~~ + +[source,python] +------------------------------------------------------------------------------- +import gfxprim.core as core +import gfxprim.filters as filters + + # Does in-place Gaussian blur, the image is modified in-place + filters.GaussianBlur(img, img, x_sigma, y_sigma, callback=None) + + # Returns newly alocated blurred image + res = img.filters.GaussianBlur(x_sigma, y_sigma, callback=None) + +------------------------------------------------------------------------------- + +Gaussian blur (low pass) filters implemented as bilinear separable +convolution. + +TIP: See link:example_py_blur.html[blur example]. + +include::images/blur/images.txt[] + Ditherings ~~~~~~~~~~
@@ -17,10 +40,10 @@ 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) + res = img.filters.FloydSteinbergAlloc(core.C.PIXEL_G1, callback=None)
# Returns img dithered to 1-bit Grayscale as a new image - res = img.filters.HilbertPeanoAlloc(core.C.PIXEL_G1, None) + res = img.filters.HilbertPeanoAlloc(core.C.PIXEL_G1, callback=None)
-------------------------------------------------------------------------------
@@ -32,4 +55,4 @@ 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]. +TIP: See link:example_py_dithering.html[dithering example]. diff --git a/doc/images/blur/Makefile b/doc/images/blur/Makefile new file mode 100644 index 0000000..4c642ec --- /dev/null +++ b/doc/images/blur/Makefile @@ -0,0 +1,7 @@ +all: images.txt + +images.txt: regen.py + @./regen.py + +clean: + rm -f *.png images.txt diff --git a/doc/images/blur/images.txt b/doc/images/blur/images.txt new file mode 100644 index 0000000..b9d7434 --- /dev/null +++ b/doc/images/blur/images.txt @@ -0,0 +1,17 @@ +.Example Images: Original Image; Gaussian Blur 2 2, 0 4, 4 0, 10 10 +image:images/orig/lenna_small.png[ + "Original Image", + link="images/orig/lenna.png"] +image:images/blur/lenna_small_2_2.png[ + "Gaussian Blur x_sig=2 y_sig=2", + link="images/blur/lenna_2_2.png"] +image:images/blur/lenna_small_0_4.png[ + "Gaussian Blur x_sig=4 y_sig=4", + link="images/blur/lenna_0_4.png"] +image:images/blur/lenna_small_4_0.png[ + "Gaussian Blur x_sig=0 y_sig=0", + link="images/blur/lenna_4_0.png"] +image:images/blur/lenna_small_10_10.png[ + "Gaussian Blur x_sig=10 y_sig=10", + link="images/blur/lenna_10_10.png"] + diff --git a/doc/images/blur/lenna_0_4.png b/doc/images/blur/lenna_0_4.png new file mode 100644 index 0000000..05e3814 Binary files /dev/null and b/doc/images/blur/lenna_0_4.png differ diff --git a/doc/images/blur/lenna_10_10.png b/doc/images/blur/lenna_10_10.png new file mode 100644 index 0000000..396fc7e Binary files /dev/null and b/doc/images/blur/lenna_10_10.png differ diff --git a/doc/images/blur/lenna_2_2.png b/doc/images/blur/lenna_2_2.png new file mode 100644 index 0000000..fa8bf6f Binary files /dev/null and b/doc/images/blur/lenna_2_2.png differ diff --git a/doc/images/blur/lenna_4_0.png b/doc/images/blur/lenna_4_0.png new file mode 100644 index 0000000..dc8bc7e Binary files /dev/null and b/doc/images/blur/lenna_4_0.png differ diff --git a/doc/images/blur/lenna_small_0_4.png b/doc/images/blur/lenna_small_0_4.png new file mode 100644 index 0000000..ad3e5a2 Binary files /dev/null and b/doc/images/blur/lenna_small_0_4.png differ diff --git a/doc/images/blur/lenna_small_10_10.png b/doc/images/blur/lenna_small_10_10.png new file mode 100644 index 0000000..63493dd Binary files /dev/null and b/doc/images/blur/lenna_small_10_10.png differ diff --git a/doc/images/blur/lenna_small_2_2.png b/doc/images/blur/lenna_small_2_2.png new file mode 100644 index 0000000..ad82e72 Binary files /dev/null and b/doc/images/blur/lenna_small_2_2.png differ diff --git a/doc/images/blur/lenna_small_4_0.png b/doc/images/blur/lenna_small_4_0.png new file mode 100644 index 0000000..9fe4a10 Binary files /dev/null and b/doc/images/blur/lenna_small_4_0.png differ diff --git a/doc/images/blur/regen.py b/doc/images/blur/regen.py new file mode 100755 index 0000000..13e9d39 --- /dev/null +++ b/doc/images/blur/regen.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python + +import sys + +import gfxprim.core as core +import gfxprim.loaders as loaders +import gfxprim.filters as filters + +orig_path='images/orig/' +self_path='images/blur/' + +def write_asciidoc_head(f): + f.write('.Example Images: Original Image; Gaussian Blur 2 2, 0 4, 4 0, 10 10n') + f.write('image:' + orig_path + 'lenna_small.png[n') + f.write('t"Original Image",n') + f.write('tlink="' + orig_path + 'lenna.png"]n') + +def write_img_asciidoc(f, name, fname): + f.write('image:' + self_path + 'lenna_small_' + fname + '.png[n') + f.write('t"' + name + '",n') + f.write('tlink="' + self_path + 'lenna_' + fname + '.png"]n') + +def write_asciidoc_tail(f): + f.write('n') + +def gen_blur(f, img, img_small, x_sigma, y_sigma): + print("Generating Blur %s %s" % (x_sigma, y_sigma)) + name = '%s_%s' % (x_sigma, y_sigma) + res = img.filters.GaussianBlurAlloc(x_sigma, y_sigma); + res.loaders.Save('lenna_' + name + '.png') + res = res.filters.ResizeAlloc(img_small.w, img_small.h, 2) + res.loaders.Save('lenna_small_' + name + '.png') + write_img_asciidoc(f, 'Gaussian Blur x_sig=%s y_sig=%s' % (y_sigma, y_sigma), name) + +def main(): + lenna = loaders.Load('../../' + orig_path + 'lenna.png') + lenna_small = loaders.Load('../../' + orig_path + 'lenna_small.png') + + f = open('images.txt', 'w') + + write_asciidoc_head(f) + + gen_blur(f, lenna, lenna_small, 2, 2) + gen_blur(f, lenna, lenna_small, 0, 4) + gen_blur(f, lenna, lenna_small, 4, 0) + gen_blur(f, lenna, lenna_small, 10, 10) + + write_asciidoc_tail(f) + + f.close() + +if __name__ == '__main__': + main() diff --git a/doc/images/orig/lenna.png b/doc/images/orig/lenna.png new file mode 100644 index 0000000..475bc7a Binary files /dev/null and b/doc/images/orig/lenna.png differ diff --git a/doc/images/orig/lenna_small.png b/doc/images/orig/lenna_small.png new file mode 100644 index 0000000..018ad48 Binary files /dev/null and b/doc/images/orig/lenna_small.png differ
http://repo.or.cz/w/gfxprim.git/commit/f4da24627bdbc2c598e29a04db851d0fc0d8e...
commit f4da24627bdbc2c598e29a04db851d0fc0d8ef7d Author: Cyril Hrubis metan@ucw.cz Date: Fri Sep 27 20:35:31 2013 +0200
filters: Blur: Hotfix the GaussianBlurAlloc() case
The code wrongly passed src as src and dst as dst to both vertical and horizontal convolution, which is wrong in case src != dst because the result from the first convolution is always lost.
Workaround this by passing dst as both src and dst to the second one. The drawback is that the second convolution would not run in multiple threads but at least it yields correct result.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/libs/filters/GP_Blur.c b/libs/filters/GP_Blur.c index 2069484..51155cf 100644 --- a/libs/filters/GP_Blur.c +++ b/libs/filters/GP_Blur.c @@ -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 * * * *****************************************************************************/
@@ -79,6 +79,7 @@ int GP_FilterGaussianBlur_Raw(const GP_Context *src, { unsigned int size_x = gaussian_kernel_size(x_sigma); unsigned int size_y = gaussian_kernel_size(y_sigma); + GP_Context *tmp = dst;
GP_DEBUG(1, "Gaussian blur x_sigma=%2.3f y_sigma=%2.3f kernel %ix%i image %ux%u", x_sigma, y_sigma, size_x, size_y, w_src, h_src); @@ -116,18 +117,26 @@ int GP_FilterGaussianBlur_Raw(const GP_Context *src,
if (GP_FilterHConvolutionMP_Raw(¶ms)) return 1; + } else { + tmp = src; }
if (new_callback != NULL) new_callback->callback = gaussian_callback_vert;
+ /* + * TODO: This part runs always in-place, which is wrong if + * we run in multiple threads as this part would run + * only singlethreaded. We need temp buffer for the + * first part in this case. + */ /* compute kernel and apply in vertical direction */ if (y_sigma > 0) { float kernel_y[size_y]; float sum = gaussian_kernel_init(y_sigma, kernel_y);
GP_ConvolutionParams params = { - .src = src, + .src = tmp, .x_src = x_src, .y_src = y_src, .w_src = w_src,
http://repo.or.cz/w/gfxprim.git/commit/92b4a111042c16733e2c23b1ed41e7a56ac52...
commit 92b4a111042c16733e2c23b1ed41e7a56ac52023 Author: Cyril Hrubis metan@ucw.cz Date: Fri Sep 27 20:24:55 2013 +0200
filters: Convolution; Minor cleanup.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/libs/filters/GP_Blur.c b/libs/filters/GP_Blur.c index bd66c9c..2069484 100644 --- a/libs/filters/GP_Blur.c +++ b/libs/filters/GP_Blur.c @@ -74,14 +74,14 @@ int GP_FilterGaussianBlur_Raw(const GP_Context *src, GP_Size w_src, GP_Size h_src, GP_Context *dst, GP_Coord x_dst, GP_Coord y_dst, - float sigma_x, float sigma_y, + float x_sigma, float y_sigma, GP_ProgressCallback *callback) { - unsigned int size_x = gaussian_kernel_size(sigma_x); - unsigned int size_y = gaussian_kernel_size(sigma_y); + unsigned int size_x = gaussian_kernel_size(x_sigma); + unsigned int size_y = gaussian_kernel_size(y_sigma);
- GP_DEBUG(1, "Gaussian blur sigma_x=%2.3f sigma_y=%2.3f kernel %ix%i image %ux%u", - sigma_x, sigma_y, size_x, size_y, w_src, h_src); + GP_DEBUG(1, "Gaussian blur x_sigma=%2.3f y_sigma=%2.3f kernel %ix%i image %ux%u", + x_sigma, y_sigma, size_x, size_y, w_src, h_src);
GP_ProgressCallback *new_callback = NULL;
@@ -94,9 +94,9 @@ int GP_FilterGaussianBlur_Raw(const GP_Context *src, new_callback = &gaussian_callback;
/* compute kernel and apply in horizontal direction */ - if (sigma_x > 0) { + if (x_sigma > 0) { float kernel_x[size_x]; - float sum = gaussian_kernel_init(sigma_x, kernel_x); + float sum = gaussian_kernel_init(x_sigma, kernel_x);
GP_ConvolutionParams params = { .src = src, @@ -122,9 +122,9 @@ int GP_FilterGaussianBlur_Raw(const GP_Context *src, new_callback->callback = gaussian_callback_vert;
/* compute kernel and apply in vertical direction */ - if (sigma_y > 0) { + if (y_sigma > 0) { float kernel_y[size_y]; - float sum = gaussian_kernel_init(sigma_y, kernel_y); + float sum = gaussian_kernel_init(y_sigma, kernel_y);
GP_ConvolutionParams params = { .src = src, @@ -155,7 +155,7 @@ int GP_FilterGaussianBlurEx(const GP_Context *src, GP_Size w_src, GP_Size h_src, GP_Context *dst, GP_Coord x_dst, GP_Coord y_dst, - float sigma_x, float sigma_y, + float x_sigma, float y_sigma, GP_ProgressCallback *callback) { GP_CHECK(src->pixel_type == dst->pixel_type); @@ -166,13 +166,13 @@ int GP_FilterGaussianBlurEx(const GP_Context *src,
return GP_FilterGaussianBlur_Raw(src, x_src, y_src, w_src, h_src, dst, x_dst, y_dst, - sigma_x, sigma_y, callback); + x_sigma, y_sigma, callback); }
GP_Context *GP_FilterGaussianBlurExAlloc(const GP_Context *src, GP_Coord x_src, GP_Coord y_src, GP_Size w_src, GP_Size h_src, - float sigma_x, float sigma_y, + float x_sigma, float y_sigma, GP_ProgressCallback *callback) { GP_Context *dst = GP_ContextAlloc(w_src, h_src, src->pixel_type); @@ -181,7 +181,7 @@ GP_Context *GP_FilterGaussianBlurExAlloc(const GP_Context *src, return NULL;
if (GP_FilterGaussianBlur_Raw(src, x_src, y_src, w_src, h_src, dst, - 0, 0, sigma_x, sigma_y, callback)) { + 0, 0, x_sigma, y_sigma, callback)) { GP_ContextFree(dst); return NULL; } diff --git a/libs/filters/GP_LinearConvolution.gen.c.t b/libs/filters/GP_LinearConvolution.gen.c.t index 2a7337c..70fe090 100644 --- a/libs/filters/GP_LinearConvolution.gen.c.t +++ b/libs/filters/GP_LinearConvolution.gen.c.t @@ -54,10 +54,6 @@ static int h_lin_conv_{{ pt.name }}(const GP_Context *src, int ikernel[kw], ikern_div; uint32_t size = w_src + kw - 1;
- GP_DEBUG(1, "Horizontal linear convolution kernel width %u " - "offset %ix%i rectangle %ux%u", - kw, x_src, y_src, w_src, h_src); - for (i = 0; i < kw; i++) ikernel[i] = kernel[i] * MUL + 0.5;
@@ -163,6 +159,10 @@ int GP_FilterHLinearConvolution_Raw(const GP_Context *src, float kernel[], uint32_t kw, float kern_div, GP_ProgressCallback *callback) { + GP_DEBUG(1, "Horizontal linear convolution kernel width %u " + "offset %ix%i rectangle %ux%u", + kw, x_src, y_src, w_src, h_src); + switch (src->pixel_type) { %% for pt in pixeltypes %% if not pt.is_unknown() and not pt.is_palette()
http://repo.or.cz/w/gfxprim.git/commit/2212fd623e8e09bf468d3b72e4468a604511a...
commit 2212fd623e8e09bf468d3b72e4468a604511a9c9 Author: Cyril Hrubis metan@ucw.cz Date: Fri Sep 27 20:04:19 2013 +0200
filters: Linear: Run one thread on in-place filter
If filter is run in-place (src == dst) the filter cannot run in more than one thread (as threads would override values read by other threads).
This patch changes the Linear Convolution filters to default to one thread if in-place usage is detected instead of the ASSERTS()
Also update linear convolution docs.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/doc/filters.txt b/doc/filters.txt index c69ccdd..ef6b123 100644 --- a/doc/filters.txt +++ b/doc/filters.txt @@ -714,6 +714,11 @@ and array of kernel values. The last function prints convolution kernel in human-readable format into the stdout.
+WARNING: If filter is executed in-place the work cannot be distributed between + threads (as some of the threads will overwrite values read by other + threads). In this case convolution filters runs in one thread + regardless of if threads are eanbled or not. + [source,c] ------------------------------------------------------------------------------- #include <GP.h> diff --git a/libs/filters/GP_LinearThreads.c b/libs/filters/GP_LinearThreads.c index 218110b..da55ce9 100644 --- a/libs/filters/GP_LinearThreads.c +++ b/libs/filters/GP_LinearThreads.c @@ -65,8 +65,10 @@ int GP_FilterHConvolutionMP_Raw(const GP_ConvolutionParams *params) if (t == 1) return GP_FilterHConvolution_Raw(params);
- GP_ASSERT(params->src != params->dst, - "Multithreaded convolution can't work in-place"); + if (params->src == params->dst) { + GP_DEBUG(1, "In-place filter detected, running in one thread."); + return GP_FilterHConvolution_Raw(params); + }
GP_PROGRESS_CALLBACK_MP(callback_mp, params->callback);
@@ -113,8 +115,10 @@ int GP_FilterVConvolutionMP_Raw(const GP_ConvolutionParams *params) if (t == 1) return GP_FilterVConvolution_Raw(params);
- GP_ASSERT(params->src != params->dst, - "Multithreaded convolution can't work in-place"); + if (params->src == params->dst) { + GP_DEBUG(1, "In-place filter detected, running in one thread."); + return GP_FilterVConvolution_Raw(params); + }
GP_PROGRESS_CALLBACK_MP(callback_mp, params->callback);
@@ -160,8 +164,10 @@ int GP_FilterConvolutionMP_Raw(const GP_ConvolutionParams *params) if (t == 1) return GP_FilterConvolution_Raw(params);
- GP_ASSERT(params->src != params->dst, - "Multithreaded convolution can't work in-place"); + if (params->src == params->dst) { + GP_DEBUG(1, "In-place filter detected, running in one thread."); + return GP_FilterConvolution_Raw(params); + }
GP_PROGRESS_CALLBACK_MP(callback_mp, params->callback);
http://repo.or.cz/w/gfxprim.git/commit/8114cdf5bd54ace1d44cbe94e8b980d924fd4...
commit 8114cdf5bd54ace1d44cbe94e8b980d924fd4d20 Author: Cyril Hrubis metan@ucw.cz Date: Fri Sep 27 18:36:26 2013 +0200
demos: py_simple: Drop None callback parameters.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/demos/py_simple/blur.py b/demos/py_simple/blur.py index 3735346..70e9da5 100755 --- a/demos/py_simple/blur.py +++ b/demos/py_simple/blur.py @@ -15,9 +15,9 @@ def main(): # Load Image img = loaders.Load(sys.argv[2]) # Do in-place gaussian blur - filters.GaussianBlur(img, img, radii, radii, None) + filters.GaussianBlur(img, img, radii, radii) # Save result - loaders.SaveJPG(img, "out.jpg", None) + img.loaders.SaveJPG("out.jpg")
if __name__ == '__main__': main() diff --git a/demos/py_simple/dither.py b/demos/py_simple/dither.py index 0437931..d2b9e04 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 = img.filters.FloydSteinbergAlloc(core.C.PIXEL_G1, None) + res = img.filters.FloydSteinbergAlloc(core.C.PIXEL_G1) # Save result into grayscale png res.loaders.SavePNG("out.png")
diff --git a/demos/py_simple/pygtk_example.py b/demos/py_simple/pygtk_example.py index e7b1643..0c220b3 100755 --- a/demos/py_simple/pygtk_example.py +++ b/demos/py_simple/pygtk_example.py @@ -30,7 +30,7 @@ class HelloWorld: self.window.show() self.image.show()
- img = loaders.LoadImage(sys.argv[2], None) + img = loaders.LoadImage(sys.argv[2]) self.pixmap = gtk.gdk.Pixmap(None, img.w, img.h, 24) self.gc = gtk.gdk.Drawable.new_gc(self.pixmap)
diff --git a/demos/py_simple/resize.py b/demos/py_simple/resize.py index b9e65c1..38a5b78 100755 --- a/demos/py_simple/resize.py +++ b/demos/py_simple/resize.py @@ -16,7 +16,7 @@ def main(): # Load Image src = loaders.Load(sys.argv[1]) # Resize image to the half of the original - res = src.filters.ResizeAlloc(src.w//2, src.h//2, 2, None) + res = src.filters.ResizeAlloc(src.w//2, src.h//2, 2) # Save Image res.loaders.Save(sys.argv[2])
diff --git a/demos/py_simple/rotate90.py b/demos/py_simple/rotate90.py index 2dcb3f5..3a49af1 100755 --- a/demos/py_simple/rotate90.py +++ b/demos/py_simple/rotate90.py @@ -16,7 +16,7 @@ def main(): # Load Image src = loaders.Load(sys.argv[1]) # Rotate by 90 degrees - res = src.filters.Rotate90Alloc(None) + res = src.filters.Rotate90Alloc() # Save Image res.loaders.Save(sys.argv[2])
http://repo.or.cz/w/gfxprim.git/commit/73403e601211315ce51c3e41ddfec233cb841...
commit 73403e601211315ce51c3e41ddfec233cb8415ee Author: Cyril Hrubis metan@ucw.cz Date: Fri Sep 27 18:26:14 2013 +0200
pywrap: Add default typemap for callback=NULL
Now all callback args have default NULL value.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/pylib/gfxprim/common.i b/pylib/gfxprim/common.i index e9242d7..47ae8f0 100644 --- a/pylib/gfxprim/common.i +++ b/pylib/gfxprim/common.i @@ -12,6 +12,13 @@ %nodefaultctor;
/* + * All progress callbacks have default NULL value + */ +%typemap(default) GP_ProgressCallback *callback { + $1 = NULL; +} + +/* * Error handling declarations */
http://repo.or.cz/w/gfxprim.git/commit/069c44a2fb6118fbcfabcf0cf5bac8f1f93c7...
commit 069c44a2fb6118fbcfabcf0cf5bac8f1f93c7108 Author: Cyril Hrubis metan@ucw.cz Date: Fri Sep 27 18:25:15 2013 +0200
build: pywrap: Add deps on common.i into pywrap.mk
Now all wrappers are rebuild when common.i is changed.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/pylib/gfxprim/core/Makefile b/pylib/gfxprim/core/Makefile index 476d623..d478c16 100644 --- a/pylib/gfxprim/core/Makefile +++ b/pylib/gfxprim/core/Makefile @@ -4,8 +4,6 @@ LIBNAME=core include $(TOPDIR)/pre.mk include $(TOPDIR)/pywrap.mk
-$(SWIG_C): ../common.i - INSTALL_FILES+=C.py
include $(TOPDIR)/post.mk diff --git a/pylib/gfxprim/loaders/Makefile b/pylib/gfxprim/loaders/Makefile index 600d233..5daaf56 100644 --- a/pylib/gfxprim/loaders/Makefile +++ b/pylib/gfxprim/loaders/Makefile @@ -7,7 +7,4 @@ include $(TOPDIR)/pre.mk LDLIBS+=$(LDLIBS_LOADERS)
include $(TOPDIR)/pywrap.mk - -$(SWIG_C): ../common.i - include $(TOPDIR)/post.mk diff --git a/pywrap.mk b/pywrap.mk index 0df0f10..15b78c4 100644 --- a/pywrap.mk +++ b/pywrap.mk @@ -30,6 +30,9 @@ else # VERBOSE @$(SWIG) $(SWIGOPTS) -python $(INCLUDES) $< endif # VERBOSE
+# All swig sources depend on common.i +$(SWIG_C): ../common.i + $(SWIG_LIB): $(SWIG_C) ifdef VERBOSE $(CC) $< $(CFLAGS) -D_GNU_SOURCE=1 $(LDFLAGS) $(PYTHON_INCLUDE) --shared $(LDLIBS) $(LDLIBS_GP) -L$(TOPDIR)/build/ -o $@
-----------------------------------------------------------------------
Summary of changes: demos/py_simple/blur.py | 4 +- demos/py_simple/dither.py | 2 +- demos/py_simple/pygtk_example.py | 2 +- demos/py_simple/resize.py | 2 +- demos/py_simple/rotate90.py | 2 +- doc/Makefile | 7 ++- ...example_py_backends.txt => example_py_blur.txt} | 8 ++-- doc/filters.txt | 5 ++ doc/filters_python.txt | 29 ++++++++++- doc/images/blur/Makefile | 7 +++ doc/images/blur/images.txt | 17 ++++++ doc/images/blur/lenna_0_4.png | Bin 0 -> 236705 bytes doc/images/blur/lenna_10_10.png | Bin 0 -> 143058 bytes doc/images/blur/lenna_2_2.png | Bin 0 -> 229699 bytes doc/images/blur/lenna_4_0.png | Bin 0 -> 231739 bytes doc/images/blur/lenna_small_0_4.png | Bin 0 -> 25526 bytes doc/images/blur/lenna_small_10_10.png | Bin 0 -> 17520 bytes doc/images/blur/lenna_small_2_2.png | Bin 0 -> 26436 bytes doc/images/blur/lenna_small_4_0.png | Bin 0 -> 25437 bytes doc/images/blur/regen.py | 53 ++++++++++++++++++++ doc/images/{dither => orig}/lenna.png | Bin 394244 -> 394244 bytes doc/images/orig/lenna_small.png | Bin 0 -> 32066 bytes libs/filters/GP_Blur.c | 39 +++++++++------ libs/filters/GP_LinearConvolution.gen.c.t | 8 ++-- libs/filters/GP_LinearThreads.c | 18 +++++-- pylib/gfxprim/common.i | 7 +++ pylib/gfxprim/core/Makefile | 2 - pylib/gfxprim/loaders/Makefile | 3 - pywrap.mk | 3 + 29 files changed, 174 insertions(+), 44 deletions(-) copy doc/{example_py_backends.txt => example_py_blur.txt} (51%) create mode 100644 doc/images/blur/Makefile create mode 100644 doc/images/blur/images.txt create mode 100644 doc/images/blur/lenna_0_4.png create mode 100644 doc/images/blur/lenna_10_10.png create mode 100644 doc/images/blur/lenna_2_2.png create mode 100644 doc/images/blur/lenna_4_0.png create mode 100644 doc/images/blur/lenna_small_0_4.png create mode 100644 doc/images/blur/lenna_small_10_10.png create mode 100644 doc/images/blur/lenna_small_2_2.png create mode 100644 doc/images/blur/lenna_small_4_0.png create mode 100755 doc/images/blur/regen.py copy doc/images/{dither => orig}/lenna.png (100%) create mode 100644 doc/images/orig/lenna_small.png
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.