GFXprim
2D bitmap graphics library with emphasis on speed and correctness
|
Dithering algorithms. More...
#include <filters/gp_filter.h>
Go to the source code of this file.
Typedefs | |
typedef enum gp_dither_type | gp_dither_type |
Dithering types. | |
Enumerations | |
enum | gp_dither_type { GP_DITHER_FLOYD_STEINBERG , GP_DITHER_ATKINSON , GP_DITHER_SIERRA , GP_DITHER_SIERRA_LITE , GP_DITHER_HILBERT_PEANO , GP_DITHER_MAX } |
Dithering types. More... | |
Functions | |
gp_dither_type | gp_dither_type_by_name (const char *dither_name) |
Returns dithering type by name. | |
const char * | gp_dither_type_name (gp_dither_type dither_type) |
Returns dithering name for a given dithering 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. | |
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. | |
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. | |
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. | |
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_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_sierra (const gp_pixmap *src, gp_pixmap *dst, gp_progress_cb *callback) |
Runs sierra dithering from src::pixel_type to dst::pixel_type. | |
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_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_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. | |
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. | |
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. | |
Dithering algorithms.
Original Image | RGB332 | G8 | G4 | G2 | G1 |
---|---|---|---|---|---|
Original Image | RGB332 | G8 | G4 | G2 | G1 |
---|---|---|---|---|---|
Original Image | RGB332 | G8 | G4 | G2 | G1 |
---|---|---|---|---|---|
Original Image | RGB332 | G8 | G4 | G2 | G1 |
---|---|---|---|---|---|
Original Image | RGB332 | G8 | G4 | G2 | G1 |
---|---|---|---|---|---|
Original Image | RGB332 | G8 | G4 | G2 | G1 |
---|---|---|---|---|---|
Definition in file gp_dither.gen.h.
enum gp_dither_type |
Dithering types.
Definition at line 25 of file gp_dither.gen.h.
gp_dither_type gp_dither_type_by_name | ( | const char * | dither_name | ) |
Returns dithering type by name.
The lookup is not case sensitive and also works for two letter acronyms of the ditherings. The indended usage for two letter acronyms are shorter command line options, e.g. '-d at'.
Canonical name | Acronym |
---|---|
Floyd Steinberg | fs |
Atkinson | at |
Sierra | si |
Sierra Lite | sl |
Hilbert Peano | hp |
dither_name | A dithering name. |
const char * gp_dither_type_name | ( | gp_dither_type | dither_type | ) |
Returns dithering name for a given dithering type.
dither_type | A dithering type id. |
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.
|
inlinestatic |
Allocates dst and runs atkinson dithering from src->pixel_type to dst->pixel_type.
Definition at line 189 of file gp_dither.gen.h.
References GP_DITHER_ATKINSON, and gp_filter_dither_alloc().
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.
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.
Referenced by gp_filter_atkinson_alloc(), gp_filter_floyd_steinberg_alloc(), gp_filter_hilbert_peano_alloc(), gp_filter_sierra_alloc(), and gp_filter_sierra_lite_alloc().
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.
|
inlinestatic |
Allocates dst and runs floyd_steinberg dithering from src->pixel_type to dst->pixel_type.
Definition at line 168 of file gp_dither.gen.h.
References GP_DITHER_FLOYD_STEINBERG, and gp_filter_dither_alloc().
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.
|
inlinestatic |
Allocates dst and runs hilbert_peano dithering from src->pixel_type to dst->pixel_type.
Definition at line 252 of file gp_dither.gen.h.
References GP_DITHER_HILBERT_PEANO, and gp_filter_dither_alloc().
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.
|
inlinestatic |
Allocates dst and runs sierra dithering from src->pixel_type to dst->pixel_type.
Definition at line 210 of file gp_dither.gen.h.
References GP_DITHER_SIERRA, and gp_filter_dither_alloc().
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.
|
inlinestatic |
Allocates dst and runs sierra_lite dithering from src->pixel_type to dst->pixel_type.
Definition at line 231 of file gp_dither.gen.h.
References GP_DITHER_SIERRA_LITE, and gp_filter_dither_alloc().