JNGL
ImageData.hpp
Go to the documentation of this file.
1 // Copyright 2021 Jan Niklas Hasse <[email protected]>
2 // For conditions of distribution and use, see copyright notice in LICENSE.txt
5 #pragma once
6 
7 #include <cstddef>
8 #include <memory>
9 #include <string>
10 
11 namespace jngl {
12 
13 class ImageData {
14 public:
18  static std::unique_ptr<ImageData> load(const std::string& filename);
19 
20  virtual ~ImageData() = default;
21 
22  virtual int getWidth() const = 0;
23  virtual int getHeight() const = 0;
24 
26  virtual const uint8_t* pixels() const = 0;
27 };
28 
29 } // namespace jngl
virtual const uint8_t * pixels() const =0
RGBA values ordered row-major.
static std::unique_ptr< ImageData > load(const std::string &filename)
Passing a filename will load the specified filename.
JNGL's main namespace.
Definition: App.hpp:10