00001
00020 #ifndef OCRROW_H
00021 #define OCRROW_H
00022
00023 #include <stdio.h>
00024 #include "quspline.h"
00025 #include "werd.h"
00026
00027 class TO_ROW;
00028
00033 class ROW:public ELIST_LINK
00034 {
00035 friend void tweak_row_baseline(ROW *);
00036 public:
00037 ROW() {
00038 }
00039 ROW(
00040 INT32 spline_size,
00041 INT32 *xstarts,
00042 double *coeffs,
00043 float x_height,
00044 float ascenders,
00045 float descenders,
00046 INT16 kern,
00047 INT16 space);
00048 ROW(
00049 TO_ROW *row,
00050 INT16 kern,
00051 INT16 space);
00052
00053 WERD_LIST *word_list() {
00054 return &words;
00055 }
00056
00057 float base_line(
00058 float xpos) const {
00059
00060 return (float) baseline.y (xpos);
00061 }
00062 float x_height() const {
00063 return xheight;
00064 }
00065 INT32 kern() const {
00066 return kerning;
00067 }
00068 INT32 space() const {
00069 return spacing;
00070 }
00071 float ascenders() const {
00072 return ascrise;
00073 }
00074 float descenders() const {
00075 return descdrop;
00076 }
00077 BOX bounding_box() const {
00078 return bound_box;
00079 }
00080
00081 void recalc_bounding_box();
00082
00083 void move(
00084 const ICOORD vec);
00085
00086 void print(
00087 FILE *fp);
00088
00089 void plot(
00090 WINDOW window,
00091 COLOUR colour);
00092 void plot(
00093 WINDOW window);
00094
00095 #ifndef GRAPHICS_DISABLED
00096 void plot_baseline(
00097 WINDOW window,
00098 COLOUR colour) {
00099
00100 baseline.plot (window, colour);
00101 }
00102 #endif
00103
00104 void prep_serialise() {
00105 words.prep_serialise ();
00106 baseline.prep_serialise ();
00107 }
00108
00109 void dump(
00110 FILE *f) {
00111 words.dump (f);
00112 baseline.dump (f);
00113 }
00114
00115 void de_dump(
00116 FILE *f) {
00117 words.de_dump (f);
00118 baseline.de_dump (f);
00119 }
00120
00121
00122 make_serialise (ROW) ROW & operator= (
00123 const ROW & source);
00124
00125 private:
00126 INT32 kerning;
00127 INT32 spacing;
00128 BOX bound_box;
00129 float xheight;
00130 float ascrise;
00131 float descdrop;
00132 WERD_LIST words;
00133 QSPLINE baseline;
00134 };
00135
00136 ELISTIZEH_S (ROW)
00137 #endif