Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

ImageIO.h

Go to the documentation of this file.
00001 /*
00002  * @(#)vImageIO.h  1.0  2002-08-27 13:35
00003  *
00004  * Copyright (C)  2002  Daniel Léonard
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (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 
00026 #ifndef _IMAGEIO_H_
00027 #define _IMAGEIO_H_
00028 
00029 #include <exception>
00030 #include <string>
00031 #include "Image.h"
00032 
00033 class std::istream;
00034 class std::ostream;
00035 
00036 namespace halftoner
00037 {
00038 
00039 //---------------------------
00040 // Class ImageFormatError
00041 //---------------------------
00042 
00046    class ImageFormatError : public std::runtime_error
00047    {
00048       public:
00053          ImageFormatError(const std::string& message) : std::runtime_error(message) {}
00054    };
00055 
00056 
00057 //---------------------------
00058 // Class IOError
00059 //---------------------------
00060 
00064    class IOError : public std::runtime_error
00065    {
00066       public:
00071          IOError(const std::string& message): runtime_error(message) {}
00072    };
00073 
00074 
00075 //---------------------------
00076 // Class ImageIO
00077 //---------------------------
00078 
00084    class ImageIO
00085    {
00086       private:
00089 
00092          ImageIO() throw();
00093 
00097          ImageIO(const ImageIO&) throw();
00098 
00102          ImageIO operator=(const ImageIO&) throw();
00104 
00105       public:
00107          ~ImageIO() throw();
00108 
00111 
00120          static Image* loadPGM(std::istream& is) throw(ImageFormatError, IOError);
00121 
00130          static void savePBMraw(const Image& image, std::ostream& os) throw(IOError);
00131 
00139          static void savePBMascii(const Image& image, std::ostream& os) throw(IOError);
00141    };
00142 
00143 }
00144 
00145 #endif   /* ifndef _IMAGEIO_H_ */

Generated on Sat Sep 7 16:31:39 2002 for Halftoning Library by doxygen1.2.17