]>
Dogcows Code - chaz/openbox/blob - otk/image.hh
1 // -*- mode: C++; indent-tabs-mode: nil; -*-
13 #include "screeninfo.hh"
24 BImageControl
*control
;
29 int red_offset
, green_offset
, blue_offset
, red_bits
, green_bits
, blue_bits
,
31 unsigned char *red
, *green
, *blue
, *red_table
, *green_table
, *blue_table
;
32 unsigned int width
, height
, *xtable
, *ytable
;
34 void TrueColorDither(unsigned int bit_depth
, int bytes_per_line
,
35 unsigned char *pixel_data
);
36 void PseudoColorDither(int bytes_per_line
, unsigned char *pixel_data
);
38 void OrderedPseudoColorDither(int bytes_per_line
, unsigned char *pixel_data
);
41 Pixmap
renderPixmap(void);
42 Pixmap
render_solid(const BTexture
&texture
);
43 Pixmap
render_gradient(const BTexture
&texture
);
45 XImage
*renderXImage(void);
50 void border(const BTexture
&texture
);
57 void cdgradient(void);
58 void pcgradient(void);
62 BImage(BImageControl
*c
, int w
, int h
);
65 Pixmap
render(const BTexture
&texture
);
74 unsigned int count
, width
, height
;
75 unsigned long pixel1
, pixel2
, texture
;
78 BImageControl(OBTimerQueueManager
*timermanager
,
79 const ScreenInfo
*scrn
,
80 bool _dither
= False
, int _cpc
= 4,
81 unsigned long cache_timeout
= 300000l,
82 unsigned long cmax
= 200l);
83 virtual ~BImageControl(void);
85 inline bool doDither(void) { return dither
; }
87 inline const ScreenInfo
* getScreenInfo() const { return screeninfo
; }
89 inline Window
getDrawable(void) const { return window
; }
91 inline Visual
*getVisual(void) { return screeninfo
->getVisual(); }
93 inline int getBitsPerPixel(void) const { return bits_per_pixel
; }
94 inline int getDepth(void) const { return screen_depth
; }
95 inline int getColorsPerChannel(void) const
96 { return colors_per_channel
; }
98 unsigned long getSqrt(unsigned int x
);
100 Pixmap
renderImage(unsigned int width
, unsigned int height
,
101 const BTexture
&texture
);
103 void installRootColormap(void);
104 void removeImage(Pixmap pixmap
);
105 void getColorTables(unsigned char **rmt
, unsigned char **gmt
,
107 int *roff
, int *goff
, int *boff
,
108 int *rbit
, int *gbit
, int *bbit
);
109 void getXColorTable(XColor
**c
, int *n
);
110 void getGradientBuffers(unsigned int w
, unsigned int h
,
111 unsigned int **xbuf
, unsigned int **ybuf
);
112 void setDither(bool d
) { dither
= d
; }
113 void setColorsPerChannel(int cpc
);
115 static void timeout(BImageControl
*t
);
119 const ScreenInfo
*screeninfo
;
126 int colors_per_channel
, ncolors
, screen_number
, screen_depth
,
127 bits_per_pixel
, red_offset
, green_offset
, blue_offset
,
128 red_bits
, green_bits
, blue_bits
;
129 unsigned char red_color_table
[256], green_color_table
[256],
130 blue_color_table
[256];
131 unsigned int *grad_xbuffer
, *grad_ybuffer
, grad_buffer_width
,
133 unsigned long *sqrt_table
, cache_max
;
135 typedef std::list
<CachedImage
> CacheContainer
;
136 CacheContainer cache
;
138 Pixmap
searchCache(const unsigned int width
, const unsigned int height
,
139 const unsigned long texture
,
140 const BColor
&c1
, const BColor
&c2
);
This page took 0.041105 seconds and 4 git commands to generate.