X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=render%2Fcolor.h;h=246af1988cf5069f0253b7357538e1668e43b65d;hb=35ed95fe18e9b8d7a79f79f4fd7466a2b46435e3;hp=202817d3054efcc7339c1fa90c90d3e0b83baf4c;hpb=de307661b6ce96e61e20a123b00297dbc57d5d85;p=chaz%2Fopenbox diff --git a/render/color.h b/render/color.h index 202817d3..246af198 100644 --- a/render/color.h +++ b/render/color.h @@ -1,59 +1,25 @@ #ifndef __color_h #define __color_h +#include "render.h" + #include #include +#include -#ifdef HAVE_STDINT_H -# include -#else -# ifdef HAVE_SYS_TYPES_H -# include -# endif -#endif - - -#ifdef HAVE_STDINT_H -typedef uint32_t pixel32; -typedef uint16_t pixel16; -#else -typedef u_int32_t pixel32; -typedef u_int16_t pixel16; -#endif /* HAVE_STDINT_H */ - -#if (G_ENDIAN == G_BIG_ENDIAN) -#define default_red_shift 0 -#define default_green_shift 8 -#define default_blue_shift 16 -#define endian MSBFirst -#else -#define default_red_shift 16 -#define default_green_shift 8 -#define default_blue_shift 0 -#define endian LSBFirst -#endif /* G_ENDIAN == G_BIG_ENDIAN */ +struct _RrColor { + const RrInstance *inst; - -typedef struct color_rgb { int r; int g; int b; unsigned long pixel; GC gc; -} color_rgb; - -void color_allocate_gc(color_rgb *in); -color_rgb *color_parse(char *colorname); -color_rgb *color_new(int r, int g, int b); -void color_free(color_rgb *in); -void reduce_depth(pixel32 *data, XImage *im); - -extern int render_red_offset; -extern int render_green_offset; -extern int render_blue_offset; +}; -extern int render_red_shift; -extern int render_green_shift; -extern int render_blue_shift; +void RrColorAllocateGC(RrColor *in); +XColor *RrPickColor(const RrInstance *inst, gint r, gint g, gint b); +void RrReduceDepth(const RrInstance *inst, RrPixel32 *data, XImage *im); +void RrIncreaseDepth(const RrInstance *inst, RrPixel32 *data, XImage *im); #endif /* __color_h */