#include <rendertexture.hh>
Collaboration diagram for otk::RenderTexture:
Definition at line 10 of file rendertexture.hh.
Public Types | |
enum | ReliefType { Flat, Raised, Sunken } |
enum | BevelType { Bevel1, Bevel2 } |
enum | GradientType { Solid, Horizontal, Vertical, Diagonal, CrossDiagonal, PipeCross, Rectangle, Pyramid, Elliptic } |
Public Methods | |
RenderTexture (int screen, bool parent_relative, ReliefType relief, BevelType bevel, bool border, GradientType gradient, bool interlaced, const RGB &color, const RGB &secondary_color, const RGB &border_color, const RGB &interlace_color) | |
virtual | ~RenderTexture () |
bool | parentRelative () const |
If true, the texture is not rendered at all, so all options are ignored. | |
ReliefType | relief () const |
The relief type of the texture. | |
BevelType | bevel () const |
The way the bevel should be drawn. | |
bool | border () const |
If a flat border is drawn on the outside, ignored for all ReliefType values except ReliefType::Flat. | |
GradientType | gradient () const |
The type of gradient to fill the texture with (if any). | |
bool | interlaced () const |
If interlace lines should be drawn over the texture. | |
const RenderColor & | color () const |
The base color for the texture, the only color when the texture is solid. This must always be defined. | |
const RenderColor & | secondary_color () const |
The secondary color for gradient textures. This is only defined for gradients. | |
const RenderColor & | bevelDarkColor () const |
The shadow color for the bevel. This must be defined if RenderTexture::_relief is not RenderTexture::ReliefType::Flat. | |
const RenderColor & | bevelLightColor () const |
The light color for the bevel. This must be defined if RenderTexture::)relief is not RenderTexture::ReliefType::Flat. | |
const RenderColor & | borderColor () const |
The color for the flat border if RenderTexture::_border is true. This must be defined if it is true. | |
const RenderColor & | interlaceColor () const |
The color for the interlace lines if RenderTexture. This must be defined if it is true. | |
Private Attributes | |
int | _screen |
bool | _parent_relative |
If true, the texture is not rendered at all, so all options are ignored. | |
ReliefType | _relief |
The relief type of the texture. | |
BevelType | _bevel |
The way the bevel should be drawn. | |
bool | _border |
If a flat border is drawn on the outside, ignored for all ReliefType values except ReliefType::Flat. | |
GradientType | _gradient |
The type of gradient to fill the texture with (if any). | |
bool | _interlaced |
If interlace lines should be drawn over the texture. | |
const RenderColor * | _color |
The base color for the texture, the only color when the texture is solid. This must always be defined. | |
const RenderColor * | _secondary_color |
The secondary color for a gradient texture. This is only defined for gradients. | |
const RenderColor * | _bevel_dark_color |
The shadow color for the bevel. This must be defined if RenderTexture::_relief is not RenderTexture::ReliefType::Flat. | |
const RenderColor * | _bevel_light_color |
The light color for the bevel. This must be defined if RenderTexture::_relief is not RenderTexture::ReliefType::Flat. | |
const RenderColor * | _border_color |
The color for the flat border if RenderTexture::_border is true. This must be defined if it is true. | |
const RenderColor * | _interlace_color |
The color for the interlace lines if RenderTexture. This must be defined if it is true. |
|
Definition at line 17 of file rendertexture.hh. Referenced by bevel().
|
|
Definition at line 21 of file rendertexture.hh. Referenced by gradient().
00021 { 00022 Solid, 00023 Horizontal, 00024 Vertical, 00025 Diagonal, 00026 CrossDiagonal, 00027 PipeCross, 00028 Rectangle, 00029 Pyramid, 00030 Elliptic 00031 }; |
|
Definition at line 12 of file rendertexture.hh. Referenced by relief().
|
|
Definition at line 70 of file rendertexture.hh. References otk::RenderColor::blue(), Flat, otk::RenderColor::green(), and otk::RenderColor::red().
00077 : _screen(screen), 00078 _parent_relative(parent_relative), 00079 _relief(relief), 00080 _bevel(bevel), 00081 _border(border), 00082 _gradient(gradient), 00083 _interlaced(interlaced), 00084 _color(new RenderColor(screen, color)), 00085 _secondary_color(new RenderColor(screen, secondary_color)), 00086 _bevel_dark_color(0), 00087 _bevel_light_color(0), 00088 _border_color(new RenderColor(screen, border_color)), 00089 _interlace_color(new RenderColor(screen, interlace_color)) 00090 { 00091 if (_relief != Flat) { 00092 unsigned char r, g, b; 00093 00094 // calculate the light bevel color 00095 r = _color->red() + _color->red() / 2; 00096 g = _color->green() + _color->green() / 2; 00097 b = _color->blue() + _color->blue() / 2; 00098 // watch for wraparound 00099 if (r < _color->red()) r = 0xff; 00100 if (g < _color->green()) g = 0xff; 00101 if (b < _color->blue()) b = 0xff; 00102 _bevel_dark_color = new RenderColor(screen, r, g, b); 00103 00104 // calculate the dark bevel color 00105 r = _color->red() / 4 + _color->red() / 2; 00106 g = _color->green() / 4 + _color->green() / 2; 00107 b = _color->blue() / 4 + _color->blue() / 2; 00108 _bevel_light_color = new RenderColor(screen, r, g, b); 00109 } 00110 00111 assert(_relief == Flat || (_bevel_dark_color && _bevel_light_color)); 00112 //assert(!_border || _border_color); 00113 //assert(!_interlaced || _interlace_color); 00114 assert(_color); 00115 assert(_secondary_color); 00116 assert(_border_color); 00117 assert(_interlace_color); 00118 } |
|
Definition at line 120 of file rendertexture.hh.
00120 { 00121 delete _color; 00122 delete _secondary_color; 00123 if (_bevel_dark_color) delete _bevel_dark_color; 00124 if (_bevel_dark_color) delete _bevel_light_color; 00125 delete _border_color; 00126 delete _interlace_color; 00127 } |
|
The way the bevel should be drawn.
Definition at line 134 of file rendertexture.hh. References BevelType. Referenced by otk::TrueRenderControl::drawGradientBackground(), and otk::RenderControl::drawSolidBackground().
00134 { return _bevel; } |
|
The shadow color for the bevel. This must be defined if RenderTexture::_relief is not RenderTexture::ReliefType::Flat.
Definition at line 152 of file rendertexture.hh. Referenced by otk::RenderControl::drawSolidBackground().
00153 { return *_bevel_dark_color; } |
|
The light color for the bevel. This must be defined if RenderTexture::)relief is not RenderTexture::ReliefType::Flat.
Definition at line 156 of file rendertexture.hh. Referenced by otk::RenderControl::drawSolidBackground().
00157 { return *_bevel_light_color; } |
|
If a flat border is drawn on the outside, ignored for all ReliefType values except ReliefType::Flat.
Definition at line 137 of file rendertexture.hh. Referenced by otk::TrueRenderControl::drawGradientBackground(), and otk::RenderControl::drawSolidBackground().
00137 { return _border; } |
|
The color for the flat border if RenderTexture::_border is true. This must be defined if it is true.
Definition at line 160 of file rendertexture.hh. Referenced by otk::TrueRenderControl::drawGradientBackground(), and otk::RenderControl::drawSolidBackground().
00160 { return *_border_color; } |
|
The base color for the texture, the only color when the texture is solid. This must always be defined.
Definition at line 145 of file rendertexture.hh. Referenced by otk::TrueRenderControl::crossDiagonalGradient(), otk::TrueRenderControl::diagonalGradient(), otk::TrueRenderControl::drawBackground(), otk::PseudoRenderControl::drawBackground(), otk::RenderControl::drawSolidBackground(), and otk::TrueRenderControl::verticalGradient().
00145 { return *_color; } |
|
The type of gradient to fill the texture with (if any).
Definition at line 139 of file rendertexture.hh. References GradientType. Referenced by otk::TrueRenderControl::drawBackground(), and otk::TrueRenderControl::drawGradientBackground().
00139 { return _gradient; } |
|
The color for the interlace lines if RenderTexture. This must be defined if it is true.
Definition at line 163 of file rendertexture.hh. Referenced by otk::RenderControl::drawSolidBackground().
00164 { return *_interlace_color; } |
|
If interlace lines should be drawn over the texture.
Definition at line 141 of file rendertexture.hh. Referenced by otk::RenderControl::drawSolidBackground().
00141 { return _interlaced; } |
|
If true, the texture is not rendered at all, so all options are ignored.
Definition at line 130 of file rendertexture.hh. Referenced by otk::RenderControl::drawSolidBackground().
00130 { return _parent_relative; } |
|
The relief type of the texture.
Definition at line 132 of file rendertexture.hh. References ReliefType. Referenced by otk::TrueRenderControl::drawGradientBackground(), and otk::RenderControl::drawSolidBackground().
00132 { return _relief; } |
|
The secondary color for gradient textures. This is only defined for gradients.
Definition at line 148 of file rendertexture.hh. Referenced by otk::TrueRenderControl::crossDiagonalGradient(), otk::TrueRenderControl::diagonalGradient(), and otk::TrueRenderControl::verticalGradient().
00149 { return *_secondary_color; } |
|
The way the bevel should be drawn.
Definition at line 41 of file rendertexture.hh. |
|
The shadow color for the bevel. This must be defined if RenderTexture::_relief is not RenderTexture::ReliefType::Flat.
Definition at line 58 of file rendertexture.hh. |
|
The light color for the bevel. This must be defined if RenderTexture::_relief is not RenderTexture::ReliefType::Flat.
Definition at line 61 of file rendertexture.hh. |
|
If a flat border is drawn on the outside, ignored for all ReliefType values except ReliefType::Flat.
Definition at line 44 of file rendertexture.hh. |
|
The color for the flat border if RenderTexture::_border is true. This must be defined if it is true.
Definition at line 64 of file rendertexture.hh. |
|
The base color for the texture, the only color when the texture is solid. This must always be defined.
Definition at line 52 of file rendertexture.hh. |
|
The type of gradient to fill the texture with (if any).
Definition at line 46 of file rendertexture.hh. |
|
The color for the interlace lines if RenderTexture. This must be defined if it is true.
Definition at line 67 of file rendertexture.hh. |
|
If interlace lines should be drawn over the texture.
Definition at line 48 of file rendertexture.hh. |
|
If true, the texture is not rendered at all, so all options are ignored.
Definition at line 37 of file rendertexture.hh. |
|
The relief type of the texture.
Definition at line 39 of file rendertexture.hh. |
|
Definition at line 34 of file rendertexture.hh. |
|
The secondary color for a gradient texture. This is only defined for gradients.
Definition at line 55 of file rendertexture.hh. |