00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef QUSPLINE_H
00021 #define QUSPLINE_H
00022
00023 #include "quadratc.h"
00024 #include "serialis.h"
00025 #include "memry.h"
00026 #include "rect.h"
00027
00028 class ROW;
00029
00030 class QSPLINE
00031 {
00032 friend void make_first_baseline(TBOX *,
00033 int,
00034 int *,
00035 int *,
00036 QSPLINE *,
00037 QSPLINE *,
00038 float);
00039 friend void make_holed_baseline(TBOX *, int, QSPLINE *, QSPLINE *, float);
00040 friend void tweak_row_baseline(ROW *, double, double);
00041 public:
00042 QSPLINE() {
00043 segments = 0;
00044 xcoords = NULL;
00045 quadratics = NULL;
00046 }
00047 QSPLINE(
00048 const QSPLINE &src);
00049 QSPLINE(
00050 inT32 count,
00051 inT32 *xstarts,
00052 double *coeffs);
00053 ~QSPLINE ();
00054 QSPLINE (
00055 int xstarts[],
00056 int segcount,
00057 int xcoords[],
00058 int ycoords[], int blobcount,
00059 int degree);
00060
00061 double step(
00062 double x1,
00063 double x2);
00064 double y(
00065 double x) const;
00066
00067 void move(
00068 ICOORD vec);
00069 BOOL8 overlap(
00070 QSPLINE *spline2,
00071 double fraction);
00072 void extrapolate(
00073 double gradient,
00074 int left,
00075 int right);
00076
00077 #ifndef GRAPHICS_DISABLED
00078 void plot(
00079 ScrollView* window,
00080 ScrollView::Color colour) const;
00081 #endif
00082
00083 QSPLINE & operator= (
00084 const QSPLINE & source);
00085
00086 private:
00087
00088 inT32 spline_index(
00089 double x) const;
00090 inT32 segments;
00091 inT32 *xcoords;
00092 QUAD_COEFFS *quadratics;
00093 };
00094 #endif