GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
gp_apply_tables.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2/*
3 * Copyright (C) 2009-2013 Cyril Hrubis <metan@ucw.cz>
4 */
5
6/*
7
8 Applies per-channel tables on a pixmap pixels. Used for fast point filters
9 implementation.
10
11 */
12
13#ifndef FILTERS_GP_APPLY_TABLES_H
14#define FILTERS_GP_APPLY_TABLES_H
15
16#include <filters/gp_filter.h>
17
18/*
19 * Per-channel lookup tables.
20 */
21typedef struct gp_filter_tables {
23 int free_table:1;
24} gp_filter_tables;
25
26/*
27 * Generic point filter, applies corresponding table on bitmap.
28 */
29int gp_filter_tables_apply(const gp_pixmap *const src,
30 gp_coord x_src, gp_coord y_src,
31 gp_size w_src, gp_size h_src,
32 gp_pixmap *dst,
33 gp_coord x_dst, gp_coord y_dst,
34 const gp_filter_tables *const tables,
35 gp_progress_cb *callback);
36
37/*
38 * Aloocates and initializes tables.
39 */
40int gp_filter_tables_init(gp_filter_tables *self, const gp_pixmap *pixmap);
41
42/*
43 * Allocates and initializes table structure and tables.
44 */
45gp_filter_tables *gp_filter_tables_alloc(const gp_pixmap *pixmap);
46
47/*
48 * Frees point filter tables.
49 */
50void gp_filter_tables_free(gp_filter_tables *self);
51
52#endif /* FILTERS_GP_APPLY_TABLES_H */
uint32_t gp_pixel
Pixel integer value.
Definition gp_types.h:33
int gp_coord
Integer type for coordinates i.e. x, y, ...
Definition gp_types.h:19
unsigned int gp_size
Integer type for sizes i.e. w, h, ...
Definition gp_types.h:24
Common filter includes.
#define GP_PIXEL_CHANS_MAX
Maximal number of channels per all defined pixel types.
A pixmap buffer.
Definition gp_pixmap.h:33
Progress callback.