COGS
Computer Graphics Structures library
Image.h
1 #ifndef COGS_IMAGE_H
2 #define COGS_IMAGE_H
3 
4 #include <string>
5 #include <COGS/Color.h>
6 #include <COGS/Grid.h>
7 
8 namespace cogs
9 {
10  class COGS_API Image
11  {
12  public:
13  Image() = default;
14  explicit Image(const std::string &file_path);
15  explicit Image(uint16_t width, uint16_t height);
16 
17  uint16_t GetWidth() const;
18  uint16_t GetHeight() const;
19 
20  void LoadFromFile(const std::string &file_path);
21  void SaveToFile(const std::string &file_path);
22 
23  const cogs::Color4b GetColorAt(const glm::vec2 &uv) const;
24 
25  const cogs::Color4b GetPixel(int32_t x, int32_t y) const;
26 
27  void SetPixel(int32_t x, int32_t y, const cogs::Color3b &color);
28 
29  private:
30  std::vector<cogs::Color4b> pixels_;
31  int32_t width_;
32  int32_t height_;
33  int32_t bpp_;
34  };
35 }
36 
37 #endif /* !COGS_IMAGE_H */
Namespace of "Computer Graphic Structures" library, which implement many core classes and structures...
Definition: AabbHierarchy.h:8
Holds three color channels in uint8 format in range 0-255.
Definition: Color.h:21
Holds four color channels in uint8 format in range 0-255.
Definition: Color.h:39