00001
00002 #ifndef __truerendercontrol_hh
00003 #define __truerendercontrol_hh
00004
00005 #include "rendercontrol.hh"
00006
00007 extern "C" {
00008
00009 #ifdef HAVE_STDINT_H
00010 # include <stdint.h>
00011 #else
00012 # ifdef HAVE_SYS_TYPES_H
00013 # include <sys/types.h>
00014 # endif
00015 #endif
00016
00017 }
00018
00019 #include <vector>
00020
00021 namespace otk {
00022
00023 #ifdef HAVE_STDINT_H
00024 typedef uint32_t pixel32;
00025 typedef uint16_t pixel16;
00026 #else
00027 typedef u_int32_t pixel32;
00028 typedef u_int16_t pixel16;
00029 #endif
00030
00031 #ifdef WORDS_BIGENDIAN
00032 const int default_red_shift=0;
00033 const int default_green_shift=8;
00034 const int default_blue_shift=16;
00035 const int endian=MSBFirst;
00036 #else
00037 const int default_red_shift=16;
00038 const int default_green_shift=8;
00039 const int default_blue_shift=0;
00040 const int endian=LSBFirst;
00041 #endif
00042
00043 class TrueRenderControl : public RenderControl {
00044 private:
00045
00046
00047 int _red_shift;
00048 int _green_shift;
00049 int _blue_shift;
00050
00051
00052 int _red_offset;
00053 int _green_offset;
00054 int _blue_offset;
00055
00056 inline void highlight(pixel32 *x, pixel32 *y, bool raised) const;
00057 void reduceDepth(XImage *im, pixel32 *data) const;
00058 void verticalGradient(Surface &sf, const RenderTexture &texture,
00059 pixel32 *data) const;
00060 void diagonalGradient(Surface &sf, const RenderTexture &texture,
00061 pixel32 *data) const;
00062 void crossDiagonalGradient(Surface &sf, const RenderTexture &texture,
00063 pixel32 *data) const;
00064 virtual void drawGradientBackground(Surface &sf,
00065 const RenderTexture &texture) const;
00066
00067 public:
00068 TrueRenderControl(int screen);
00069 virtual ~TrueRenderControl();
00070
00071 virtual void drawBackground(Surface& sf, const RenderTexture &texture) const;
00072 };
00073
00074 }
00075
00076 #endif // __truerendercontrol_hh