GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
gp_dither.gen.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later
2/*
3 * Copyright (C) 2009-2023 Cyril Hrubis <metan@ucw.cz>
4 */
5
17#ifndef FILTERS_GP_DITHER_H
18#define FILTERS_GP_DITHER_H
19
20#include <filters/gp_filter.h>
21
104
124gp_dither_type gp_dither_type_by_name(const char *dither_name);
125
133const char *gp_dither_type_name(gp_dither_type dither_type);
134
141 const gp_pixmap *src, gp_pixmap *dst,
142 gp_progress_cb *callback);
143
150 const gp_pixmap *src,
151 gp_pixel_type pixel_type,
152 gp_progress_cb *callback);
153
160 gp_pixmap *dst,
161 gp_progress_cb *callback);
162
169 gp_pixel_type pixel_type,
170 gp_progress_cb *callback)
171{
172 return gp_filter_dither_alloc(GP_DITHER_FLOYD_STEINBERG, src, pixel_type, callback);
173}
174
181 gp_pixmap *dst,
182 gp_progress_cb *callback);
183
190 gp_pixel_type pixel_type,
191 gp_progress_cb *callback)
192{
193 return gp_filter_dither_alloc(GP_DITHER_ATKINSON, src, pixel_type, callback);
194}
195
202 gp_pixmap *dst,
203 gp_progress_cb *callback);
204
211 gp_pixel_type pixel_type,
212 gp_progress_cb *callback)
213{
214 return gp_filter_dither_alloc(GP_DITHER_SIERRA, src, pixel_type, callback);
215}
216
223 gp_pixmap *dst,
224 gp_progress_cb *callback);
225
232 gp_pixel_type pixel_type,
233 gp_progress_cb *callback)
234{
235 return gp_filter_dither_alloc(GP_DITHER_SIERRA_LITE, src, pixel_type, callback);
236}
237
244 gp_pixmap *dst,
245 gp_progress_cb *callback);
246
253 gp_pixel_type pixel_type,
254 gp_progress_cb *callback)
255{
256 return gp_filter_dither_alloc(GP_DITHER_HILBERT_PEANO, src, pixel_type, callback);
257}
258
259#endif /* FILTERS_GP_DITHER_H */
gp_pixmap * gp_filter_dither_alloc(gp_dither_type type, const gp_pixmap *src, gp_pixel_type pixel_type, gp_progress_cb *callback)
Allocates dst and runs dithering from src->pixel_type to pixel_type.
static gp_pixmap * gp_filter_sierra_lite_alloc(const gp_pixmap *src, gp_pixel_type pixel_type, gp_progress_cb *callback)
Allocates dst and runs sierra_lite dithering from src->pixel_type to dst->pixel_type.
static gp_pixmap * gp_filter_atkinson_alloc(const gp_pixmap *src, gp_pixel_type pixel_type, gp_progress_cb *callback)
Allocates dst and runs atkinson dithering from src->pixel_type to dst->pixel_type.
int gp_filter_hilbert_peano(const gp_pixmap *src, gp_pixmap *dst, gp_progress_cb *callback)
Runs hilbert_peano dithering from src::pixel_type to dst::pixel_type.
int gp_filter_atkinson(const gp_pixmap *src, gp_pixmap *dst, gp_progress_cb *callback)
Runs atkinson dithering from src::pixel_type to dst::pixel_type.
static gp_pixmap * gp_filter_floyd_steinberg_alloc(const gp_pixmap *src, gp_pixel_type pixel_type, gp_progress_cb *callback)
Allocates dst and runs floyd_steinberg dithering from src->pixel_type to dst->pixel_type.
gp_dither_type gp_dither_type_by_name(const char *dither_name)
Returns dithering type by name.
static gp_pixmap * gp_filter_hilbert_peano_alloc(const gp_pixmap *src, gp_pixel_type pixel_type, gp_progress_cb *callback)
Allocates dst and runs hilbert_peano dithering from src->pixel_type to dst->pixel_type.
int gp_filter_sierra_lite(const gp_pixmap *src, gp_pixmap *dst, gp_progress_cb *callback)
Runs sierra_lite dithering from src::pixel_type to dst::pixel_type.
int gp_filter_floyd_steinberg(const gp_pixmap *src, gp_pixmap *dst, gp_progress_cb *callback)
Runs floyd_steinberg dithering from src::pixel_type to dst::pixel_type.
gp_dither_type
Dithering types.
@ GP_DITHER_HILBERT_PEANO
A hilbert-peano dithering.
@ GP_DITHER_SIERRA_LITE
A sierra lite dithering.
@ GP_DITHER_FLOYD_STEINBERG
Classical Floyd-Steinberg.
@ GP_DITHER_ATKINSON
Modified Atkinson dithering.
@ GP_DITHER_MAX
Number of dithering types.
@ GP_DITHER_SIERRA
A sierra dithering.
static gp_pixmap * gp_filter_sierra_alloc(const gp_pixmap *src, gp_pixel_type pixel_type, gp_progress_cb *callback)
Allocates dst and runs sierra dithering from src->pixel_type to dst->pixel_type.
int gp_filter_dither(gp_dither_type type, const gp_pixmap *src, gp_pixmap *dst, gp_progress_cb *callback)
Runs dithering from src->pixel_type to dst->pixel_type.
const char * gp_dither_type_name(gp_dither_type dither_type)
Returns dithering name for a given dithering type.
int gp_filter_sierra(const gp_pixmap *src, gp_pixmap *dst, gp_progress_cb *callback)
Runs sierra dithering from src::pixel_type to dst::pixel_type.
Common filter includes.
gp_pixel_type
List of all pixel types.
A pixmap buffer.
Definition gp_pixmap.h:33
Progress callback.