SyB3R - Synthetic Benchmark for 3D Reconstruction
RasterImage.h
Go to the documentation of this file.
1 
5 #ifndef RASTERIMAGE_H
6 #define RASTERIMAGE_H
7 
8 #include <vector>
9 #include <stdint.h>
10 
11 
17 {
18  public:
19  RasterImage(unsigned w, unsigned h);
20  RasterImage();
21  ~RasterImage();
22 
23  void resize(unsigned w, unsigned h);
24 
25  void clear(uint32_t color);
26 
27  void writeToFile(const char *filename, unsigned quality = 100);
28  void loadFromFile(const char *filename);
29  static void getImageFileDimensions(const char *filename, unsigned &width, unsigned &height);
30 
31  void flipTopBottom();
32 /*
33  void drawLine(const LinAlg::Vector2i &p1, const LinAlg::Vector2i &p2, uint32_t color);
34  void drawHLine(int x1, int x2, int y, uint32_t color);
35  void drawVLine(int x, int y1, int y2, uint32_t color);
36  void drawBox(const LinAlg::Vector2i &p1, const LinAlg::Vector2i &p2, uint32_t color, bool fill);
37  void drawCircle(const LinAlg::Vector2i &center, unsigned radius, uint32_t color);
38  void drawFilledCircle(const LinAlg::Vector2i &center, unsigned radius, uint32_t color);
39 */
40  void mergeSideBySide(const RasterImage &left, const RasterImage &right, uint32_t clearColor);
41  void mergeOnTopOfEachOther(const RasterImage &left, const RasterImage &right, uint32_t clearColor);
42 
43  uint32_t *getData() { return &m_pixelData[0]; }
44  const uint32_t *getData() const { return &m_pixelData[0]; }
45 
46 
47  unsigned getWidth() const { return m_width; }
48  unsigned getHeight() const { return m_height; }
49  protected:
50  std::vector<uint32_t> m_pixelData;
51  unsigned m_width;
52  unsigned m_height;
53 
54 };
55 
61 #endif // RASTERIMAGE_H
Definition: RasterImage.h:16