Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

/otk/truerendercontrol.hh

Go to the documentation of this file.
00001 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
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 /* HAVE_STDINT_H */
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 /* WORDS_BIGENDIAN */
00042 
00043 class TrueRenderControl : public RenderControl {
00044 private:
00045   // the number of bits to shift a color value (from 0-255) to the right, to
00046   // fit it into the the color mask (do this before the offset)
00047   int _red_shift;
00048   int _green_shift;
00049   int _blue_shift;
00050 
00051   // the offset of each color in a color mask
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

Generated on Tue Feb 4 22:58:56 2003 for Openbox by doxygen1.3-rc2