00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #define EPSF_AUTO 1
00030 #define EPSF_NEXT 2
00031 #define EPSF_nxm 4
00032
00033 #define EPSF_XM 500
00034 #define EPSF_YM_A4 800
00035 #define EPSF_YM_LETTER 740
00036
00037 #define FIGNRMFNTSZ 12.
00038 #define FIGNRMWIDTH 177.
00039
00040 #define A4PAPER 1
00041 #define LETTERPAPER 2
00042
00043 int EpsfFileWrite (char *fname, Scan *Original, Scan *Icon, int NoAuto, int rfac);
00044
00045 class EpsfTools{
00046 public:
00047 EpsfTools(int paper=A4PAPER);
00048 virtual ~EpsfTools();
00049
00050 void SetPaperTyp(int paper=A4PAPER) { papertyp=paper; };
00051 int open(char *name, int fullpage=FALSE, int typ=-1, int info=-1);
00052 void NIcons(int n=0){ MkTyp=n/2; nPicPage=n*n*3/2; };
00053 void SetAbbWidth(double mm=FIGNRMWIDTH){ Width=mm; };
00054 void SetFontSize(double p=FIGNRMFNTSZ);
00055
00056 void FootLine(Scan *s, int force=FALSE);
00057
00058 void init();
00059 void placeimage();
00060 void putframe();
00061 void putline(Scan *s, int x1, int y1, int x2, int y2);
00062 void putcircle(Scan *s, int x1, int y1, int x2, int y2);
00063 int putticks(Scan *s, int OriginZero=TRUE);
00064 void putgrey(Scan *s, Mem2d *m, int autoskl=TRUE, int quick=TRUE, int option=0);
00065 void putbar(Scan *s);
00066 virtual void putsize(Scan *s);
00067 virtual void putmore(Scan *s, char *Title=NULL);
00068
00069 void endimage();
00070
00071 void close();
00072
00073 private:
00074 void makesize(int &Nx, int &Ny);
00075 void tr2picorigin(int Nx, int Ny);
00076 void putheader(int fullpage, int typ, int info);
00077 void putimgdef(Mem2d *m, int y=-1);
00078
00079 char EpsfBuffer[32000];
00080 char *fname;
00081 int MkTyp;
00082 int imgdef;
00083 int PicNo;
00084 int nPicPage;
00085 int page;
00086 int papertyp;
00087
00088 protected:
00089 std::ofstream Icf;
00090 double Width, FontSize;
00091 gchar *font;
00092 };
00093
00094 class SPM_epsftools : public EpsfTools{
00095 public:
00096 SPM_epsftools(){};
00097 virtual ~SPM_epsftools(){};
00098 };
00099
00100 class SPA_epsftools : public EpsfTools{
00101 public:
00102 SPA_epsftools(){};
00103 virtual ~SPA_epsftools(){};
00104
00105 virtual void putsize(Scan *s);
00106 virtual void putmore(Scan *s, char *Title=NULL);
00107
00108 };