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 b751bfc9b78d8dc25a503efce8582a8f6df10af7 (commit) via 1479708a43cb28eada03dbf962fe98a623cd68d6 (commit) from 76f73128753ed19cefe7e80e55520edccbb01b9a (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/b751bfc9b78d8dc25a503efce8582a8f6df10...
commit b751bfc9b78d8dc25a503efce8582a8f6df10af7 Author: Cyril Hrubis metan@ucw.cz Date: Sun May 11 14:06:56 2014 +0200
doc: Add resize filters to python docs.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/demos/py_simple/resize.py b/demos/py_simple/resize.py index 38a5b783..7d11e229 100755 --- a/demos/py_simple/resize.py +++ b/demos/py_simple/resize.py @@ -10,13 +10,10 @@ def main(): print("USAGE: %s imput_image output_image" % sys.argv[0]); sys.exit(1)
- # Turns on debug messages - core.SetDebugLevel(10); - # 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) + res = src.filters.ResizeLFIntAlloc(src.w//2, src.h//2) # Save Image res.loaders.Save(sys.argv[2])
diff --git a/doc/example_py_resize.txt b/doc/example_py_resize.txt new file mode 100644 index 00000000..06504964 --- /dev/null +++ b/doc/example_py_resize.txt @@ -0,0 +1,8 @@ +Resize +------ +A simple program that loads image, resizes it to half and saves result. + +[source,python] +------------------------------------------------------------------ +include::../demos/py_simple/resize.py[] +------------------------------------------------------------------ diff --git a/doc/filters_python.txt b/doc/filters_python.txt index c1dadb84..fc202fbb 100644 --- a/doc/filters_python.txt +++ b/doc/filters_python.txt @@ -8,9 +8,10 @@ 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.
-If filter has been aborted from callback 'OSError' with errno set to -'ECANCELED' is raised, see progress callback -link:core_python.html#Progress_Callback[documentation] for more information. +If filter is aborted from a callback 'OSError' with errno set to +'ECANCELED' is raised, see +link:core_python.html#Progress_Callback[progress callback] for more +information.
Point Filters ~~~~~~~~~~~~~ @@ -402,3 +403,29 @@ respectively y pixel neighbors from each side so the result is median of rectangle of +2 * x + 1+ x +2 * y + 1+ pixels.
include::images/median/images.txt[] + +Resize +~~~~~~ + +[source,python] +------------------------------------------------------------------------------- +import gfxprim.core as core +import gfxprim.filters as filters + + # Nearest neighbour resize, fastest but lowest quality + res = img.ResizeNNAlloc(100, 100, callback=None) + + # Fast and good quality with low pass on downscaling + res = img.ResizeLinearLFIntAlloc(100, 100, callback=None) + + # Cubic interpolation, needs low pass (blur) applied before downscaling + res = img.ResizeCubicIntAlloc(100, 100, callback=None) + + # All of the above, TYPE is numeric enum + res = img.ResizeAlloc(100, 100, TYPE, callback=None) + +------------------------------------------------------------------------------- + +Functions to resize (resample) image. + +TIP: See link:example_py_resize.html[resize example].
http://repo.or.cz/w/gfxprim.git/commit/1479708a43cb28eada03dbf962fe98a623cd6...
commit 1479708a43cb28eada03dbf962fe98a623cd68d6 Author: Cyril Hrubis metan@ucw.cz Date: Sun May 11 14:00:20 2014 +0200
pywrap: filters: Add ResizeCubicInt
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/pylib/gfxprim/filters/filters.i b/pylib/gfxprim/filters/filters.i index a504f76a..3aeba03b 100644 --- a/pylib/gfxprim/filters/filters.i +++ b/pylib/gfxprim/filters/filters.i @@ -92,6 +92,10 @@ FILTER_FUNC(ResizeLinearInt); FILTER_FUNC(ResizeLinearLFInt); %include "GP_ResizeLinear.h"
+FILTER_FUNC(ResizeCubic); +FILTER_FUNC(ResizeCubicInt); +%include "GP_ResizeCubic.h" + /* Ditherings */ FILTER_FUNC(FloydSteinberg); FILTER_FUNC(GP_FilterHilbertPeano);
-----------------------------------------------------------------------
Summary of changes: demos/py_simple/resize.py | 5 +-- ...mple_py_showimage.txt => example_py_resize.txt} | 8 ++-- doc/filters_python.txt | 33 ++++++++++++++++++-- pylib/gfxprim/filters/filters.i | 4 ++ 4 files changed, 39 insertions(+), 11 deletions(-) copy doc/{example_py_showimage.txt => example_py_resize.txt} (53%)
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.