Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

ConvPic.hh

Go to the documentation of this file.
00001 /*
00002 
00003     Picture converter, ads data in .inf to the picture
00004     Copyright (C) 2002-2003 Jussi Laako
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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 /* fbfont/8 */
00032 #   define CP_FONT_NORMAL   12 /* fbfont/10 */
00033 #   define CP_FONT_LARGE    16 /* fbfont/12 */
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

Generated on Sun Oct 26 19:11:19 2003 for HASAS by doxygen 1.3.3