JNGL
Easy to use cross-platform 2D game library
Loading...
Searching...
No Matches
ImageData.hpp
Go to the documentation of this file.
1// Copyright 2021 Jan Niklas Hasse <jhasse@bixense.com>
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
11namespace jngl {
12
14class ImageData {
15public:
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.
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.
static std::unique_ptr< ImageData > load(const std::string &filename)
Passing a filename will load the specified filename.
JNGL's main namespace.
Definition: Achievement.hpp:10