diff options
author | Mathias Gumz <akira at fluxbox dot org> | 2010-09-17 13:34:12 (GMT) |
---|---|---|
committer | Mathias Gumz <akira at fluxbox dot org> | 2010-09-17 13:34:12 (GMT) |
commit | e84c64f7be701e04ec2a2e0fbf980aa4fc9685ad (patch) | |
tree | c290b1e8e86e655e3b37e92477d9cab080243b1f /src/FbTk/TextureRender.hh | |
parent | 603b36a2ccfb6f825dff7259c4d5397c896cc08e (diff) | |
download | fluxbox_pavel-e84c64f7be701e04ec2a2e0fbf980aa4fc9685ad.zip fluxbox_pavel-e84c64f7be701e04ec2a2e0fbf980aa4fc9685ad.tar.bz2 |
lots of code cleanup, reordering, trimming public API, bugfixes
## FbTk/ImageControl.hh:
* moved 'getSqrt()' over to TextureRender.cc because it is used only there
* removed unused members m_root_window
* use std::vector<> for colors and for the gradient buffers.
## FbTk/ImageControl.cc:
* fixed memory leak in '~ImageControl', 'pixels' where not deleted[]
at all. switched to std::vector, non-issue anymore.
* moved identical code into functions 'allocateUnallocatedColors', 'initColortables'
## FbTk/TextureRenderer:
* removed 'from', 'to', 'interlaced' from class, only used in
'renderGradient()' and are actually part of the given
texture.
* removed 'xtable', 'ytable' from class, only used in
'renderGradient()'
* removed 'colors' from the class, is part of 'control'
* moved render actions (invert, bevel1, bevel2, *gradient), they need more
love but for now this is sufficient
Diffstat (limited to 'src/FbTk/TextureRender.hh')
-rw-r--r-- | src/FbTk/TextureRender.hh | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/src/FbTk/TextureRender.hh b/src/FbTk/TextureRender.hh index 158625e..7896c06 100644 --- a/src/FbTk/TextureRender.hh +++ b/src/FbTk/TextureRender.hh | |||
@@ -31,7 +31,6 @@ | |||
31 | 31 | ||
32 | namespace FbTk { | 32 | namespace FbTk { |
33 | 33 | ||
34 | class Color; | ||
35 | class ImageControl; | 34 | class ImageControl; |
36 | class Texture; | 35 | class Texture; |
37 | 36 | ||
@@ -42,8 +41,7 @@ class Texture; | |||
42 | class TextureRender { | 41 | class TextureRender { |
43 | public: | 42 | public: |
44 | TextureRender(ImageControl &ic, unsigned int width, unsigned int height, | 43 | TextureRender(ImageControl &ic, unsigned int width, unsigned int height, |
45 | Orientation orient = ROT0, | 44 | Orientation orient = ROT0); |
46 | XColor *_colors=0, size_t num_colors=0); | ||
47 | ~TextureRender(); | 45 | ~TextureRender(); |
48 | /// render to pixmap | 46 | /// render to pixmap |
49 | Pixmap render(const FbTk::Texture &src_texture); | 47 | Pixmap render(const FbTk::Texture &src_texture); |
@@ -66,36 +64,15 @@ private: | |||
66 | @returns allocated and rendered XImage, user is responsible to deallocate | 64 | @returns allocated and rendered XImage, user is responsible to deallocate |
67 | */ | 65 | */ |
68 | XImage *renderXImage(); | 66 | XImage *renderXImage(); |
69 | /** | ||
70 | @name render functions | ||
71 | */ | ||
72 | //@{ | ||
73 | void invert(); | ||
74 | void bevel1(); | ||
75 | void bevel2(); | ||
76 | void dgradient(); | ||
77 | void egradient(); | ||
78 | void hgradient(); | ||
79 | void pgradient(); | ||
80 | void rgradient(); | ||
81 | void vgradient(); | ||
82 | void cdgradient(); | ||
83 | void pcgradient(); | ||
84 | //@} | ||
85 | 67 | ||
86 | ImageControl &control; | 68 | ImageControl &control; |
87 | bool interlaced; | ||
88 | |||
89 | XColor *colors; // color table | ||
90 | 69 | ||
91 | const FbTk::Color *from, *to; | ||
92 | int red_offset, green_offset, blue_offset, red_bits, green_bits, blue_bits, | 70 | int red_offset, green_offset, blue_offset, red_bits, green_bits, blue_bits, |
93 | ncolors, cpc, cpccpc; | 71 | cpc, cpccpc; |
94 | unsigned char *red, *green, *blue; | 72 | unsigned char *red, *green, *blue; |
95 | const unsigned char *red_table, *green_table, *blue_table; | 73 | const unsigned char *red_table, *green_table, *blue_table; |
96 | Orientation orientation; | 74 | Orientation orientation; |
97 | unsigned int width, height; | 75 | unsigned int width, height; |
98 | unsigned int *xtable, *ytable; | ||
99 | }; | 76 | }; |
100 | 77 | ||
101 | } // end namespace FbTk | 78 | } // end namespace FbTk |