]> Dogcows Code - chaz/openbox/blobdiff - otk/truerendercontrol.hh
Added color reduction for 16bpp displays
[chaz/openbox] / otk / truerendercontrol.hh
index 9647a2a302c5414ab6773064260d8e470dd76a2e..7da6f8be3671b708d26be19bcd533ae67d3f3edf 100644 (file)
@@ -4,20 +4,53 @@
 
 #include "rendercontrol.hh"
 
+extern "C" {
+
+#ifdef HAVE_STDINT_H
+#  include <stdint.h>
+#else
+#  ifdef HAVE_SYS_TYPES_H
+#    include <sys/types.h>
+#  endif
+#endif
+
+}
+
+#include <vector>
+
 namespace otk {
 
+#ifdef HAVE_STDINT_H
+typedef uint32_t pixel32;
+typedef uint16_t pixel16;
+#else
+typedef u_int32_t pixel32;
+typedef u_int16_t pixel16;
+#endif
+
 class TrueRenderControl : public RenderControl {
 private:
+  // the number of bits to shift a color value (from 0-255) to the right, to
+  // fit it into the the color mask (do this before the offset)
+  int _red_shift;
+  int _green_shift;
+  int _blue_shift;
+
   // the offset of each color in a color mask
   int _red_offset;
   int _green_offset;
   int _blue_offset;
 
 public:
-  TrueRenderControl(const ScreenInfo *screen);
+  TrueRenderControl(int screen);
   virtual ~TrueRenderControl();
 
-  virtual void render(::Drawable d);
+  virtual void drawBackground(Surface& sf, const RenderTexture &texture) const;
+  virtual void drawGradientBackground(Surface &sf,
+                                      const RenderTexture &texture) const;
+
+  inline void highlight(pixel32 *x, pixel32 *y, bool raised) const;
+  void reduceDepth(XImage *im, pixel32 *data) const;
 };
 
 }
This page took 0.023894 seconds and 4 git commands to generate.