Panda3D
 All Classes Functions Variables Enumerations
pnmTextGlyph.h
1 // Filename: pnmTextGlyph.h
2 // Created by: drose (03Apr02)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef PNMTEXTGLYPH_H
16 #define PNMTEXTGLYPH_H
17 
18 #include "pandabase.h"
19 
20 #include "pnmImage.h"
21 #include "vector_int.h"
22 
23 ////////////////////////////////////////////////////////////////////
24 // Class : PNMTextGlyph
25 // Description : A single glyph in a PNMTextMaker.
26 ////////////////////////////////////////////////////////////////////
27 class EXPCL_PANDA_PNMTEXT PNMTextGlyph {
28 PUBLISHED:
29  PNMTextGlyph(double advance);
30  ~PNMTextGlyph();
31 
32  INLINE int get_advance() const;
33 
34  void place(PNMImage &dest_image, int xp, int yp,
35  const LColor &fg);
36  void place(PNMImage &dest_image, int xp, int yp,
37  const LColor &fg, const LColor &interior);
38 
39  INLINE int get_left() const;
40  INLINE int get_right() const;
41  INLINE int get_bottom() const;
42  INLINE int get_top() const;
43 
44  INLINE int get_height() const;
45  INLINE int get_width() const;
46  INLINE double get_value(int x, int y) const;
47  INLINE bool get_interior_flag(int x, int y) const;
48 
49 private:
50  void determine_interior();
51  void scan_interior(int x, int y, xelval new_code, bool neighbor_dark,
52  int recurse_level);
53  void rescale(double scale_factor);
54 
55  PNMImage _image;
56  int _top;
57  int _left;
58  double _advance;
59  int _int_advance;
60  vector_int _scan_interior_points;
61 
62  friend class PNMTextMaker;
63 };
64 
65 #include "pnmTextGlyph.I"
66 
67 #endif
The name of this class derives from the fact that we originally implemented it as a layer on top of t...
Definition: pnmImage.h:68
This object uses the Freetype library to generate text directly into an image.
Definition: pnmTextMaker.h:39
This is the base class for all three-component vectors and points.
Definition: lvecBase4.h:111
A single glyph in a PNMTextMaker.
Definition: pnmTextGlyph.h:27