35 lines
632 B
C++
35 lines
632 B
C++
#pragma once
|
|
#include "Size.hpp"
|
|
|
|
#include <vector>
|
|
|
|
namespace frame
|
|
{
|
|
|
|
class Image
|
|
{
|
|
uint32_t mWidth;
|
|
uint32_t mHeight;
|
|
std::vector<uint8_t> mBuffer;
|
|
|
|
public:
|
|
Image(uint32_t pWidth, uint32_t pHeight);
|
|
Image(Size size);
|
|
|
|
uint8_t& at(uint32_t x, uint32_t y);
|
|
uint8_t const& at(uint32_t x, uint32_t y) const;
|
|
|
|
auto getWidth() const
|
|
{
|
|
return mWidth;
|
|
}
|
|
auto getHeight() const
|
|
{
|
|
return mHeight;
|
|
}
|
|
|
|
private:
|
|
uint8_t toInternal(uint32_t x, uint32_t y) const;
|
|
};
|
|
|
|
} // namespace frame
|