1 /*****************************************************************************
2 * This file is part of gfxprim library. *
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. *
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. *
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 *
19 * Copyright (C) 2009-2013 Cyril Hrubis <metan@ucw.cz> *
21 *****************************************************************************/
25 Applies per-channel tables on a context pixels. Used for fast point filters
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
];
44 * Generic point filter, applies corresponding table on bitmap.
46 int GP_FilterTablesApply(const GP_Context
*const src
,
47 GP_Coord x_src
, GP_Coord y_src
,
48 GP_Size w_src
, GP_Size h_src
,
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_Context
*ctx
);
60 * Allocates and initializes table structure and tables.
62 GP_FilterTables
*GP_FilterTablesAlloc(const GP_Context
*ctx
);
65 * Frees point filter tables.
67 void GP_FilterTablesFree(GP_FilterTables
*self
);
69 #endif /* FILTERS_GP_APPLY_TABLES_H */