add: image
This commit is contained in:
35
frame/src/Image.hpp
Normal file
35
frame/src/Image.hpp
Normal file
@@ -0,0 +1,35 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user