00001 /*---------------------------------------------------------------------+ 00002 | Library QgarLib, graphics analysis and recognition | 00003 | Copyright (C) 2002 Qgar Project, LORIA | 00004 | | 00005 | This library is free software; you can redistribute it and/or | 00006 | modify it under the terms of the GNU Lesser General Public | 00007 | License version 2.1, as published by the Free Software Foundation. | 00008 | | 00009 | This library is distributed in the hope that it will be useful, | 00010 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 00011 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 00012 | See the GNU Lesser General Public License for more details. | 00013 | | 00014 | The GNU Lesser General Public License is included in the file | 00015 | LICENSE.LGPL, in the root directory of the Qgar packaging. See | 00016 | http://www.gnu.org/licenses/lgpl.html for the terms of the licence. | 00017 | To receive a paper copy, write to the Free Software Foundation, | 00018 | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. | 00019 | | 00020 | Contact Project Qgar for any information: | 00021 | LORIA - équipe Qgar | 00022 | B.P. 239, 54506 Vandoeuvre-lès-Nancy Cedex, France | 00023 | email: qgar-contact@loria.fr | 00024 | http://www.qgar.org/ | 00025 *---------------------------------------------------------------------*/ 00026 00027 00028 #ifndef __MAPLEFILE_H_INCLUDED__ 00029 #define __MAPLEFILE_H_INCLUDED__ 00030 00031 00032 /** 00033 * @file MapleFile.H 00034 * @brief Header file of class qgar::MapleFile. 00035 * 00036 * @author <a href="mailto:qgar-develop@loria.fr?subject=Qgar fwd Karl Tombre">Karl Tombre</a> 00037 * @date Jul, 3 2001 9:23 00038 * @since Qgar 1.0 00039 */ 00040 00041 00042 // For RCS/CVS use: Do not delete 00043 /* $Id: MapleFile.H,v 1.15 2005/07/13 16:29:01 masini Exp $ */ 00044 00045 00046 00047 // QGAR 00048 #include <qgarlib/AbstractFile.H> 00049 #include <qgarlib/GenImage.H> 00050 namespace qgar 00051 { 00052 // Avoid #include's when not necessary 00053 class Histogram; 00054 } 00055 00056 00057 namespace qgar 00058 { 00059 00060 00061 /** 00062 * @class MapleFile MapleFile.H "qgarlib/MapleFile.H" 00063 * @ingroup IO_FILE 00064 * 00065 * @brief File containing a Maple program. 00066 * 00067 * @warning Using default destructor. 00068 * 00069 * @todo No function to read a Maple file (except MapleFile::readHeader, 00070 * that is a pure virtual function and <i>must</i> be implemented). 00071 * 00072 * @author <a href="mailto:qgar-develop@loria.fr?subject=Qgar fwd Karl Tombre">Karl Tombre</a> 00073 * @date Jul, 3 2001 9:23 00074 * @since Qgar 1.0 00075 */ 00076 class MapleFile 00077 00078 : public AbstractFile 00079 00080 { 00081 // ------------------------------------------------------------------- 00082 // P U B L I C M E M B E R S 00083 // ------------------------------------------------------------------- 00084 public: 00085 00086 /** @name Constructors */ 00087 // ============ 00088 //@{ 00089 00090 /** 00091 * @brief Initialize from a grey-level image. 00092 * 00093 * The file is open in <b>write-only</b> mode. 00094 * It includes the code to draw the surface of the grey-level 00095 * image <b>aGlvmg</b>. The axes of the resulting image are set so as to put 00096 * the surface in the same reference frame as the image is when it is 00097 * displayed. To visualize the corresponding surface, load the resulting file 00098 * using Maple command <b>read</b>. 00099 * 00100 * @param aFileName name of the file 00101 * @param aGlvImg a grey-level image 00102 * @param aTesselation sampling rate in the image (default 1) 00103 */ 00104 MapleFile(char* aFileName, 00105 GreyLevelImage& aGlvImg, 00106 int aTesselation = 1); 00107 00108 /** 00109 * @brief Initialize from a float image. 00110 * 00111 * The file is open in <b>write-only</b> mode. 00112 * It includes the code to draw the surface of the float 00113 * image <b>aGlvmg</b>. The axes of the resulting image are set so as to put 00114 * the surface in the same reference frame as the image is when it is 00115 * displayed. To visualize the corresponding surface, load the resulting file 00116 * using Maple command <b>read</b>. 00117 * 00118 * @param aFileName name of the file 00119 * @param aFloatImg the float image to initialize this instance from 00120 * @param aTesselation sampling rate in the image (default 1) 00121 */ 00122 MapleFile(char* aFileName, 00123 FloatImage& aFloatImg, 00124 int aTesselation = 1); 00125 00126 /** 00127 * @brief Initialize from a histogram. 00128 * 00129 * The file is open in <b>write-only</b> mode. 00130 * It includes the code to draw the histogram as a curve. 00131 * image <b>aGlvmg</b>. To visualize the corresponding surface, load the 00132 * resulting file using Maple command <b>read</b>. 00133 * 00134 * @param aFileName name of the file 00135 * @param aHistogram a histogram 00136 */ 00137 MapleFile(char* aFileName, Histogram& aHistogram); 00138 00139 //@} 00140 00141 00142 /** @name Destructor */ 00143 // ========== 00144 //@{ 00145 00146 /** 00147 * @brief Virtual destructor. 00148 */ 00149 virtual ~MapleFile(); 00150 00151 //@} 00152 00153 00154 // ------------------------------------------------------------------- 00155 // P R O T E C T E D M E M B E R S 00156 // ------------------------------------------------------------------- 00157 protected: 00158 00159 /** @name Input */ 00160 // ===== 00161 //@{ 00162 00163 /** 00164 * @brief Read file header. 00165 */ 00166 virtual void readHeader(); 00167 00168 //@} 00169 00170 00171 /** @name Output */ 00172 // ====== 00173 //@{ 00174 00175 /** 00176 * @brief Write file header. 00177 */ 00178 virtual void writeHeader(); 00179 00180 /** 00181 * @brief Write file footer. 00182 */ 00183 virtual void writeFooter(); 00184 00185 //@} 00186 00187 // ------------------------------------------------------------------- 00188 }; // class MapleFile 00189 00190 00191 } // namespace qgar 00192 00193 #endif /* __MAPLEFILE_H_INCLUDED__ */