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 c1a5214d616c7d155bd00f602c1b4f861b5ca7ef (commit) via 708072e9f8c3f55a169bef35c0c1bc5a4d2520df (commit) via bda544702c4243add82e9c381dc52fdf357f7311 (commit) via b9e27424029664cad37e8a09200c33a7db7f5b7b (commit) from 5152d5c9e93aeedb1b114de10e6e11392bc17bbc (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/c1a5214d616c7d155bd00f602c1b4f861b5ca...
commit c1a5214d616c7d155bd00f602c1b4f861b5ca7ef Author: Cyril Hrubis metan@ucw.cz Date: Mon Dec 9 01:07:36 2013 +0100
filters: Initial MultiTone and Sepia filters.
Not finished yet.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/build/syms/Filters_symbols.txt b/build/syms/Filters_symbols.txt index 9b5b73b..d048bdc 100644 --- a/build/syms/Filters_symbols.txt +++ b/build/syms/Filters_symbols.txt @@ -143,6 +143,12 @@ GP_FilterVLinearConvolution_Raw GP_FilterWeightedMedianEx GP_FilterWeightedMedianExAlloc
+GP_FilterMultiToneEx +GP_FilterMultiToneExAlloc + +GP_FilterSepiaEx +GP_FilterSepiaExAlloc + GP_InterpolationTypeName
GP_NormInt diff --git a/include/filters/GP_Filters.h b/include/filters/GP_Filters.h index 0a6b4d9..3fe7afb 100644 --- a/include/filters/GP_Filters.h +++ b/include/filters/GP_Filters.h @@ -83,4 +83,8 @@ /* Gaussian noise filter */ #include "filters/GP_GaussianNoise.h"
+/* Multi tone point filters */ +#include "filters/GP_MultiTone.h" +#include "filters/GP_Sepia.h" + #endif /* FILTERS_GP_FILTERS_H */ diff --git a/include/filters/GP_MultiTone.h b/include/filters/GP_MultiTone.h new file mode 100644 index 0000000..9a33d46 --- /dev/null +++ b/include/filters/GP_MultiTone.h @@ -0,0 +1,63 @@ +/***************************************************************************** + * 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-2013 Cyril Hrubis metan@ucw.cz * + * * + *****************************************************************************/ + +#ifndef FILTERS_GP_MULTI_TONE_H +#define FILTERS_GP_MULTI_TONE_H + +#include "GP_Filter.h" + +int GP_FilterMultiToneEx(const GP_Context *const src, + GP_Coord x_src, GP_Coord y_src, + GP_Size w_src, GP_Size h_src, + GP_Context *dst, + GP_Coord x_dst, GP_Coord y_dst, + GP_Pixel pixels[], GP_Size pixels_size, + GP_ProgressCallback *callback); + +static inline int GP_FilterMultiTone(const GP_Context *const src, + GP_Context *dst, + GP_Pixel pixels[], GP_Size pixels_size, + GP_ProgressCallback *callback) +{ + return GP_FilterMultiToneEx(src, 0, 0, src->w, src->h, dst, 0, 0, + pixels, pixels_size, callback); +} + +GP_Context *GP_FilterMultiToneExAlloc(const GP_Context *const src, + GP_Coord x_src, GP_Coord y_src, + GP_Size w_src, GP_Size h_src, + GP_PixelType dst_pixel_type, + GP_Pixel pixels[], GP_Size pixels_size, + GP_ProgressCallback *callback); + +static inline GP_Context *GP_FilterMultiToneAlloc(const GP_Context *const src, + GP_PixelType dst_pixel_type, + GP_Pixel pixels[], + GP_Size pixels_size, + GP_ProgressCallback *callback) +{ + return GP_FilterMultiToneExAlloc(src, 0, 0, src->w, src->h, + dst_pixel_type, + pixels, pixels_size, callback); +} + +#endif /* FILTERS_GP_MULTI_TONE_H */ diff --git a/include/filters/GP_Filters.h b/include/filters/GP_Sepia.h similarity index 50% copy from include/filters/GP_Filters.h copy to include/filters/GP_Sepia.h index 0a6b4d9..2d41dd9 100644 --- a/include/filters/GP_Filters.h +++ b/include/filters/GP_Sepia.h @@ -16,71 +16,42 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301 USA * * * - * Copyright (C) 2009-2010 Jiri "BlueBear" Dluhos * - * jiri.bluebear.dluhos@gmail.com * - * * - * Copyright (C) 2009-2011 Cyril Hrubis metan@ucw.cz * + * Copyright (C) 2009-2013 Cyril Hrubis metan@ucw.cz * * * *****************************************************************************/
-/* - - GP_Context filters. - - */ - -#ifndef FILTERS_GP_FILTERS_H -#define FILTERS_GP_FILTERS_H - -/* Filter per channel parameter passing interface */ -#include "filters/GP_FilterParam.h" - -/* Point filters, brightness, contrast ... */ -#include "filters/GP_Point.h" - -/* Addition, difference, min, max ... */ -#include "filters/GP_Arithmetic.h" - -/* Histograms, ... */ -#include "filters/GP_Stats.h" - -/* Image rotations (90 180 270 grads) and mirroring */ -#include "filters/GP_Rotate.h" - -/* Linear convolution Raw API */ -#include "filters/GP_Linear.h" - -/* Convolution filters */ -#include "filters/GP_Convolution.h" - -/* Blur filters */ -#include "filters/GP_Blur.h" - -/* Edge detection filters */ -#include "filters/GP_EdgeDetection.h" - -/* Image scaling (resampling) */ -#include "filters/GP_Resize.h" -#include "filters/GP_ResizeNN.h" -#include "filters/GP_ResizeLinear.h" -#include "filters/GP_ResizeCubic.h" - -/* Bitmap dithering */ -#include "filters/GP_Dither.h" - -/* Laplace based filters */ -#include "filters/GP_Laplace.h" - -/* Median filter */ -#include "filters/GP_Median.h" - -/* Weighted Median filter */ -#include "filters/GP_WeightedMedian.h" - -/* Sigma Mean filter */ -#include "filters/GP_Sigma.h" - -/* Gaussian noise filter */ -#include "filters/GP_GaussianNoise.h" - -#endif /* FILTERS_GP_FILTERS_H */ +#ifndef FILTERS_GP_SEPIA_H +#define FILTERS_GP_SEPIA_H + +#include "GP_Filter.h" + +int GP_FilterSepiaEx(const GP_Context *const src, + GP_Coord x_src, GP_Coord y_src, + GP_Size w_src, GP_Size h_src, + GP_Context *dst, + GP_Coord x_dst, GP_Coord y_dst, + GP_ProgressCallback *callback); + +static inline int GP_FilterSepia(const GP_Context *const src, + GP_Context *dst, + GP_ProgressCallback *callback) +{ + return GP_FilterSepiaEx(src, 0, 0, src->w, src->h, + dst, 0, 0, callback); +} + +GP_Context *GP_FilterSepiaExAlloc(const GP_Context *const src, + GP_Coord x_src, GP_Coord y_src, + GP_Size w_src, GP_Size h_src, + GP_PixelType dst_pixel_type, + GP_ProgressCallback *callback); + +static inline GP_Context *GP_FilterSepiaAlloc(const GP_Context *const src, + GP_PixelType dst_pixel_type, + GP_ProgressCallback *callback) +{ + return GP_FilterSepiaExAlloc(src, 0, 0, src->w, src->h, + dst_pixel_type, callback); +} + +#endif /* FILTERS_GP_SEPIA_H */ diff --git a/libs/filters/GP_MultiTone.gen.c.t b/libs/filters/GP_MultiTone.gen.c.t new file mode 100644 index 0000000..4329a3f --- /dev/null +++ b/libs/filters/GP_MultiTone.gen.c.t @@ -0,0 +1,201 @@ +/***************************************************************************** + * 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-2013 Cyril Hrubis metan@ucw.cz * + * * + *****************************************************************************/ + +%% extends "filter.c.t" + +%% block descr +Generic Point filer +%% endblock + +%% block body + +#include <errno.h> + +#include "core/GP_Context.h" +#include "core/GP_GetPutPixel.h" +#include "core/GP_TempAlloc.h" +#include "core/GP_MixPixels.h" +#include "core/GP_Debug.h" + +#include "filters/GP_MultiTone.h" + +%% for pt in pixeltypes +%% if not pt.is_unknown() and not pt.is_palette() +static void init_table_{{ pt.name }}(GP_Pixel table[], + GP_Size table_size, + GP_Pixel pixels[], + GP_Size pixels_size) +{ + unsigned int i; + unsigned int p = 0; + float perc; + float step = 1.00 * table_size / (pixels_size - 1); + + GP_DEBUG(2, "Preparing pixel table %u steps %u pixels, step %.2f", + table_size, pixels_size, step); + + for (i = 0; i < table_size; i++) { + p = 1.00 * i / step; + perc = i+1; + + while (perc > step) + perc -= step; + + perc = perc / step; + + table[i] = GP_MIX_PIXELS_{{ pt.name }}(pixels[p+1], pixels[p], 255 * perc); +// printf("p = %u i = %u PERC %.2fn", p, i, perc); +// GP_PixelPrint(table[i], GP_PIXEL_{{ pt.name }}); + } +} +%% endif +%% endfor + +static void init_table(GP_PixelType type, + GP_Pixel table[], GP_Size table_size, + GP_Pixel pixels[], GP_Size pixels_size) +{ + switch (type) { +%% for pt in pixeltypes +%% if not pt.is_unknown() and not pt.is_palette() + case GP_PIXEL_{{ pt.name }}: + init_table_{{ pt.name }}(table, table_size, + pixels, pixels_size); + break; +%% endif +%% endfor + default: + GP_BUG("Should not be reached"); + break; + } +} + +#include <assert.h> + +%% for pt in pixeltypes +%% if pt.is_gray() +static int multitone_{{ pt.name }}(const GP_Context *const src, + GP_Coord x_src, GP_Coord y_src, + GP_Size w_src, GP_Size h_src, + GP_Context *dst, + GP_Coord x_dst, GP_Coord y_dst, + GP_Pixel pixels[], GP_Size pixels_size, + GP_ProgressCallback *callback) +{ +%% set size = pt.chanslist[0].max + 1 + GP_TempAllocCreate(tmp, {{ size }} * sizeof(GP_Pixel)); + GP_Pixel *table = GP_TempAllocGet(tmp, {{ size }} * sizeof(GP_Pixel)); + + GP_DEBUG(1, "Duotone filter %ux%u {{ pt.name }} -> %s", + w_src, h_src, GP_PixelTypeName(dst->pixel_type)); + + init_table(dst->pixel_type, table, {{ size }}, pixels, pixels_size); + + unsigned int x, y; + + for (y = 0; y < h_src; y++) { + for (x = 0; x < w_src; x++) { + unsigned int src_x = x_src + x; + unsigned int src_y = y_src + y; + unsigned int dst_x = x_dst + x; + unsigned int dst_y = y_dst + y; + + GP_Pixel pix = GP_GetPixel_Raw_{{ pt.pixelsize.suffix }}(src, src_x, src_y); + + pix = table[pix]; + + GP_PutPixel_Raw(dst, dst_x, dst_y, pix); + } + + if (GP_ProgressCallbackReport(callback, y, h_src, w_src)) { + GP_TempAllocFree(tmp); + errno = ECANCELED; + return 1; + } + } + + GP_TempAllocFree(tmp); + GP_ProgressCallbackDone(callback); + + return 0; +} + +%% endif +%% endfor + +int GP_FilterMultiToneEx(const GP_Context *const src, + GP_Coord x_src, GP_Coord y_src, + GP_Size w_src, GP_Size h_src, + GP_Context *dst, + GP_Coord x_dst, GP_Coord y_dst, + GP_Pixel pixels[], GP_Size pixels_size, + GP_ProgressCallback *callback) +{ + //CHECK DST IS NOT PALETTE PixelHasFlags + + switch (src->pixel_type) { +%% for pt in pixeltypes +%% if pt.is_gray() + case GP_PIXEL_{{ pt.name }}: + return multitone_{{ pt.name }}(src, x_src, y_src, + w_src, h_src, dst, + x_dst, y_dst, + pixels, pixels_size, + callback); + break; +%% endif +%% endfor + default: + errno = EINVAL; + return -1; + } +} + +GP_Context *GP_FilterMultiToneExAlloc(const GP_Context *const src, + GP_Coord x_src, GP_Coord y_src, + GP_Size w_src, GP_Size h_src, + GP_PixelType dst_pixel_type, + GP_Pixel pixels[], GP_Size pixels_size, + GP_ProgressCallback *callback) +{ + GP_Context *res; + int err; + + res = GP_ContextAlloc(w_src, h_src, dst_pixel_type); + + if (!res) { + GP_DEBUG(1, "Malloc failed :("); + return NULL; + } + + if (GP_FilterMultiToneEx(src, x_src, y_src, w_src, h_src, res, 0, 0, + pixels, pixels_size, callback)) { + err = errno; + GP_ContextFree(res); + errno = err; + return NULL; + } + + return res; +} + +%% endblock body diff --git a/include/filters/GP_Filters.h b/libs/filters/GP_Sepia.c similarity index 50% copy from include/filters/GP_Filters.h copy to libs/filters/GP_Sepia.c index 0a6b4d9..bfc2379 100644 --- a/include/filters/GP_Filters.h +++ b/libs/filters/GP_Sepia.c @@ -16,71 +16,51 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301 USA * * * - * Copyright (C) 2009-2010 Jiri "BlueBear" Dluhos * - * jiri.bluebear.dluhos@gmail.com * - * * - * Copyright (C) 2009-2011 Cyril Hrubis metan@ucw.cz * + * Copyright (C) 2009-2013 Cyril Hrubis metan@ucw.cz * * * *****************************************************************************/
-/* - - GP_Context filters. - - */ - -#ifndef FILTERS_GP_FILTERS_H -#define FILTERS_GP_FILTERS_H - -/* Filter per channel parameter passing interface */ -#include "filters/GP_FilterParam.h" - -/* Point filters, brightness, contrast ... */ -#include "filters/GP_Point.h" - -/* Addition, difference, min, max ... */ -#include "filters/GP_Arithmetic.h" - -/* Histograms, ... */ -#include "filters/GP_Stats.h" - -/* Image rotations (90 180 270 grads) and mirroring */ -#include "filters/GP_Rotate.h" - -/* Linear convolution Raw API */ -#include "filters/GP_Linear.h" - -/* Convolution filters */ -#include "filters/GP_Convolution.h" - -/* Blur filters */ -#include "filters/GP_Blur.h" - -/* Edge detection filters */ -#include "filters/GP_EdgeDetection.h" - -/* Image scaling (resampling) */ -#include "filters/GP_Resize.h" -#include "filters/GP_ResizeNN.h" -#include "filters/GP_ResizeLinear.h" -#include "filters/GP_ResizeCubic.h" - -/* Bitmap dithering */ -#include "filters/GP_Dither.h" - -/* Laplace based filters */ -#include "filters/GP_Laplace.h" - -/* Median filter */ -#include "filters/GP_Median.h" - -/* Weighted Median filter */ -#include "filters/GP_WeightedMedian.h" - -/* Sigma Mean filter */ -#include "filters/GP_Sigma.h" - -/* Gaussian noise filter */ -#include "filters/GP_GaussianNoise.h" - -#endif /* FILTERS_GP_FILTERS_H */ +#include "core/GP_Convert.h" +#include "core/GP_Debug.h" + +#include "filters/GP_MultiTone.h" + +#define PIX 3 + +static void init_sepia_tones(GP_Pixel pixels[PIX], GP_PixelType pixel_type) +{ +// pixels[0] = GP_RGBToPixel(56, 33, 10, pixel_type); +// pixels[1] = GP_RGBToPixel(255, 255, 255, pixel_type); + pixels[0] = GP_RGBToPixel(0, 0, 0, pixel_type); + pixels[1] = GP_RGBToPixel(162, 116, 70, pixel_type); + pixels[2] = GP_RGBToPixel(230, 230, 230, pixel_type); +} + +int GP_FilterSepiaEx(const GP_Context *const src, + GP_Coord x_src, GP_Coord y_src, + GP_Size w_src, GP_Size h_src, + GP_Context *dst, + GP_Coord x_dst, GP_Coord y_dst, + GP_ProgressCallback *callback) +{ + GP_Pixel pixels[PIX]; + + init_sepia_tones(pixels, dst->pixel_type); + + return GP_FilterMultiToneEx(src, x_src, y_src, w_src, h_src, + dst, x_dst, y_dst, pixels, PIX, callback); +} + +GP_Context *GP_FilterSepiaExAlloc(const GP_Context *const src, + GP_Coord x_src, GP_Coord y_src, + GP_Size w_src, GP_Size h_src, + GP_PixelType dst_pixel_type, + GP_ProgressCallback *callback) +{ + GP_Pixel pixels[PIX]; + + init_sepia_tones(pixels, dst_pixel_type); + + return GP_FilterMultiToneExAlloc(src, x_src, y_src, w_src, h_src, + dst_pixel_type, pixels, PIX, callback); +} diff --git a/libs/filters/Makefile b/libs/filters/Makefile index d1a909c..9c5f30f 100644 --- a/libs/filters/Makefile +++ b/libs/filters/Makefile @@ -5,7 +5,8 @@ STATS_FILTERS=GP_Histogram.gen.c
POINT_FILTERS=GP_GaussianNoise.gen.c GP_ApplyTables.gen.c GP_Invert.gen.c GP_Brightness.gen.c GP_Contrast.gen.c- GP_BrightnessContrast.gen.c GP_Posterize.gen.c + GP_BrightnessContrast.gen.c GP_Posterize.gen.c+ GP_MultiTone.gen.c
ARITHMETIC_FILTERS=GP_Difference.gen.c GP_Addition.gen.c GP_Min.gen.c GP_Max.gen.c GP_Multiply.gen.c diff --git a/pylib/gfxprim/filters/__init__.py b/pylib/gfxprim/filters/__init__.py index 9fd278c..fe82d01 100644 --- a/pylib/gfxprim/filters/__init__.py +++ b/pylib/gfxprim/filters/__init__.py @@ -41,7 +41,8 @@ def _init(module): 'Median', 'MedianAlloc', 'MedianEx', 'MedianExAlloc', 'Sigma', 'SigmaAlloc', 'SigmaEx', 'SigmaExAlloc', 'FloydSteinberg', 'FloydSteinbergAlloc', - 'HilbertPeano', 'HilbertPeanoAlloc']: + 'HilbertPeano', 'HilbertPeanoAlloc', + 'Sepia', 'SepiaAlloc', 'SepiaEx', 'SepiaExAlloc']: extend_submodule(FiltersSubmodule, name, c_filters.__getattribute__('GP_Filter' + name))
def array_to_kern(kernel, kernel_div): diff --git a/pylib/gfxprim/filters/filters.i b/pylib/gfxprim/filters/filters.i index b0f7f1a..a504f76 100644 --- a/pylib/gfxprim/filters/filters.i +++ b/pylib/gfxprim/filters/filters.i @@ -138,11 +138,16 @@ FILTER_FUNC(WeightedMedian); %include "GP_WeightedMedian.h"
/* Sigma filter */ -FILTER_FUNC(GP_FilterSigmaEx); -FILTER_FUNC(GP_FilterSigma); +FILTER_FUNC(FilterSigmaEx); +FILTER_FUNC(FilterSigma); %include "GP_Sigma.h"
/* Gaussian Noise */ FILTER_FUNC(GaussianNoiseAddEx); FILTER_FUNC(GaussianNoiseAdd); %include "GP_GaussianNoise.h" + +/* Sepia */ +FILTER_FUNC(Sepia); +FILTER_FUNC(SepiaEx); +%include "GP_Sepia.h"
http://repo.or.cz/w/gfxprim.git/commit/708072e9f8c3f55a169bef35c0c1bc5a4d252...
commit 708072e9f8c3f55a169bef35c0c1bc5a4d2520df Author: Cyril Hrubis metan@ucw.cz Date: Mon Dec 9 01:07:07 2013 +0100
doc: Fix typos in GP_TempAlloc() documentation.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/doc/core_common.txt b/doc/core_common.txt index c7148fa..1f747b0 100644 --- a/doc/core_common.txt +++ b/doc/core_common.txt @@ -130,7 +130,7 @@ int foo(...) ...
if (error) { - GP_TempAllocFree(self); + GP_TempAllocFree(tmp); return -1; }
@@ -138,7 +138,7 @@ int foo(...)
/* end of the code that uses the buffers */
- GP_TempAllocFree(self); + GP_TempAllocFree(tmp);
return 0; }
http://repo.or.cz/w/gfxprim.git/commit/bda544702c4243add82e9c381dc52fdf357f7...
commit bda544702c4243add82e9c381dc52fdf357f7311 Author: Cyril Hrubis metan@ucw.cz Date: Sun Dec 8 23:46:27 2013 +0100
pywrap: Progress callback proxy check for Py_None.
If a wrapped function is called with callback parameter set to None, i.e.
callback = None loaders.Load("image_path/image", callback);
The progress callback fails because Py_None is not executable.
Fix this by checking for Py_None and skipping the callback if passed.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/pylib/gfxprim/common.i b/pylib/gfxprim/common.i index 0be27fe..7432e9e 100644 --- a/pylib/gfxprim/common.i +++ b/pylib/gfxprim/common.i @@ -70,27 +70,29 @@ int gp_proxy_callback(GP_ProgressCallback *self) %typemap(in) GP_ProgressCallback *callback (GP_ProgressCallback callback_proxy, struct gp_proxy_params proxy_params) { - if (PyTuple_Check($input) && PyTuple_GET_SIZE($input) > 0) { - if (!PyCallable_Check(PyTuple_GetItem($input, 0))) { - PyErr_SetString(PyExc_TypeError, - "first arg in tuple must be callable"); - return NULL; + if ($input != Py_None) { + if (PyTuple_Check($input) && PyTuple_GET_SIZE($input) > 0) { + if (!PyCallable_Check(PyTuple_GetItem($input, 0))) { + PyErr_SetString(PyExc_TypeError, + "first arg in tuple must be callable"); + return NULL; + } + proxy_params.callback = PyTuple_GetItem($input, 0); + proxy_params.args = $input; + + } else { + if (!PyCallable_Check($input)) { + PyErr_SetString(PyExc_TypeError, + "parameter must be callable"); + return NULL; + } + + proxy_params.callback = $input; + proxy_params.args = NULL; } - proxy_params.callback = PyTuple_GetItem($input, 0); - proxy_params.args = $input; - - } else { - if (!PyCallable_Check($input)) { - PyErr_SetString(PyExc_TypeError, - "parameter must be callable"); - return NULL; - } - - proxy_params.callback = $input; - proxy_params.args = NULL; }
- if ($input) { + if ($input && $input != Py_None) { callback_proxy.callback = gp_proxy_callback; callback_proxy.priv = &proxy_params; $1 = &callback_proxy;
http://repo.or.cz/w/gfxprim.git/commit/b9e27424029664cad37e8a09200c33a7db7f5...
commit b9e27424029664cad37e8a09200c33a7db7f5b7b Author: Cyril Hrubis metan@ucw.cz Date: Sun Dec 8 23:28:56 2013 +0100
pywrap: Enable default NULL callback typemap.
It was disabled by mistake while callback proxy was reimplemented.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/pylib/gfxprim/common.i b/pylib/gfxprim/common.i index 462e937..0be27fe 100644 --- a/pylib/gfxprim/common.i +++ b/pylib/gfxprim/common.i @@ -101,10 +101,10 @@ int gp_proxy_callback(GP_ProgressCallback *self)
/* * All progress callbacks have default NULL value + */ %typemap(default) GP_ProgressCallback *callback { $1 = NULL; } - */
/* * Error handling declarations
-----------------------------------------------------------------------
Summary of changes: build/syms/Filters_symbols.txt | 6 + doc/core_common.txt | 4 +- include/filters/GP_Filters.h | 4 + .../filters/{GP_ApplyTables.h => GP_MultiTone.h} | 78 ++++---- include/filters/{GP_Laplace.h => GP_Sepia.h} | 60 +++--- libs/filters/GP_MultiTone.gen.c.t | 201 ++++++++++++++++++++ libs/{input/GP_TimeStamp.c => filters/GP_Sepia.c} | 85 +++------ libs/filters/Makefile | 3 +- pylib/gfxprim/common.i | 40 ++-- pylib/gfxprim/filters/__init__.py | 3 +- pylib/gfxprim/filters/filters.i | 9 +- 11 files changed, 339 insertions(+), 154 deletions(-) copy include/filters/{GP_ApplyTables.h => GP_MultiTone.h} (51%) copy include/filters/{GP_Laplace.h => GP_Sepia.h} (57%) create mode 100644 libs/filters/GP_MultiTone.gen.c.t copy libs/{input/GP_TimeStamp.c => filters/GP_Sepia.c} (54%)
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.