PPMIO.hpp
Go to the documentation of this file.
1 
28 /*
29  * PPMIO.h
30  *
31  * Created on: 08.09.2011
32  * Author: Kim Rinnewitz ( krinnewitz@uos.de )
33  * Modified on: 11.12.2011
34  * Author: Thomas Wiemann ( twiemann@uos.de )
35  * Modified on: 15.02.2011
36  * Author: Denis Meyer ( denmeyer@uos.de )
37  */
38 
39 #ifndef LVR2_PPMIO_HPP_
40 #define LVR2_PPMIO_HPP_
41 
42 #include <string>
43 #include <fstream>
44 #include <iostream>
45 #include <sstream>
46 
47 using std::string;
48 using std::ifstream;
49 using std::stringstream;
50 using std::cout;
51 using std::endl;
52 
53 namespace lvr2
54 {
55 
59 class PPMIO
60 {
61 public:
62  PPMIO();
63  PPMIO( string filename );
64  virtual ~PPMIO() {};
65 
66  void write( string filename );
67  void setDataArray( unsigned char* array, int width, int height );
68 
69  int getHeight() const { return m_height; }
70  int getWidth() const { return m_width; }
71  unsigned char* getPixels() const { return m_pixels; }
72 
73 private:
74  int m_width; // The width of the image
75  int m_height; // The height of the image
76  unsigned char* m_pixels; // The image/pixel data
77 
83  void readLine( ifstream & in, char* buffer );
84 };
85 
86 } // namespace lvr2
87 
88 #endif /* PPMIO_H_ */
unsigned char * m_pixels
Definition: PPMIO.hpp:76
An implementation of the PPM file format.
Definition: PPMIO.hpp:59
void readLine(ifstream &in, char *buffer)
Definition: PPMIO.cpp:150
int getHeight() const
Definition: PPMIO.hpp:69
void write(string filename)
Definition: PPMIO.cpp:129
void setDataArray(unsigned char *array, int width, int height)
Definition: PPMIO.cpp:143
int m_height
Definition: PPMIO.hpp:75
unsigned char * getPixels() const
Definition: PPMIO.hpp:71
virtual ~PPMIO()
Definition: PPMIO.hpp:64
int m_width
Definition: PPMIO.hpp:74
int getWidth() const
Definition: PPMIO.hpp:70


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Mon Feb 28 2022 22:46:08