#include <OSGTextPixmapGlyph.h>
Inheritance diagram for osg::TextPixmapGlyph:

Definition at line 61 of file OSGTextPixmapGlyph.h.
|
|
Defines the glyph index Definition at line 65 of file OSGTextGlyph.h. |
|
|
Defines the invalid glyph index Definition at line 68 of file OSGTextGlyph.h. 00068 { INVALID_INDEX = -1 };
|
|
|
Destroys the TextPixmapGlyph object. Definition at line 52 of file OSGTextPixmapGlyph.cpp. References _pixmap. 00053 { delete [] _pixmap; }
|
|
|
Creates a new TextPixmapGlyph object. Definition at line 68 of file OSGTextPixmapGlyph.inl. 00069 : TextGlyph(), _width(0), _pitch(0), _height(0), _horiBearingX(0), _horiBearingY(0), _vertBearingX(0), _vertBearingY(0), _pixmap(0) 00070 {}
|
|
|
Copy constructor (not implemented!) |
|
|
Returns the width of the glyph.
Implements osg::TextGlyph. Definition at line 60 of file OSGTextPixmapGlyph.cpp. References _width. 00061 { return static_cast<Real32>(_width); }
|
|
|
Returns the height of the glyph.
Implements osg::TextGlyph. Definition at line 68 of file OSGTextPixmapGlyph.cpp. References _height. 00069 { return static_cast<Real32>(_height); }
|
|
|
Returns the x bearing of the glyph for horizontal layout. The x bearing is the distance from the origin to the left border of the glyph.
Implements osg::TextGlyph. Definition at line 76 of file OSGTextPixmapGlyph.cpp. References _horiBearingX. 00077 { return static_cast<Real32>(_horiBearingX); }
|
|
|
Returns the y bearing of the glyph for horizontal layout. The y bearing is the distance from the origin to the top border of the glyph.
Implements osg::TextGlyph. Definition at line 84 of file OSGTextPixmapGlyph.cpp. References _horiBearingY. 00085 { return static_cast<Real32>(_horiBearingY); }
|
|
|
Returns the x bearing of the glyph for vertical layout. The x bearing is the distance from the origin to the left border of the glyph.
Implements osg::TextGlyph. Definition at line 92 of file OSGTextPixmapGlyph.cpp. References _vertBearingX. 00093 { return static_cast<Real32>(_vertBearingX); }
|
|
|
Returns the y bearing of the glyph for vertical layout. The y bearing is the distance from the origin to the top border of the glyph.
Implements osg::TextGlyph. Definition at line 100 of file OSGTextPixmapGlyph.cpp. References _vertBearingY. 00101 { return static_cast<Real32>(_vertBearingY); }
|
|
|
Returns the width of the pixmap in pixels.
Definition at line 43 of file OSGTextPixmapGlyph.inl. References _width. 00043 { return _width; }
|
|
|
Returns the pitch of the pixmap (the number of bytes per row).
Definition at line 46 of file OSGTextPixmapGlyph.inl. References _pitch. 00046 { return _pitch; }
|
|
|
Returns the height of the pixmap in pixels.
Definition at line 49 of file OSGTextPixmapGlyph.inl. References _height. 00049 { return _height; }
|
|
|
Returns the pixmap.
Definition at line 65 of file OSGTextPixmapGlyph.inl. References _pixmap. 00065 { return _pixmap; }
|
|
||||||||||||||||||||||||
|
Copies the glyph pixmap into a texture.
Definition at line 108 of file OSGTextPixmapGlyph.cpp. References _height, _pitch, _pixmap, _width, and p. Referenced by osg::TextPixmapFace::makeImage(). 00110 { 00111 if (_pixmap != 0) 00112 { 00113 // Clip the glyph at the left border of the texture 00114 int left = 0; 00115 int glyphWidth = _width; 00116 int src = 0; 00117 int dst = 0; 00118 int delta = x; 00119 if (delta < left) 00120 { 00121 delta = left - delta; 00122 src += delta; 00123 glyphWidth -= delta; 00124 delta = left; 00125 } 00126 dst += delta; 00127 00128 // Clip the glyph at the right border of the texture 00129 int right = width; 00130 delta = right - dst; 00131 if (delta < glyphWidth) 00132 glyphWidth = delta; 00133 00134 // Clip the glyph at the bottom border of the texture 00135 int bottom = 0; 00136 int glyphHeight = _height; 00137 delta = y - _height; 00138 if (delta < bottom) 00139 { 00140 delta = bottom - delta; 00141 src += delta * _pitch; 00142 glyphHeight -= delta; 00143 delta = bottom; 00144 } 00145 dst += delta * width; 00146 00147 // Clip the glyph at the top border of the texture 00148 int top = height; 00149 delta = top - y /*- _horiBearingY*/; 00150 if (delta < 0) 00151 glyphHeight += delta; 00152 00153 int xi, yi; 00154 for (yi = glyphHeight; yi > 0; --yi) 00155 { 00156 unsigned char *srcPtr = &(_pixmap[src]); 00157 unsigned char *dstPtr = &(tex[dst]); 00158 for (xi = glyphWidth; xi > 0; --xi) 00159 { 00160 unsigned char p = 255 - ((255 - *dstPtr) * (255 - *srcPtr) / 255); 00161 *dstPtr++ = p; 00162 srcPtr++; 00163 } 00164 src += _pitch; 00165 dst += width; 00166 } 00167 } 00168 }
|
|
|
Flips the glyph pixmap around the x axis. Definition at line 175 of file OSGTextPixmapGlyph.cpp. References _height, _pitch, _pixmap, and _width. 00176 { 00177 if (_pixmap == 0) 00178 return; 00179 unsigned char *ptr1 = _pixmap; 00180 unsigned char *ptr2 = _pixmap + _pitch * (_height - 1); 00181 unsigned int x, y; 00182 for (y = _height >> 1; y > 0; --y) 00183 { 00184 for (x = 0; x < _width; ++x) 00185 { 00186 unsigned char h = ptr1[x]; 00187 ptr1[x] = ptr2[x]; 00188 ptr2[x] = h; 00189 } 00190 ptr1 += _pitch; 00191 ptr2 -= _pitch; 00192 } 00193 }
|
|
|
Copy operator (not implemented!) |
|
|
Returns the index of the glyph.
Definition at line 43 of file OSGTextGlyph.inl. References osg::TextGlyph::_glyphIndex. 00043 { return _glyphIndex; }
|
|
|
Returns the advance of the glyph for horizontal layout. The advance is the distance to the next character on the base line.
Definition at line 46 of file OSGTextGlyph.inl. References osg::TextGlyph::_horiAdvance. 00046 { return _horiAdvance; }
|
|
|
Returns the advance of the glyph for vertical layout. The advance is the distance to the next character on the base line. This value is usually negative!
Definition at line 49 of file OSGTextGlyph.inl. References osg::TextGlyph::_vertAdvance. 00049 { return _vertAdvance; }
|
|
|
Needs access to constructor Definition at line 65 of file OSGTextPixmapGlyph.h. |
|
|
The width of the pixmap in pixels Definition at line 195 of file OSGTextPixmapGlyph.h. Referenced by flipPixmap(), getPixmapWidth(), getWidth(), and putPixmap(). |
|
|
The pitch of the pixmap (number of bytes per row) Definition at line 198 of file OSGTextPixmapGlyph.h. Referenced by flipPixmap(), getPixmapPitch(), and putPixmap(). |
|
|
The height of the pixmap in pixels Definition at line 201 of file OSGTextPixmapGlyph.h. Referenced by flipPixmap(), getHeight(), getPixmapHeight(), and putPixmap(). |
|
|
The x bearing of the pixmap in pixels for horizontal layout Definition at line 204 of file OSGTextPixmapGlyph.h. Referenced by getHoriBearingX(). |
|
|
The y bearing of the pixmap in pixels for horizontal layout Definition at line 207 of file OSGTextPixmapGlyph.h. Referenced by getHoriBearingY(). |
|
|
The x bearing of the pixmap in pixels for vertical layout Definition at line 210 of file OSGTextPixmapGlyph.h. Referenced by getVertBearingX(). |
|
|
The y bearing of the pixmap in pixels for vertical layout Definition at line 213 of file OSGTextPixmapGlyph.h. Referenced by getVertBearingY(). |
|
|
The pixmap Definition at line 216 of file OSGTextPixmapGlyph.h. Referenced by flipPixmap(), getPixmap(), putPixmap(), and ~TextPixmapGlyph(). |
|
|
The index of the glyph Definition at line 145 of file OSGTextGlyph.h. Referenced by osg::TextGlyph::getGlyphIndex(). |
|
|
The advance of the glyph for horizontal layout Definition at line 148 of file OSGTextGlyph.h. Referenced by osg::TextGlyph::getHoriAdvance(). |
|
|
The advance of the glyph for vertical layout Definition at line 151 of file OSGTextGlyph.h. Referenced by osg::TextGlyph::getVertAdvance(). |
1.4.3