ImageMono.hpp
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <etk/types.hpp>
9 #include <etk/math/Vector2D.hpp>
10 #include <etk/Color.hpp>
11 
12 #include <vector>
13 
14 namespace egami {
15  class ImageMono {
16  private:
17  ivec2 m_size;
18  std::vector<uint8_t> m_data;
19  public:
20  // constructor :
21  ImageMono(const ivec2& _size=ivec2(32,32));
22  // destructor
23  ~ImageMono() { };
24  // EWOL internal API for Texture system :
25  public:
26  void* getTextureDataPointer() {
27  return &m_data[0];
28  };
29  /*
30  enum colorType getType() {
31  return egami::colorType::unsignedInt8;
32  };
33  */
34  // -----------------------------------------------
35  // -- basic tools :
36  // -----------------------------------------------
37  public :
38  void resize(const ivec2& _size, const ivec2& _startPos=ivec2(0,0));
39  void resize(const ivec2& _size, const uint8_t& _color);
40 
41  const ivec2& getSize() const {
42  return m_size;
43  };
44  int32_t getWidth() const {
45  return m_size.x();
46  };
47  int32_t getHeight() const {
48  return m_size.y();
49  };
50  void clear(uint8_t _fill);
51  const uint8_t& get(const ivec2& _pos) const;
52  void set(const ivec2& _pos, const uint8_t& _newColor);
53  };
54 }
55 
const T & x() const
Definition: debug.hpp:10
Definition: ImageMono.hpp:15
const T & y() const