]> icculus.org git repositories - mikachu/openbox.git/blob - otk/rendercontrol.hh
use a bitshift on the rgb values instead of a color table
[mikachu/openbox.git] / otk / rendercontrol.hh
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
2 #ifndef __rendercontrol_hh
3 #define __rendercontrol_hh
4
5 extern "C" {
6 #include <X11/Xlib.h>
7 #include <X11/Xutil.h>
8 }
9
10 namespace otk {
11
12 class ScreenInfo;
13 class Surface;
14 class RenderTexture;
15
16 class RenderControl {
17 protected:
18   const ScreenInfo *_screen;
19
20   /*
21   // color tables, meaning, 256 (possibly) different shades of each color,
22   // based on the number of bits there are available for each color in the
23   // visual
24   unsigned char _red_color_table[256];
25   unsigned char _green_color_table[256];
26   unsigned char _blue_color_table[256];
27   */
28
29 /*
30   Bool _dither;
31
32   int _cpc; // colors-per-channel: must be a value between [2,6]
33   int _bpp; // bits-per-pixel
34
35   unsigned int *_grad_xbuffer;
36   unsigned int *_grad_ybuffer;
37   unsigned int _grad_buffer_width;
38   unsigned int _grad_buffer_height;
39
40   unsigned long *_sqrt_table;
41
42   // These values are all determined based on a visual
43
44   int _red_bits;    // the number of bits (1-255) that each shade of color
45   int _green_bits;  // spans across. best case is 1, which gives 255 shades.
46   int _blue_bits;
47   unsigned char _red_color_table[256];
48   unsigned char _green_color_table[256];
49   unsigned char _blue_color_table[256];
50
51   // These are only used for TrueColor visuals
52   int _red_offset;  // the offset of each color in a color mask
53   int _green_offset;
54   int _blue_offset;
55
56   // These are only used for !TrueColor visuals
57   XColor *_colors;
58   int _ncolors;
59 */
60
61   RenderControl(const ScreenInfo *screen);
62
63 public:
64   virtual ~RenderControl();
65
66   static RenderControl *getRenderControl(int screen);
67
68   virtual void drawBackground(Surface *sf,
69                               const RenderTexture &texture) const = 0;
70 };
71
72 }
73
74 #endif // __rendercontrol_hh