00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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
00029 class ROW:public ELIST_LINK
00030 {
00031 friend void tweak_row_baseline(ROW *);
00032 public:
00033 ROW() {
00034 }
00035 ROW(
00036 inT32 spline_size,
00037 inT32 *xstarts,
00038 double *coeffs,
00039 float x_height,
00040 float ascenders,
00041 float descenders,
00042 inT16 kern,
00043 inT16 space);
00044 ROW(
00045 TO_ROW *row,
00046 inT16 kern,
00047 inT16 space);
00048
00049 WERD_LIST *word_list() {
00050 return &words;
00051 }
00052
00053 float base_line(
00054 float xpos) const {
00055
00056 return (float) baseline.y (xpos);
00057 }
00058 float x_height() const {
00059 return xheight;
00060 }
00061 void set_x_height(float new_xheight) {
00062 xheight = new_xheight;
00063 }
00064 inT32 kern() const {
00065 return kerning;
00066 }
00067 inT32 space() const {
00068 return spacing;
00069 }
00070 float ascenders() const {
00071 return ascrise;
00072 }
00073 float descenders() const {
00074 return descdrop;
00075 }
00076 TBOX bounding_box() const {
00077 return bound_box;
00078 }
00079
00080 void recalc_bounding_box();
00081
00082 void move(
00083 const ICOORD vec);
00084
00085 void print(
00086 FILE *fp);
00087
00088 void plot(
00089 ScrollView* window,
00090 ScrollView::Color colour);
00091 void plot(
00092 ScrollView* window);
00093
00094 #ifndef GRAPHICS_DISABLED
00095 void plot_baseline(
00096 ScrollView* window,
00097 ScrollView::Color colour) {
00098
00099 baseline.plot (window, colour);
00100 }
00101 #endif
00102
00103 void prep_serialise() {
00104 words.prep_serialise ();
00105 baseline.prep_serialise ();
00106 }
00107
00108 void dump(
00109 FILE *f) {
00110 words.dump (f);
00111 baseline.dump (f);
00112 }
00113
00114 void de_dump(
00115 FILE *f) {
00116 words.de_dump (f);
00117 baseline.de_dump (f);
00118 }
00119
00120
00121 make_serialise (ROW) ROW & operator= (
00122 const ROW & source);
00123
00124 private:
00125 inT32 kerning;
00126 inT32 spacing;
00127 TBOX bound_box;
00128 float xheight;
00129 float ascrise;
00130 float descdrop;
00131 WERD_LIST words;
00132 QSPLINE baseline;
00133 };
00134
00135 ELISTIZEH_S (ROW)
00136 #endif