A single glyph in a PNMTextMaker. More...
#include "pnmTextGlyph.h"
Public Member Functions | |
PNMTextGlyph (double advance) | |
int | get_advance () const |
Returns the number of pixels by which the pen should be advanced after rendering this glyph. More... | |
int | get_bottom () const |
Returns the y coordinate of the bottommost pixel in the glyph. More... | |
int | get_height () const |
Returns the height of the glyph in pixels. More... | |
bool | get_interior_flag (int x, int y) const |
Returns true if the indicated pixel represents a pixel in the interior of a hollow font, false otherwise. More... | |
int | get_left () const |
Returns the x coordinate of the leftmost pixel in the glyph. More... | |
int | get_right () const |
Returns the x coordinate of the rightmost pixel in the glyph. More... | |
int | get_top () const |
Returns the y coordinate of the topmost pixel in the glyph. More... | |
double | get_value (int x, int y) const |
Returns the value of the indicated pixel of the glyph. More... | |
int | get_width () const |
Returns the width of the glyph in pixels. More... | |
void | place (PNMImage &dest_image, int xp, int yp, const LColor &fg) |
Copies the glyph to the indicated destination image at the indicated origin. More... | |
void | place (PNMImage &dest_image, int xp, int yp, const LColor &fg, const LColor &interior) |
This flavor of place() also fills in the interior color. More... | |
Friends | |
class | PNMTextMaker |
A single glyph in a PNMTextMaker.
Definition at line 25 of file pnmTextGlyph.h.
|
inline |
Returns the number of pixels by which the pen should be advanced after rendering this glyph.
Definition at line 19 of file pnmTextGlyph.I.
Referenced by PNMTextMaker::calc_width(), and PNMTextMaker::generate_into().
|
inline |
Returns the y coordinate of the bottommost pixel in the glyph.
Definition at line 43 of file pnmTextGlyph.I.
References PNMImageHeader::get_y_size().
|
inline |
Returns the height of the glyph in pixels.
Definition at line 59 of file pnmTextGlyph.I.
References PNMImageHeader::get_y_size().
|
inline |
Returns true if the indicated pixel represents a pixel in the interior of a hollow font, false otherwise.
Definition at line 89 of file pnmTextGlyph.I.
|
inline |
Returns the x coordinate of the leftmost pixel in the glyph.
Definition at line 27 of file pnmTextGlyph.I.
|
inline |
Returns the x coordinate of the rightmost pixel in the glyph.
Definition at line 35 of file pnmTextGlyph.I.
|
inline |
Returns the y coordinate of the topmost pixel in the glyph.
Definition at line 51 of file pnmTextGlyph.I.
|
inline |
Returns the value of the indicated pixel of the glyph.
The result is in the range [0, 1], where 0 indicates the pixel is not part of the glyph, and 1 indicates it is. Intermediate values are used to represent antialiasing.
Definition at line 77 of file pnmTextGlyph.I.
|
inline |
Returns the width of the glyph in pixels.
Definition at line 67 of file pnmTextGlyph.I.
References PNMImageHeader::get_x_size().
void PNMTextGlyph::place | ( | PNMImage & | dest_image, |
int | xp, | ||
int | yp, | ||
const LColor & | fg | ||
) |
Copies the glyph to the indicated destination image at the indicated origin.
It colors the glyph pixels the indicated foreground color, blends antialiased pixels with the appropriate amount of the foreground color and the existing background color, and leaves other pixels alone.
Definition at line 46 of file pnmTextGlyph.cxx.
References PNMImage::is_valid().
Referenced by PNMTextMaker::generate_into().
void PNMTextGlyph::place | ( | PNMImage & | dest_image, |
int | xp, | ||
int | yp, | ||
const LColor & | fg, | ||
const LColor & | interior | ||
) |
This flavor of place() also fills in the interior color.
This requires that determine_interior was called earlier.
Definition at line 84 of file pnmTextGlyph.cxx.
References PNMImage::is_valid().