mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-09 13:01:49 +00:00
src/graphics moved to src/graphics/core
This commit is contained in:
parent
ba762584a7
commit
b56408a202
63 changed files with 156 additions and 147 deletions
49
src/graphics/core/ImageData.h
Normal file
49
src/graphics/core/ImageData.h
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
#ifndef GRAPHICS_CORE_IMAGE_DATA_H_
|
||||
#define GRAPHICS_CORE_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);
|
||||
ImageData(ImageFormat format, uint width, uint height, void* data);
|
||||
~ImageData();
|
||||
|
||||
void flipX();
|
||||
void flipY();
|
||||
|
||||
void blitRGB_on_RGBA(const ImageData* image, int x, int y);
|
||||
void blitMatchingFormat(const ImageData* image, int x, int y);
|
||||
void blit(const ImageData* image, int x, int y);
|
||||
void extrude(int x, int y, int w, int h);
|
||||
void fixAlphaColor();
|
||||
|
||||
void* getData() const {
|
||||
return data;
|
||||
}
|
||||
|
||||
ImageFormat getFormat() const {
|
||||
return format;
|
||||
}
|
||||
|
||||
uint getWidth() const {
|
||||
return width;
|
||||
}
|
||||
|
||||
uint getHeight() const {
|
||||
return height;
|
||||
}
|
||||
};
|
||||
|
||||
extern ImageData* add_atlas_margins(ImageData* image, int grid_size);
|
||||
|
||||
#endif // GRAPHICS_CORE_IMAGE_DATA_H_
|
||||
Loading…
Add table
Add a link
Reference in a new issue