Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages
celeste/PGMImage.h
Go to the documentation of this file.00001 /* Import from Gabor API 00002 00003 Copyright (c) 2002-3 Adriaan Tijsseling 00004 00005 00006 All Rights Reserved 00007 00008 This program is free software; you can redistribute it and/or modify 00009 it under the terms of the GNU General Public License as published by 00010 the Free Software Foundation; either version 2 of the License, or 00011 (at your option) any later version. 00012 00013 This program is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 GNU General Public License for more details. 00017 00018 You should have received a copy of the GNU General Public License 00019 along with this program. If not, see <http://www.gnu.org/licenses/>. 00020 */ 00021 00022 /* 00023 Description: class for reading and storing pgm images 00024 Author: Adriaan Tijsseling ( AGT ) 00025 Copyright: ( c ) Copyright 2002-3 Adriaan Tijsseling. All rights reserved. 00026 */ 00027 00028 #ifndef __PGM_IMAGE_CLASS__ 00029 #define __PGM_IMAGE_CLASS__ 00030 00031 #include "ImageFile.h" 00032 #include <cstring> 00033 00034 class PGMImage : public ImageFile 00035 { 00036 public: 00037 00038 PGMImage(){}; 00039 PGMImage( char* file ) { Read( file ); } 00040 virtual ~PGMImage(){}; 00041 00042 // Read a PGM image from a file 00043 int Read( char* ); 00044 00045 // Write a PGM image in a file 00046 void Write( char* ); 00047 void Write( char*, float**, int, int ); 00048 void Write( char*, float***, int, int ); 00049 void Write( char*, float**, int, int, int ); 00050 void WriteScaled( char* filename, float** output, int height, int width ); 00051 00052 private: 00053 char mMagicNumber[2]; 00054 int mNumPixels; // Total number of pixels (mHeight x mWidth) 00055 int mNumLevels; 00056 int mNumBits; 00057 }; 00058 00059 #endif // __PGM_IMAGE_CLASS__
1.3.9.1