GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
gp_gaussian_noise.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 Additive Gaussian noise filters.
9
10 The sigma and mu parameters define the noise parameters. The sigma defines
11 amount of randomness, the mu defines offset. Both are defined as a ratio of
12 the particular channel size.
13
14 */
15
16#ifndef FILTERS_GP_GAUSSIAN_NOISE_H
17#define FILTERS_GP_GAUSSIAN_NOISE_H
18
19#include <filters/gp_filter.h>
20
21int gp_filter_gaussian_noise_add_ex(const gp_pixmap *src,
22 gp_coord x_src, gp_coord y_src,
23 gp_size w_src, gp_size h_src,
24 gp_pixmap *dst,
25 gp_coord x_dst, gp_coord y_dst,
26 float sigma, float mu,
27 gp_progress_cb *callback);
28
29gp_pixmap *gp_filter_gaussian_noise_add_ex_alloc(const gp_pixmap *src,
30 gp_coord x_src, gp_coord y_src,
31 gp_size w_src, gp_size h_src,
32 float sigma, float mu,
33 gp_progress_cb *callback);
34
35static inline int gp_filter_gaussian_noise_add(const gp_pixmap *src,
36 gp_pixmap *dst,
37 float sigma, float mu,
38 gp_progress_cb *callback)
39{
40 return gp_filter_gaussian_noise_add_ex(src, 0, 0, src->w, src->h,
41 dst, 0, 0, sigma, mu, callback);
42}
43
44static inline gp_pixmap *
45gp_filter_gaussian_noise_add_alloc(const gp_pixmap *src,
46 float sigma, float mu,
47 gp_progress_cb *callback)
48{
49 return gp_filter_gaussian_noise_add_ex_alloc(src, 0, 0, src->w, src->h,
50 sigma, mu, callback);
51}
52
53#endif /* FILTERS_GP_GAUSSIAN_NOISE_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.