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-2026 Cyril Hrubis <metan@ucw.cz>
4 */
5
21#ifndef FILTERS_GP_DITHER_H
22#define FILTERS_GP_DITHER_H
23
24#include <filters/gp_filter.h>
25
128
152gp_dither_type gp_dither_type_by_name(const char *dither_name);
153
161const char *gp_dither_type_name(gp_dither_type dither_type);
162
169 const gp_pixmap *src, gp_pixmap *dst,
170 gp_progress_cb *callback);
171
178 const gp_pixmap *src,
179 gp_pixel_type pixel_type,
180 gp_progress_cb *callback);
181
188 gp_pixmap *dst,
189 gp_progress_cb *callback);
190
197 gp_pixel_type pixel_type,
198 gp_progress_cb *callback)
199{
200 return gp_filter_dither_alloc(GP_DITHER_FLOYD_STEINBERG, src, pixel_type, callback);
201}
202
209 gp_pixmap *dst,
210 gp_progress_cb *callback);
211
218 gp_pixel_type pixel_type,
219 gp_progress_cb *callback)
220{
221 return gp_filter_dither_alloc(GP_DITHER_ATKINSON, src, pixel_type, callback);
222}
223
230 gp_pixmap *dst,
231 gp_progress_cb *callback);
232
239 gp_pixel_type pixel_type,
240 gp_progress_cb *callback)
241{
242 return gp_filter_dither_alloc(GP_DITHER_SIERRA, src, pixel_type, callback);
243}
244
251 gp_pixmap *dst,
252 gp_progress_cb *callback);
253
260 gp_pixel_type pixel_type,
261 gp_progress_cb *callback)
262{
263 return gp_filter_dither_alloc(GP_DITHER_SIERRA_LITE, src, pixel_type, callback);
264}
265
272 gp_pixmap *dst,
273 gp_progress_cb *callback);
274
281 gp_pixel_type pixel_type,
282 gp_progress_cb *callback)
283{
284 return gp_filter_dither_alloc(GP_DITHER_HILBERT_PEANO, src, pixel_type, callback);
285}
286
293 gp_pixmap *dst,
294 gp_progress_cb *callback);
295
302 gp_pixel_type pixel_type,
303 gp_progress_cb *callback)
304{
305 return gp_filter_dither_alloc(GP_DITHER_BAYER_4, src, pixel_type, callback);
306}
307
314 gp_pixmap *dst,
315 gp_progress_cb *callback);
316
323 gp_pixel_type pixel_type,
324 gp_progress_cb *callback)
325{
326 return gp_filter_dither_alloc(GP_DITHER_SHARPENED_BAYER_4, src, pixel_type, callback);
327}
328
335 gp_pixmap *dst,
336 gp_progress_cb *callback);
337
344 gp_pixel_type pixel_type,
345 gp_progress_cb *callback)
346{
347 return gp_filter_dither_alloc(GP_DITHER_BAYER_8, src, pixel_type, callback);
348}
349
356 gp_pixmap *dst,
357 gp_progress_cb *callback);
358
365 gp_pixel_type pixel_type,
366 gp_progress_cb *callback)
367{
368 return gp_filter_dither_alloc(GP_DITHER_SHARPENED_BAYER_8, src, pixel_type, callback);
369}
370
371#endif /* FILTERS_GP_DITHER_H */
static gp_pixmap * gp_filter_bayer_8_alloc(const gp_pixmap *src, gp_pixel_type pixel_type, gp_progress_cb *callback)
Allocates dst and runs bayer_8 dithering from src->pixel_type to dst->pixel_type.
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_bayer_4(const gp_pixmap *src, gp_pixmap *dst, gp_progress_cb *callback)
Runs bayer_4 dithering from src::pixel_type to dst::pixel_type.
static gp_pixmap * gp_filter_sharpened_bayer_8_alloc(const gp_pixmap *src, gp_pixel_type pixel_type, gp_progress_cb *callback)
Allocates dst and runs sharpened_bayer_8 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.
static gp_pixmap * gp_filter_bayer_4_alloc(const gp_pixmap *src, gp_pixel_type pixel_type, gp_progress_cb *callback)
Allocates dst and runs bayer_4 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.
int gp_filter_sharpened_bayer_4(const gp_pixmap *src, gp_pixmap *dst, gp_progress_cb *callback)
Runs sharpened_bayer_4 dithering from src::pixel_type to dst::pixel_type.
int gp_filter_bayer_8(const gp_pixmap *src, gp_pixmap *dst, gp_progress_cb *callback)
Runs bayer_8 dithering from src::pixel_type to dst::pixel_type.
static gp_pixmap * gp_filter_sharpened_bayer_4_alloc(const gp_pixmap *src, gp_pixel_type pixel_type, gp_progress_cb *callback)
Allocates dst and runs sharpened_bayer_4 dithering from src->pixel_type to dst->pixel_type.
gp_dither_type
Dithering types.
@ GP_DITHER_SHARPENED_BAYER_4
Ordered dithering with 4x4 bayer matrix.
@ GP_DITHER_BAYER_8
Ordered dithering with 8x8 bayer matrix.
@ GP_DITHER_HILBERT_PEANO
A hilbert-peano dithering.
@ GP_DITHER_SHARPENED_BAYER_8
Ordered dithering with 8x8 bayer matrix.
@ 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_BAYER_4
Ordered dithering with 4x4 bayer matrix.
@ 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_sharpened_bayer_8(const gp_pixmap *src, gp_pixmap *dst, gp_progress_cb *callback)
Runs sharpened_bayer_8 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.