X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=render%2Fcolor.h;h=ba9fb22b4e7eb41b4fca4a42600d4e8cdd88d222;hb=bd59576748db274c1a5e6ffece5df51d7d700b23;hp=202817d3054efcc7339c1fa90c90d3e0b83baf4c;hpb=de307661b6ce96e61e20a123b00297dbc57d5d85;p=chaz%2Fopenbox diff --git a/render/color.h b/render/color.h index 202817d3..ba9fb22b 100644 --- a/render/color.h +++ b/render/color.h @@ -1,59 +1,39 @@ #ifndef __color_h #define __color_h +#include "render.h" + #include #include - -#ifdef HAVE_STDINT_H -# include +#include + +#if (G_BYTE_ORDER == G_BIG_ENDIAN) +#define default_red_offset 0 +#define default_green_offset 8 +#define default_blue_offset 16 +#define default_alpha_offset 24 +#define render_endian MSBFirst #else -# ifdef HAVE_SYS_TYPES_H -# include -# endif -#endif +#define default_alpha_offset 24 +#define default_red_offset 16 +#define default_green_offset 8 +#define default_blue_offset 0 +#define render_endian LSBFirst +#endif /* G_BYTE_ORDER == G_BIG_ENDIAN */ +struct _RrColor { + const RrInstance *inst; -#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 */ - - -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 color_allocate_gc(RrColor *in); +XColor *pickColor(const RrInstance *inst, gint r, gint g, gint b); +void reduce_depth(const RrInstance *inst, pixel32 *data, XImage *im); +void increase_depth(const RrInstance *inst, pixel32 *data, XImage *im); #endif /* __color_h */