00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include <ctime>
00024 #include <Magick++.h>
00025
00026
00027 #ifndef CONVPIC_HH
00028 #define CONVPIC_HH
00029
00030 # define CP_FONT_NAME "helvetica"
00031 # define CP_FONT_SMALL 10
00032 # define CP_FONT_NORMAL 12
00033 # define CP_FONT_LARGE 16
00034 # define CP_PAGE_SPEC "+100+100"
00035 # define CP_MARGIN_L 100
00036 # define CP_MARGIN_T 100
00037 # define CP_MARGIN_R 50
00038 # define CP_MARGIN_B 50
00039 # define CP_TICKL_LEN 10
00040 # define CP_TICKS_LEN 5
00041
00042
00043 using namespace std;
00044 using namespace Magick;
00045
00046
00050 enum
00051 {
00052 CP_TYPE_LOFAR,
00053 CP_TYPE_DEMON,
00054 CP_TYPE_SGRAM,
00055 CP_TYPE_TBEAR
00056 };
00057
00058
00062 typedef struct _stLOFARInfo
00063 {
00064 time_t ttTime;
00065 double dLowFreq;
00066 double dHighFreq;
00067 double dLineTime;
00068 } stLOFARInfo, *stpLOFARInfo;
00069
00073 typedef struct _stDEMONInfo
00074 {
00075 time_t ttTime;
00076 double dLowFreq;
00077 double dHighFreq;
00078 double dDEMONBand;
00079 double dLineTime;
00080 } stDEMONInfo, *stpDEMONInfo;
00081
00085 typedef struct _stSGramInfo
00086 {
00087 time_t ttTime;
00088 double dLowFreq;
00089 double dHighFreq;
00090 double dLineTime;
00091 } stSGramInfo, *stpSGramInfo;
00092
00096 typedef struct _stTBearInfo
00097 {
00098 time_t ttTime;
00099 double dLeftDir;
00100 double dRightDir;
00101 double dIntTime;
00102 double dHighFreq;
00103 int iSectors;
00104 } stTBearInfo, *stpTBearInfo;
00105
00109 typedef union _uPicInfo
00110 {
00111 stLOFARInfo sLOFAR;
00112 stDEMONInfo sDEMON;
00113 stSGramInfo sSGram;
00114 stTBearInfo sTBear;
00115 } utPicInfo, *utpPicInfo;
00116
00117
00122 class clConvPic
00123 {
00124 bool bTwoColor;
00125 int iType;
00126 int iSrcWidth;
00127 int iSrcHeight;
00128 int iDstWidth;
00129 int iDstHeight;
00130 char *cpPageSize;
00131 utPicInfo uPicInfo;
00132 Image *ImgSrc;
00133 Image *ImgDst;
00134 bool Initialize ();
00135 bool LoadLOFARInfo (const char *);
00136 bool LoadDEMONInfo (const char *);
00137 bool LoadSGramInfo (const char *);
00138 bool LoadTBearInfo (const char *);
00139 bool LoadAndCreate (const char *);
00140 bool CopySource ();
00141 bool DrawLOFARInfo ();
00142 bool DrawDEMONInfo ();
00143 bool DrawSGramInfo ();
00144 bool DrawTBearInfo ();
00145 bool ConvertColors ();
00146 bool SaveResult (const char *);
00147 void Clean ();
00148 void SplitLine (const char *, string &, string &);
00149 time_t ParseTime (const char *);
00150 double RadToDeg (double);
00151 void GetTextSize (const char *, int *, int *, int * = NULL);
00152 public:
00153 clConvPic ();
00154 ~clConvPic ();
00155 int Main (int *, char ***);
00156 };
00157
00158 #endif