WSxM_header.h

Go to the documentation of this file.
00001 /***********************************************************************
00002 *
00003 *       File Name: Header.h
00004 *
00005 *       Description: Header file for Header.c
00006 *
00007 ***********************************************************************/
00008 
00009 #include <stdio.h>
00010 // The max. number of chars in a value has to be defined.
00011 // This should already be done in 'WSxM_io.C'
00012 #ifndef WSXM_MAXCHARS
00013 #define WSXM_MAXCHARS 1000
00014 #endif
00015 
00016 #define IMAGE_HEADER_VERSION        "1.0 (April 2000)"
00017 #define IMAGE_HEADER_SIZE_TEXT      "Image header size: "
00018 #define IMAGE_HEADER_END_TEXT       "Header end"
00019 #define TEXT_COPYRIGHT_NANOTEC      "WSxM file copyright Nanotec Electronica\n"
00020 #define STM_IMAGE_FILE_ID           "SxM Image file\n"
00021 
00022 #define IMAGE_HEADER_GENERAL_INFO                  "General Info"
00023 #define IMAGE_HEADER_GENERAL_INFO_NUM_COLUMNS      "Number of columns"
00024 #define IMAGE_HEADER_GENERAL_INFO_NUM_ROWS         "Number of rows"
00025 #define IMAGE_HEADER_GENERAL_INFO_Z_AMPLITUDE      "Z Amplitude"
00026 #define IMAGE_HEADER_GENERAL_INFO_ACQ_CHANNEL      "Acquisition channel"
00027 #define IMAGE_HEADER_GENERAL_INFO_HEAD_TYPE        "Head type"
00028 
00029 #define IMAGE_HEADER_MISC_INFO                     "Miscellaneous"
00030 #define IMAGE_HEADER_MISC_INFO_MAXIMUM             "Maximum"
00031 #define IMAGE_HEADER_MISC_INFO_MINIMUM             "Minimum"
00032 #define IMAGE_HEADER_MISC_INFO_COMMENTS            "Comments"
00033 #define IMAGE_HEADER_MISC_INFO_VERSION             "Version"
00034 
00035 #define IMAGE_HEADER_CONTROL                     "Control"
00036 #define IMAGE_HEADER_CONTROL_X_AMPLITUDE         "X Amplitude"
00037 #define IMAGE_HEADER_CONTROL_Y_AMPLITUDE         "Y Amplitude"
00038 #define IMAGE_HEADER_CONTROL_SET_POINT           "Set point"
00039 #define IMAGE_HEADER_CONTROL_Z_GAIN              "Z Gain"
00040 #define IMAGE_HEADER_CONTROL_BIAS                "Topography Bias"
00041 #define IMAGE_HEADER_CONTROL_X_FREQUENCY         "X-Frequency"
00042 #define IMAGE_HEADER_CONTROL_X_OFFSET            "X Offset"
00043 #define IMAGE_HEADER_CONTROL_Y_OFFSET            "Y Offset"
00044 #define IMAGE_HEADER_CONTROL_ROTATION            "Rotation"
00045 #define IMAGE_HEADER_CONTROL_SCAN_DIRECTION      "Direction"
00046 
00047 #define IMAGE_HEADER_HEADS                        "Head Settings"
00048 #define IMAGE_HEADER_HEADS_X_CALIBRATION          "X Calibration"
00049 #define IMAGE_HEADER_HEADS_Y_CALIBRATION          "Y Calibration"
00050 #define IMAGE_HEADER_HEADS_Z_CALIBRATION          "Z Calibration"
00051 
00052 /***********************************************************************
00053 *
00054 *       WSxM_HEADER structure
00055 *
00056 *       This is the structure we will use to represent a header of a WSxM
00057 *       It will have three strings representing each value in the header
00058 *
00059 *       - The title will indicate the group of values this value is included
00060 *       in the header
00061 *
00062 *       - The label will precisate what is the value for
00063 *
00064 *       - The value will be an ASCII representation of the value
00065 *
00066 *       In the structure we can find too the total number of fields in the
00067 *       structure
00068 *
00069 ***********************************************************************/
00070 
00071 typedef struct typeHeader
00072 {
00073         char **tszTitles;
00074         char **tszLabels;
00075         char **tszValues;
00076 
00077         int iNumFields;
00078 } WSxM_HEADER;
00079 
00080 /* Initialization of the header */
00081 
00082 void HeaderInit (WSxM_HEADER *pHeader);
00083 
00084 /* Header file input/output */
00085 
00086 /* Header read */
00087 
00088 int HeaderRead (WSxM_HEADER *pHeader, FILE *pFile);
00089 
00090 /* Header write */
00091 
00092 int HeaderWrite (WSxM_HEADER *pHeader, FILE *pFile);
00093 
00094 /* Header access to one field */
00095 
00096 /* Read */
00097 
00098 double HeaderGetAsNumber(WSxM_HEADER *pHeader, char *szTitle, char *szLabel);
00099 int HeaderGetAsString(WSxM_HEADER *pHeader, char *szTitle, char *szLabel, char *szValue);
00100 void HeaderReadTitle (char *szLine, char *szTitle);
00101 void HeaderReadLabel (char *szLine, char *szLabel);
00102 void HeaderReadValue (char *szLine, char *szValue);
00103 
00104 /* Write */
00105 
00106 void HeaderSetAsFloating(WSxM_HEADER *pHeader, char *szTitle, char *szLabel, double lfValue);
00107 void HeaderSetAsInt(WSxM_HEADER *pHeader, char *szTitle, char *szLabel, int iValue);
00108 void HeaderSetAsString(WSxM_HEADER *pHeader, char *szTitle, char *szLabel, char *szValue);
00109 
00110 /* Header destroy */
00111 
00112 void HeaderDestroy (WSxM_HEADER *pHeader);
00113 
00114 /* Internally used functions */
00115 
00116 int HeaderReadLine (WSxM_HEADER *pHeader,FILE *pFile);
00117 int HeaderGetSize (WSxM_HEADER *pHeader);
00118 int HeaderAddValue (WSxM_HEADER *pHeader, char *szTitle, char *szLabel,char *szValue);
00119 
00120 void RemoveLeftAndRightWhitesFromString (char *szString);
00121 void ReplaceStringInString (char *szDest, const char *szOld, const char *szNew);

Generated on Sat Apr 1 09:04:28 2006 for GXSM by  doxygen 1.4.6