diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2008-03-25 17:50:37 +0430 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2008-06-19 21:54:23 -0400 |
commit | e7c1fc5bf53b4adf16f2d0c7e613c848bede6824 (patch) | |
tree | 4fab14aefc4e004c5024871d5df8cea86b34447a /src/cairo-xlib-private.h | |
parent | c0176dc54cf16a3a9504977d80184e4608783052 (diff) | |
download | cairo-e7c1fc5bf53b4adf16f2d0c7e613c848bede6824.tar.gz |
[xlib] Implement dithering
Remove the intermediate rgb333 for PseudoColor and work on the
cube directly. Also upgrade to a 6x6x6 cube instead of 5x5x5.
Do dithering on both PseudoColor and TrueColor, using a 4x4 pattern.
This only affects X servers with no XRender.
Diffstat (limited to 'src/cairo-xlib-private.h')
-rw-r--r-- | src/cairo-xlib-private.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/cairo-xlib-private.h b/src/cairo-xlib-private.h index a88e6b532..b8ca027ee 100644 --- a/src/cairo-xlib-private.h +++ b/src/cairo-xlib-private.h @@ -73,10 +73,18 @@ struct _cairo_xlib_display { unsigned int closed :1; }; +/* size of color cube */ +#define CUBE_SIZE 6 +/* size of gray ramp */ +#define RAMP_SIZE 16 + typedef struct _cairo_xlib_visual_info { VisualID visualid; - XColor colors[256]; - unsigned long rgb333_to_pseudocolor[512]; + struct { uint8_t a, r, g, b; } colors[256]; + uint8_t cube_to_pseudocolor[CUBE_SIZE][CUBE_SIZE][CUBE_SIZE]; + uint8_t field8_to_cube[256]; + int8_t dither8_to_cube[256]; + uint8_t gray8_to_pseudocolor[256]; } cairo_xlib_visual_info_t; struct _cairo_xlib_screen_info { |