OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
PortableGraymapReader Class Reference

#include <PortableGraymapReader.h>

Public Member Functions

 PortableGraymapReader (const std::string &input)
 
unsigned int getWidth () const
 
unsigned int getHeight () const
 
unsigned short getPixel (unsigned int i, unsigned int j) const
 
std::vector< unsigned short > getPixels () const
 
void print (std::ostream &out) const
 

Private Types

enum  FileType { ASCII, BINARY }
 

Private Member Functions

void readHeader (std::istream &in)
 
void readImageAscii (std::istream &in)
 
void readImageBinary (std::istream &in)
 
std::string getNextPart (std::istream &in)
 
unsigned int getIdx (unsigned int h, unsigned int w) const
 

Private Attributes

unsigned int width_m
 
unsigned int height_m
 
unsigned short depth_m
 
FileType type_m
 
std::vector< unsigned short > pixels_m
 

Detailed Description

Definition at line 10 of file PortableGraymapReader.h.

Member Enumeration Documentation

Enumerator
ASCII 
BINARY 

Definition at line 33 of file PortableGraymapReader.h.

Constructor & Destructor Documentation

PortableGraymapReader::PortableGraymapReader ( const std::string &  input)

Definition at line 9 of file PortableGraymapReader.cpp.

References ASCII, height_m, pixels_m, readHeader(), readImageAscii(), readImageBinary(), type_m, and width_m.

Here is the call graph for this function:

Member Function Documentation

unsigned int PortableGraymapReader::getHeight ( ) const
inline

Definition at line 49 of file PortableGraymapReader.h.

References height_m.

Referenced by LaserProfile::readPGMFile().

unsigned int PortableGraymapReader::getIdx ( unsigned int  h,
unsigned int  w 
) const
inlineprivate

Definition at line 64 of file PortableGraymapReader.h.

References height_m, and width_m.

Referenced by getPixel(), and print().

std::string PortableGraymapReader::getNextPart ( std::istream &  in)
private

Definition at line 22 of file PortableGraymapReader.cpp.

References Physics::c.

Referenced by readHeader().

unsigned short PortableGraymapReader::getPixel ( unsigned int  i,
unsigned int  j 
) const
inline

Definition at line 54 of file PortableGraymapReader.h.

References getIdx(), and pixels_m.

Referenced by LaserProfile::readPGMFile().

Here is the call graph for this function:

std::vector< unsigned short > PortableGraymapReader::getPixels ( ) const
inline

Definition at line 59 of file PortableGraymapReader.h.

References pixels_m.

unsigned int PortableGraymapReader::getWidth ( ) const
inline

Definition at line 44 of file PortableGraymapReader.h.

References width_m.

Referenced by LaserProfile::readPGMFile().

void PortableGraymapReader::print ( std::ostream &  out) const

Definition at line 116 of file PortableGraymapReader.cpp.

References endl(), getIdx(), height_m, pixels_m, and width_m.

Here is the call graph for this function:

void PortableGraymapReader::readHeader ( std::istream &  in)
private

Definition at line 45 of file PortableGraymapReader.cpp.

References ASCII, BINARY, depth_m, getNextPart(), height_m, type_m, and width_m.

Referenced by PortableGraymapReader().

Here is the call graph for this function:

void PortableGraymapReader::readImageAscii ( std::istream &  in)
private

Definition at line 82 of file PortableGraymapReader.cpp.

References Physics::c, height_m, pixels_m, and width_m.

Referenced by PortableGraymapReader().

void PortableGraymapReader::readImageBinary ( std::istream &  in)
private

Definition at line 94 of file PortableGraymapReader.cpp.

References Physics::c, depth_m, height_m, pixels_m, and width_m.

Referenced by PortableGraymapReader().

Member Data Documentation

unsigned short PortableGraymapReader::depth_m
private

Definition at line 31 of file PortableGraymapReader.h.

Referenced by readHeader(), and readImageBinary().

unsigned int PortableGraymapReader::height_m
private
std::vector<unsigned short> PortableGraymapReader::pixels_m
private
FileType PortableGraymapReader::type_m
private

Definition at line 38 of file PortableGraymapReader.h.

Referenced by PortableGraymapReader(), and readHeader().

unsigned int PortableGraymapReader::width_m
private

The documentation for this class was generated from the following files: