]> Dogcows Code - chaz/openbox/blob - otk/truerendercontrol.hh
store the pixel32 data in the surface so it can be reused
[chaz/openbox] / otk / truerendercontrol.hh
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
2 #ifndef __truerendercontrol_hh
3 #define __truerendercontrol_hh
4
5 #include "rendercontrol.hh"
6
7 #include <vector>
8
9 namespace otk {
10
11 #ifdef WORDS_BIGENDIAN
12 const int default_red_shift=0;
13 const int default_green_shift=8;
14 const int default_blue_shift=16;
15 const int endian=MSBFirst;
16 #else
17 const int default_red_shift=16;
18 const int default_green_shift=8;
19 const int default_blue_shift=0;
20 const int endian=LSBFirst;
21 #endif /* WORDS_BIGENDIAN */
22
23 class TrueRenderControl : public RenderControl {
24 private:
25 // the number of bits to shift a color value (from 0-255) to the right, to
26 // fit it into the the color mask (do this before the offset)
27 int _red_shift;
28 int _green_shift;
29 int _blue_shift;
30
31 // the offset of each color in a color mask
32 int _red_offset;
33 int _green_offset;
34 int _blue_offset;
35
36 inline void highlight(pixel32 *x, pixel32 *y, bool raised) const;
37 void reduceDepth(Surface &sf, XImage *im) const;
38 void verticalGradient(Surface &sf, const RenderTexture &texture) const;
39 void diagonalGradient(Surface &sf, const RenderTexture &texture) const;
40 void crossDiagonalGradient(Surface &sf, const RenderTexture &texture) const;
41 virtual void drawGradientBackground(Surface &sf,
42 const RenderTexture &texture) const;
43
44 public:
45 TrueRenderControl(int screen);
46 virtual ~TrueRenderControl();
47
48 virtual void drawBackground(Surface& sf, const RenderTexture &texture) const;
49 };
50
51 }
52
53 #endif // __truerendercontrol_hh
This page took 0.036583 seconds and 5 git commands to generate.