Rename GP_Context -> GP_Pixmap
[gfxprim.git] / include / filters / GP_ApplyTables.h
blob7941b35b5a0cfe7cad20052eccc32d5f87f1a270
1 /*****************************************************************************
2 * This file is part of gfxprim library. *
3 * *
4 * Gfxprim is free software; you can redistribute it and/or *
5 * modify it under the terms of the GNU Lesser General Public *
6 * License as published by the Free Software Foundation; either *
7 * version 2.1 of the License, or (at your option) any later version. *
8 * *
9 * Gfxprim is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
12 * Lesser General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU Lesser General Public *
15 * License along with gfxprim; if not, write to the Free Software *
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
17 * Boston, MA 02110-1301 USA *
18 * *
19 * Copyright (C) 2009-2013 Cyril Hrubis <metan@ucw.cz> *
20 * *
21 *****************************************************************************/
25 Applies per-channel tables on a pixmap pixels. Used for fast point filters
26 implementation.
30 #ifndef FILTERS_GP_APPLY_TABLES_H
31 #define FILTERS_GP_APPLY_TABLES_H
33 #include "GP_Filter.h"
36 * Per-channel lookup tables.
38 typedef struct GP_FilterTables {
39 GP_Pixel *table[GP_PIXELTYPE_MAX_CHANNELS];
40 int free_table:1;
41 } GP_FilterTables;
44 * Generic point filter, applies corresponding table on bitmap.
46 int GP_FilterTablesApply(const GP_Pixmap *const src,
47 GP_Coord x_src, GP_Coord y_src,
48 GP_Size w_src, GP_Size h_src,
49 GP_Pixmap *dst,
50 GP_Coord x_dst, GP_Coord y_dst,
51 const GP_FilterTables *const tables,
52 GP_ProgressCallback *callback);
55 * Aloocates and initializes tables.
57 int GP_FilterTablesInit(GP_FilterTables *self, const GP_Pixmap *pixmap);
60 * Allocates and initializes table structure and tables.
62 GP_FilterTables *GP_FilterTablesAlloc(const GP_Pixmap *pixmap);
65 * Frees point filter tables.
67 void GP_FilterTablesFree(GP_FilterTables *self);
69 #endif /* FILTERS_GP_APPLY_TABLES_H */