Hugin trunk 0.1
Loading...
Searching...
No Matches
PGMImage.h
Go to the documentation of this file.
1/* Import from Gabor API
2
3Copyright (c) 2002-3 Adriaan Tijsseling
4
5
6 All Rights Reserved
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
20*/
21
22/*
23 Description: class for reading and storing pgm images
24 Author: Adriaan Tijsseling ( AGT )
25 Copyright: ( c ) Copyright 2002-3 Adriaan Tijsseling. All rights reserved.
26*/
27
28#ifndef __PGM_IMAGE_CLASS__
29#define __PGM_IMAGE_CLASS__
30
31#include "ImageFile.h"
32#include <cstring>
33
34namespace celeste
35{
36class PGMImage : public ImageFile
37{
38public:
39
41 explicit PGMImage( char* file ) { Read( file ); }
42 virtual ~PGMImage(){};
43
44 // Read a PGM image from a file
45 int Read( char* );
46
47 // Write a PGM image in a file
48 void Write( char* );
49 void Write( char*, float**, int, int );
50 void Write( char*, float***, int, int );
51 void Write( char*, float**, int, int, int );
52 void WriteScaled( char* filename, float** output, int height, int width );
53
54private:
55 char mMagicNumber[2];
56 int mNumPixels; // Total number of pixels (mHeight x mWidth)
59};
60}; //namespace
61#endif // __PGM_IMAGE_CLASS__
void Write(char *)
Definition PGMImage.cpp:190
void WriteScaled(char *filename, float **output, int height, int width)
Definition PGMImage.cpp:334
int Read(char *)
Definition PGMImage.cpp:34
char mMagicNumber[2]
Definition PGMImage.h:55
PGMImage(char *file)
Definition PGMImage.h:41
virtual ~PGMImage()
Definition PGMImage.h:42
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.
Definition threshold.h:41