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 
14 class ImageData {
15 public:
19  static std::unique_ptr<ImageData> load(const std::string& filename);
20 
21  virtual ~ImageData() = default;
22 
24  virtual int getWidth() const = 0;
25 
27  virtual int getHeight() const = 0;
28 
30  virtual const uint8_t* pixels() const = 0;
31 };
32 
33 } // namespace jngl
Containing the pixel data of an image file.
Definition: ImageData.hpp:14
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.
virtual int getWidth() const =0
Returns the width of the image in pixels.
virtual int getHeight() const =0
Returns the height of the image in pixels.
JNGL's main namespace.
Definition: App.hpp:10