1 @ def filter_point_ex(op_name, filter_op, fopts):
2 int GP_Filter{{ op_name }}Ex(const GP_Pixmap *const src,
3 GP_Coord x_src, GP_Coord y_src,
4 GP_Size w_src, GP_Size h_src,
6 GP_Coord x_dst, GP_Coord y_dst,
7 {{ maybe_opts_r(fopts) }}
8 GP_ProgressCallback *callback)
10 const GP_PixelTypeDescription *desc;
11 GP_FilterTables tables;
16 if (GP_FilterTablesInit(&tables, src))
19 desc = GP_PixelTypeDesc(src->pixel_type);
21 for (i = 0; i < desc->numchannels; i++) {
22 GP_Pixel chan_max = (1 << desc->channels[i].size);
23 GP_Pixel *table = tables.table[i];
25 for (j = 0; j < chan_max; j++)
26 table[j] = {@ filter_op('((signed)j)', '((signed)chan_max - 1)') @};
29 ret = GP_FilterTablesApply(src, x_src, y_src, w_src, h_src,
30 dst, x_dst, y_dst, &tables, callback);
33 GP_FilterTablesFree(&tables);
39 @ def filter_point_ex_alloc(op_name, fopts, opts):
40 GP_Pixmap *GP_Filter{{ op_name }}ExAlloc(const GP_Pixmap *const src,
41 GP_Coord x_src, GP_Coord y_src,
42 GP_Size w_src, GP_Size h_src,
43 {{ maybe_opts_r(fopts) }}
44 GP_ProgressCallback *callback)
46 GP_Pixmap *new = GP_PixmapAlloc(w_src, h_src,
49 if (GP_Filter{{ op_name }}Ex(src, x_src, y_src, w_src, h_src, new, 0, 0,
50 {{ maybe_opts_r(opts) }}callback)) {
60 @ def filter_point(op_name, filter_op, fopts="", opts=""):
63 #include "core/GP_Debug.h"
65 #include "filters/GP_ApplyTables.h"
66 #include "filters/GP_Point.h"
68 {@ filter_point_ex(op_name, filter_op, fopts) @}
69 {@ filter_point_ex_alloc(op_name, fopts, opts) @}