GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
gp_weighted_median.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2/*
3 * Copyright (C) 2009-2012 Cyril Hrubis <metan@ucw.cz>
4 */
5
6 /*
7
8
9 */
10
11#ifndef FILTERS_GP_WEIGHTED_MEDIAN_H
12#define FILTERS_GP_WEIGHTED_MEDIAN_H
13
14#include <filters/gp_filter.h>
15
16typedef struct gp_median_weights {
17 unsigned int w;
18 unsigned int h;
19 unsigned int *weights;
20} gp_median_weights;
21
22int gp_filter_weighted_median_ex(const gp_pixmap *src,
23 gp_coord x_src, gp_coord y_src,
24 gp_size w_src, gp_size h_src,
25 gp_pixmap *dst,
26 gp_coord x_dst, gp_coord y_dst,
27 gp_median_weights *weights,
28 gp_progress_cb *callback);
29
30gp_pixmap *gp_filter_weighted_median_ex_alloc(const gp_pixmap *src,
31 gp_coord x_src, gp_coord y_src,
32 gp_size w_src, gp_size h_src,
33 gp_median_weights *weights,
34 gp_progress_cb *callback);
35
36static inline int gp_filter_weighted_median(const gp_pixmap *src,
37 gp_pixmap *dst,
38 gp_median_weights *weights,
39 gp_progress_cb *callback)
40{
41 return gp_filter_weighted_median_ex(src, 0, 0, src->w, src->h,
42 dst, 0, 0, weights, callback);
43}
44
45static inline gp_pixmap *gp_filter_weighted_median_alloc(const gp_pixmap *src,
46 gp_median_weights *weights,
47 gp_progress_cb *callback)
48{
49 return gp_filter_weighted_median_ex_alloc(src, 0, 0, src->w, src->h,
50 weights, callback);
51}
52
53#endif /* FILTERS_GP_WEIGHTED_MEDIAN_H */
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.
A pixmap buffer.
Definition gp_pixmap.h:33
uint32_t h
Pixmap height in pixels.
Definition gp_pixmap.h:46
uint32_t w
Pixmap width in pixels.
Definition gp_pixmap.h:44
Progress callback.