The Machine Perception Toolbox

[Introduction]- [News]- [Download]- [Screenshots]- [Manual (pdf)]- [Forums]- [API Reference]- [Repository ]

 

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

MPFileIO Class Reference

#include <io.h>

Inheritance diagram for MPFileIO:

Inheritance graph
[legend]
Collaboration diagram for MPFileIO:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MPFileIO (char *fname)
void write (const char *s)
void write (const char &ch)
void write (const double &d)
void write (const int &i)
void writePGM (float *img, const char *filename, const int &width, const int &height)
 ~MPFileIO ()

Private Attributes

std::ofstream os

Constructor & Destructor Documentation

MPFileIO char *  fname  )  [inline]
 

Definition at line 38 of file io.h.

References fname, and os.

00038 : os(fname, std::ios::app) {};

~MPFileIO  )  [inline]
 

Definition at line 39 of file io.h.

References os.

00039 { os.close(); };


Member Function Documentation

void write const char *  s  ) 
 

Definition at line 39 of file fileio.cpp.

References os, and s.

00039                                   {
00040         os << s << "|" << flush;
00041 }

void write const char &  ch  )  [virtual]
 

Implements MPIO.

Definition at line 27 of file fileio.cpp.

References os.

00027                                    {
00028         os << ch << "|" << flush;
00029 }

void write const double &  d  )  [virtual]
 

Implements MPIO.

Definition at line 33 of file fileio.cpp.

References d, and os.

00033                                     {
00034         os << d << "|" << flush;
00035 }

void write const int &  i  )  [virtual]
 

Implements MPIO.

Definition at line 21 of file fileio.cpp.

References i, and os.

00021                                  {
00022         os << i << "|" << flush;
00023 }

void writePGM float *  img,
const char *  filename,
const int &  width,
const int &  height
 

Definition at line 45 of file fileio.cpp.

References f(), i, and img.

00045                                                                                              {
00046         ofstream f(filename);
00047         f << "P2" << endl << width << " " << height << endl << "255" << endl << flush;
00048         for (int i = 0; i < width*height; ++i)
00049                 f << (int)(img[i]*255.0 +.5) << " " << flush;
00050         f.close();
00051 }

Here is the call graph for this function:


Member Data Documentation

std::ofstream os [private]
 

Definition at line 35 of file io.h.

Referenced by MPFileIO(), write(), and ~MPFileIO().


The documentation for this class was generated from the following files:
Generated on Mon Nov 8 17:08:36 2004 for MPT by  doxygen 1.3.9.1