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

#include <PortableBitmapReader.h>

Public Member Functions

 PortableBitmapReader (const std::string &input)
 
unsigned int getWidth () const
 
unsigned int getHeight () const
 
bool isBlack (unsigned int i, unsigned int j) const
 
std::vector< bool > 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
 
FileType type_m
 
std::vector< bool > pixels_m
 

Detailed Description

Definition at line 10 of file PortableBitmapReader.h.

Member Enumeration Documentation

◆ FileType

Enumerator
ASCII 
BINARY 

Definition at line 32 of file PortableBitmapReader.h.

Constructor & Destructor Documentation

◆ PortableBitmapReader()

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

Definition at line 8 of file PortableBitmapReader.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

◆ getHeight()

unsigned int PortableBitmapReader::getHeight ( ) const
inline

Definition at line 48 of file PortableBitmapReader.h.

References height_m.

Referenced by mslang::Mask::parse_detail().

◆ getIdx()

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

Definition at line 63 of file PortableBitmapReader.h.

References height_m, and width_m.

Referenced by isBlack(), and print().

◆ getNextPart()

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

Definition at line 21 of file PortableBitmapReader.cpp.

References Physics::c.

Referenced by readHeader().

◆ getPixels()

std::vector< bool > PortableBitmapReader::getPixels ( ) const
inline

Definition at line 58 of file PortableBitmapReader.h.

References pixels_m.

Referenced by mslang::Mask::parse_detail().

◆ getWidth()

unsigned int PortableBitmapReader::getWidth ( ) const
inline

Definition at line 43 of file PortableBitmapReader.h.

References width_m.

Referenced by mslang::Mask::parse_detail().

◆ isBlack()

bool PortableBitmapReader::isBlack ( unsigned int  i,
unsigned int  j 
) const
inline

Definition at line 53 of file PortableBitmapReader.h.

References getIdx(), and pixels_m.

Here is the call graph for this function:

◆ print()

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

Definition at line 109 of file PortableBitmapReader.cpp.

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

Here is the call graph for this function:

◆ readHeader()

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

Definition at line 43 of file PortableBitmapReader.cpp.

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

Referenced by PortableBitmapReader().

Here is the call graph for this function:

◆ readImageAscii()

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

Definition at line 73 of file PortableBitmapReader.cpp.

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

Referenced by PortableBitmapReader().

◆ readImageBinary()

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

Definition at line 90 of file PortableBitmapReader.cpp.

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

Referenced by PortableBitmapReader().

Member Data Documentation

◆ height_m

unsigned int PortableBitmapReader::height_m
private

◆ pixels_m

std::vector<bool> PortableBitmapReader::pixels_m
private

◆ type_m

FileType PortableBitmapReader::type_m
private

Definition at line 37 of file PortableBitmapReader.h.

Referenced by PortableBitmapReader(), and readHeader().

◆ width_m

unsigned int PortableBitmapReader::width_m
private

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