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 e9b780c9bbc1f2717fec705a0b2b5dff22d7845b (commit) via 4bd28f1260ee4a4e42fd57cac23a64de3892076e (commit) from 88eea356e8494dea8645470506f2087b104d4326 (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/e9b780c9bbc1f2717fec705a0b2b5dff22d78...
commit e9b780c9bbc1f2717fec705a0b2b5dff22d7845b Author: Cyril Hrubis metan@ucw.cz Date: Wed Nov 13 22:48:33 2013 +0100
pywrap: core: Remove/ignore a few functions.
This removes/makes swig ignore a few functions that are not usable from python and generate warnings.
* Remove GP_Common.h, there is noting that can be used pyton there.
* Ignore GP_DebugPrint(), again not usable.
* Ignore Callback operations.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/pylib/gfxprim/core/core.i b/pylib/gfxprim/core/core.i index 74dbb04..8f578d2 100644 --- a/pylib/gfxprim/core/core.i +++ b/pylib/gfxprim/core/core.i @@ -9,7 +9,6 @@ * Basic types and common methods */
-%include "GP_Common.h" %include "GP_Core.h" %include "GP_Types.h" %include "GP_Transform.h" @@ -24,6 +23,7 @@ %immutable GP_DebugMsg::fn; %immutable GP_DebugMsg::line; %immutable GP_DebugMsg::msg; +%ignore GP_DebugPrint;
%include "GP_Debug.h"
@@ -62,6 +62,8 @@ static int GP_ProgressCallbackProxy(GP_ProgressCallback *self) } %}
+%ignore GP_ProgressCallbackReport; +%ignore GP_ProgressCallbackDone; %include "GP_ProgressCallback.h"
/*
http://repo.or.cz/w/gfxprim.git/commit/4bd28f1260ee4a4e42fd57cac23a64de38920...
commit 4bd28f1260ee4a4e42fd57cac23a64de3892076e Author: Cyril Hrubis metan@ucw.cz Date: Wed Nov 13 22:37:34 2013 +0100
filters: point: Remove the FilterArea.
It was wrong idea to begin with.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/include/filters/GP_ApplyTables.h b/include/filters/GP_ApplyTables.h index d2a6948..93d1eac 100644 --- a/include/filters/GP_ApplyTables.h +++ b/include/filters/GP_ApplyTables.h @@ -43,9 +43,13 @@ typedef struct GP_FilterTables { /* * Generic point filter, applies corresponding table on bitmap. */ -int GP_FilterTablesApply(const GP_FilterArea *const area, - const GP_FilterTables *const tables, - GP_ProgressCallback *callback); +int GP_FilterTablesApply(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, + const GP_FilterTables *const tables, + GP_ProgressCallback *callback);
/* * Aloocates and initializes tables. diff --git a/include/filters/GP_Filter.h b/include/filters/GP_Filter.h index 69254a0..690a64b 100644 --- a/include/filters/GP_Filter.h +++ b/include/filters/GP_Filter.h @@ -34,29 +34,4 @@
#include "GP_FilterParam.h"
-/* - * Describes filter source, destination and coordinates. - * - * For Alloc filter variants dst, dst_x and dst_y is ignored. - */ -typedef struct GP_FilterArea { - const GP_Context *src; - GP_Coord src_x, src_y; - GP_Size src_w, src_h; - - GP_Context *dst; - GP_Coord dst_x, dst_y; - - void *priv; -} GP_FilterArea; - -#define GP_FILTER_AREA_DEFAULT(srcc, dstc) - GP_FilterArea area = { - .src = srcc, - .src_x = 0, .src_y = 0, - .src_w = srcc->w, .src_h = srcc->h, - .dst = dstc, - .dst_x = 0, .dst_y = 0, - }; - #endif /* FILTERS_GP_FILTER_H */ diff --git a/include/filters/GP_Point.h b/include/filters/GP_Point.h index 6ebf48c..3c8e6ac 100644 --- a/include/filters/GP_Point.h +++ b/include/filters/GP_Point.h @@ -36,27 +36,33 @@ * * Increments each pixel channel by a p * channel_max value. */ -int GP_FilterBrightnessEx(const GP_FilterArea *area, float p, +int GP_FilterBrightnessEx(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, + float p, GP_ProgressCallback *callback);
-GP_Context *GP_FilterBrightnessExAlloc(const GP_FilterArea *area, float p, +GP_Context *GP_FilterBrightnessExAlloc(const GP_Context *const src, + GP_Coord x_src, GP_Coord y_src, + GP_Size w_src, GP_Size h_src, + float p, GP_ProgressCallback *callback);
static inline int GP_FilterBrightness(const GP_Context *src, GP_Context *dst, float p, GP_ProgressCallback *callback) { - GP_FILTER_AREA_DEFAULT(src, dst); - - return GP_FilterBrightnessEx(&area, p, callback); + return GP_FilterBrightnessEx(src, 0, 0, src->w, src->h, + dst, 0, 0, p, callback); }
static inline GP_Context * GP_FilterBrightnessAlloc(const GP_Context *src, float p, GP_ProgressCallback *callback) { - GP_FILTER_AREA_DEFAULT(src, NULL); - - return GP_FilterBrightnessExAlloc(&area, p, callback); + return GP_FilterBrightnessExAlloc(src, 0, 0, src->w, src->h, + p, callback); }
/* @@ -67,46 +73,57 @@ GP_FilterBrightnessAlloc(const GP_Context *src, float p, * The parameters should have the same pixel channels as * source pixel type and are expected to be float numbers. */ -int GP_FilterContrastEx(const GP_FilterArea *area, float p, +int GP_FilterContrastEx(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, + float p, GP_ProgressCallback *callback);
-GP_Context *GP_FilterContrastExAlloc(const GP_FilterArea *area, float p, +GP_Context *GP_FilterContrastExAlloc(const GP_Context *const src, + GP_Coord x_src, GP_Coord y_src, + GP_Size w_src, GP_Size h_src, + float p, GP_ProgressCallback *callback);
static inline int GP_FilterContrast(const GP_Context *src, GP_Context *dst, float p, GP_ProgressCallback *callback) { - GP_FILTER_AREA_DEFAULT(src, dst); - - return GP_FilterContrastEx(&area, p, callback); + return GP_FilterContrastEx(src, 0, 0, src->w, src->h, + dst, 0, 0, p, callback); }
static inline GP_Context *GP_FilterContrastAlloc(const GP_Context *src, float p, GP_ProgressCallback *callback) { - GP_FILTER_AREA_DEFAULT(src, NULL); - - return GP_FilterContrastExAlloc(&area, p, callback); + return GP_FilterContrastExAlloc(src, 0, 0, src->w, src->h, + p, callback); }
/* * Brightness and Contrast combined. */ -int GP_FilterBrightnessContrastEx(const GP_FilterArea *area, float b, float c, +int GP_FilterBrightnessContrastEx(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, + float b, float c, GP_ProgressCallback *callback);
-GP_Context *GP_FilterBrightnessContrastExAlloc(const GP_FilterArea *area, +GP_Context *GP_FilterBrightnessContrastExAlloc(const GP_Context *const src, + GP_Coord x_src, GP_Coord y_src, + GP_Size w_src, GP_Size h_src, float b, float c, GP_ProgressCallback *callback); - static inline int GP_FilterBrightnessContrast(const GP_Context *src, GP_Context *dst, float b, float c, GP_ProgressCallback *callback) { - GP_FILTER_AREA_DEFAULT(src, dst); - - return GP_FilterBrightnessContrastEx(&area, b, c, callback); + return GP_FilterBrightnessContrastEx(src, 0, 0, src->w, src->h, + dst, 0, 0, b, c, callback); }
static inline GP_Context * @@ -114,9 +131,8 @@ GP_FilterBrightnessContrastAlloc(const GP_Context *src, float b, float c, GP_ProgressCallback *callback) { - GP_FILTER_AREA_DEFAULT(src, NULL); - - return GP_FilterBrightnessContrastExAlloc(&area, b, c, callback); + return GP_FilterBrightnessContrastExAlloc(src, 0, 0, src->w, src->h, + b, c, callback); }
/* @@ -124,10 +140,17 @@ GP_FilterBrightnessContrastAlloc(const GP_Context *src, * * Does quantization into steps regions. */ -int GP_FilterPosterizeEx(const GP_FilterArea *area, unsigned int steps, +int GP_FilterPosterizeEx(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, + unsigned int steps, GP_ProgressCallback *callback);
-GP_Context *GP_FilterPosterizeExAlloc(const GP_FilterArea *area, +GP_Context *GP_FilterPosterizeExAlloc(const GP_Context *const src, + GP_Coord x_src, GP_Coord y_src, + GP_Size w_src, GP_Size h_src, unsigned int steps, GP_ProgressCallback *callback);
@@ -135,43 +158,44 @@ static inline int GP_FilterPosterize(const GP_Context *src, GP_Context *dst, unsigned int steps, GP_ProgressCallback *callback) { - GP_FILTER_AREA_DEFAULT(src, dst); - - return GP_FilterPosterizeEx(&area, steps, callback); + return GP_FilterPosterizeEx(src, 0, 0, src->w, src->h, + dst, 0, 0, steps, callback); }
static inline GP_Context * GP_FilterPosterizeAlloc(const GP_Context *src, unsigned int steps, GP_ProgressCallback *callback) { - GP_FILTER_AREA_DEFAULT(src, NULL); - - return GP_FilterPosterizeExAlloc(&area, steps, callback); + return GP_FilterPosterizeExAlloc(src, 0, 0, src->w, src->h, + steps, callback); }
/* * Inverts the pixel value, i.e. sets it to max - val. */ -int GP_FilterInvertEx(const GP_FilterArea *area, +int GP_FilterInvertEx(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_Context *GP_FilterInvertExAlloc(const GP_FilterArea *area, +GP_Context *GP_FilterInvertExAlloc(const GP_Context *const src, + GP_Coord x_src, GP_Coord y_src, + GP_Size w_src, GP_Size h_src, GP_ProgressCallback *callback);
static inline int GP_FilterInvert(const GP_Context *src, GP_Context *dst, GP_ProgressCallback *callback) { - GP_FILTER_AREA_DEFAULT(src, dst); - - return GP_FilterInvertEx(&area, callback); + return GP_FilterInvertEx(src, 0, 0, src->w, src->h, + dst, 0, 0, callback); }
static inline GP_Context *GP_FilterInvertAlloc(const GP_Context *src, GP_ProgressCallback *callback) { - GP_FILTER_AREA_DEFAULT(src, NULL); - - return GP_FilterInvertExAlloc(&area, callback); + return GP_FilterInvertExAlloc(src, 0, 0, src->w, src->h, callback); }
#endif /* FILTERS_GP_POINT_H */ diff --git a/libs/filters/GP_ApplyTables.gen.c.t b/libs/filters/GP_ApplyTables.gen.c.t index 566d957..f166af3 100644 --- a/libs/filters/GP_ApplyTables.gen.c.t +++ b/libs/filters/GP_ApplyTables.gen.c.t @@ -38,26 +38,28 @@ Generic Point filer
%% for pt in pixeltypes %% if not pt.is_unknown() and not pt.is_palette() -static int apply_tables_{{ pt.name }}(const GP_FilterArea *const area, +static int apply_tables_{{ 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, const GP_FilterTables *const tables, GP_ProgressCallback *callback) { - GP_DEBUG(1, "Point filter %ux%u", area->src_w, area->src_h); + GP_DEBUG(1, "Point filter %ux%u", w_src, h_src);
unsigned int x, y; - const GP_Context *src = area->src; - GP_Context *dst = area->dst;
%% for c in pt.chanslist GP_Pixel {{ c.name }}; %% endfor
- for (y = 0; y < area->src_h; y++) { - for (x = 0; x < area->src_w; x++) { - unsigned int src_x = area->src_x + x; - unsigned int src_y = area->src_y + y; - unsigned int dst_x = area->dst_x + x; - unsigned int dst_y = area->dst_y + 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);
@@ -70,7 +72,7 @@ static int apply_tables_{{ pt.name }}(const GP_FilterArea *const area, GP_PutPixel_Raw_{{ pt.pixelsize.suffix }}(dst, dst_x, dst_y, pix); }
- if (GP_ProgressCallbackReport(callback, y, area->src_h, area->src_w)) { + if (GP_ProgressCallbackReport(callback, y, h_src, w_src)) { errno = ECANCELED; return 1; } @@ -84,18 +86,25 @@ static int apply_tables_{{ pt.name }}(const GP_FilterArea *const area, %% endif %% endfor
-int GP_FilterTablesApply(const GP_FilterArea *const area, +int GP_FilterTablesApply(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, const GP_FilterTables *const tables, GP_ProgressCallback *callback) { - GP_ASSERT(area->src->pixel_type == area->dst->pixel_type); + GP_ASSERT(src->pixel_type == dst->pixel_type); //TODO: Assert size
- switch (area->src->pixel_type) { + switch (src->pixel_type) { %% for pt in pixeltypes %% if not pt.is_unknown() and not pt.is_palette() case GP_PIXEL_{{ pt.name }}: - return apply_tables_{{ pt.name }}(area, tables, callback); + return apply_tables_{{ pt.name }}(src, x_src, y_src, + w_src, h_src, dst, + x_dst, y_dst, + tables, callback); break; %% endif %% endfor diff --git a/pylib/templates/filter.point.c.t b/pylib/templates/filter.point.c.t index bdd0679..155870e 100644 --- a/pylib/templates/filter.point.c.t +++ b/pylib/templates/filter.point.c.t @@ -10,8 +10,13 @@ %% endmacro
%% macro filter_point_ex(op_name, filter_op, fopts) -int GP_Filter{{ op_name }}Ex(const GP_FilterArea *const area{{ maybe_opts_l(fopts) }}, - GP_ProgressCallback *callback) +int GP_Filter{{ op_name }}Ex(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, + {{ maybe_opts_r(fopts) }} + GP_ProgressCallback *callback) { const GP_PixelTypeDescription *desc; GP_FilterTables tables; @@ -19,10 +24,10 @@ int GP_Filter{{ op_name }}Ex(const GP_FilterArea *const area{{ maybe_opts_l(fopt GP_Pixel j; int ret, err;
- if (GP_FilterTablesInit(&tables, area->src)) + if (GP_FilterTablesInit(&tables, src)) return 1;
- desc = GP_PixelTypeDesc(area->src->pixel_type); + desc = GP_PixelTypeDesc(src->pixel_type);
for (i = 0; i < desc->numchannels; i++) { GP_Pixel chan_max = (1 << desc->channels[i].size); @@ -32,7 +37,8 @@ int GP_Filter{{ op_name }}Ex(const GP_FilterArea *const area{{ maybe_opts_l(fopt table[j] = {{ filter_op('((signed)j)', '((signed)chan_max - 1)') }}; }
- ret = GP_FilterTablesApply(area, &tables, callback); + ret = GP_FilterTablesApply(src, x_src, y_src, w_src, h_src, + dst, x_dst, y_dst, &tables, callback);
err = errno; GP_FilterTablesFree(&tables); @@ -43,19 +49,17 @@ int GP_Filter{{ op_name }}Ex(const GP_FilterArea *const area{{ maybe_opts_l(fopt %% endmacro
%% macro filter_point_ex_alloc(op_name, fopts, opts) -GP_Context *GP_Filter{{ op_name }}ExAlloc(const GP_FilterArea *const area{{ maybe_opts_l(fopts) }}, - GP_ProgressCallback *callback) +GP_Context *GP_Filter{{ op_name }}ExAlloc(const GP_Context *const src, + GP_Coord x_src, GP_Coord y_src, + GP_Size w_src, GP_Size h_src, + {{ maybe_opts_r(fopts) }} + GP_ProgressCallback *callback) { - GP_FilterArea carea = *area; - GP_Context *new = GP_ContextAlloc(area->src_w, area->src_h, - area->src->pixel_type); + GP_Context *new = GP_ContextAlloc(w_src, h_src, + src->pixel_type);
- /* Clear these just to be sure */ - carea.dst_x = 0; - carea.dst_y = 0; - carea.dst = new; - - if (GP_Filter{{ op_name }}Ex(&carea, {{ maybe_opts_r(opts) }}callback)) { + if (GP_Filter{{ op_name }}Ex(src, x_src, y_src, w_src, h_src, new, 0, 0, + {{ maybe_opts_r(opts) }}callback)) { int err = errno; GP_ContextFree(new); errno = err;
-----------------------------------------------------------------------
Summary of changes: include/filters/GP_ApplyTables.h | 10 ++- include/filters/GP_Filter.h | 25 -------- include/filters/GP_Point.h | 106 +++++++++++++++++++++------------- libs/filters/GP_ApplyTables.gen.c.t | 39 ++++++++----- pylib/gfxprim/core/core.i | 4 +- pylib/templates/filter.point.c.t | 36 +++++++----- 6 files changed, 119 insertions(+), 101 deletions(-)
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.