summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2013-10-28 21:06:38 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2013-10-28 21:06:38 +0000
commit35df6a39826009e8dd7ec9d2724afcdca5789e10 (patch)
treed9cfd0515fa99bcf2c12ec14af6e5c40969d1f0f /include
parent23ec9ceb5bb32a5348f8491243d41a14564c71f5 (diff)
downloadlibnsfb-35df6a39826009e8dd7ec9d2724afcdca5789e10.tar.gz
libnsfb-35df6a39826009e8dd7ec9d2724afcdca5789e10.tar.bz2
Test if we're dithering already before turning it on. (No functional change atm, but when bitmap tiling is moved into nsfb, error diffusion will be able to cross tile boundaries.)
Diffstat (limited to 'include')
-rw-r--r--include/palette.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/palette.h b/include/palette.h
index a4b9f77..04bdd4f 100644
--- a/include/palette.h
+++ b/include/palette.h
@@ -28,7 +28,7 @@ struct nsfb_palette_s {
uint8_t last; /**< Last used palette index */
nsfb_colour_t data[256]; /**< Palette for index modes */
- bool dither; /**< Whether to use error diffusion */
+ bool dither; /**< Whether error diffusion was requested */
struct {
int width; /**< Length of error value buffer ring*/
int current; /**< Current pos in ring buffer*/
@@ -53,6 +53,11 @@ void nsfb_palette_dither_fini(struct nsfb_palette_s *palette);
/** Generate libnsfb 8bpp default palette. */
void nsfb_palette_generate_nsfb_8bpp(struct nsfb_palette_s *palette);
+static inline bool nsfb_palette_dithering_on(struct nsfb_palette_s *palette)
+{
+ return palette->dither;
+}
+
/** Find best palette match for given colour. */
static inline uint8_t nsfb_palette_best_match(struct nsfb_palette_s *palette,
nsfb_colour_t c, int *r_error, int *g_error, int *b_error)