mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 03:21:49 +00:00
Added graphics/ImageData class
This commit is contained in:
parent
a91fbe7166
commit
ffd3e3f852
9 changed files with 110 additions and 61 deletions
37
src/graphics/ImageData.h
Normal file
37
src/graphics/ImageData.h
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
#ifndef GRAPHICS_IMAGE_DATA_H_
|
||||
#define GRAPHICS_IMAGE_DATA_H_
|
||||
|
||||
#include "../typedefs.h"
|
||||
|
||||
enum class ImageFormat {
|
||||
rgb888,
|
||||
rgba8888
|
||||
};
|
||||
|
||||
class ImageData {
|
||||
ImageFormat format;
|
||||
uint width;
|
||||
uint height;
|
||||
void* data;
|
||||
public:
|
||||
ImageData(ImageFormat format, uint width, uint height, void* data);
|
||||
~ImageData();
|
||||
|
||||
void* getData() const {
|
||||
return data;
|
||||
}
|
||||
|
||||
ImageFormat getFormat() const {
|
||||
return format;
|
||||
}
|
||||
|
||||
uint getWidth() const {
|
||||
return width;
|
||||
}
|
||||
|
||||
uint getHeight() const {
|
||||
return height;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // GRAPHICS_IMAGE_DATA_H_
|
||||
Loading…
Add table
Add a link
Reference in a new issue