mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 12:01:50 +00:00
add ImageData.drawLine
This commit is contained in:
parent
e8c6c9a7b3
commit
5bbba7f39d
3 changed files with 121 additions and 93 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include "typedefs.hpp"
|
||||
|
||||
#include <glm/vec4.hpp>
|
||||
#include <memory>
|
||||
|
||||
enum class ImageFormat {
|
||||
|
|
@ -23,6 +24,7 @@ public:
|
|||
void flipX();
|
||||
void flipY();
|
||||
|
||||
void drawLine(int x1, int y1, int x2, int y2, const glm::ivec4& color);
|
||||
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);
|
||||
|
|
@ -44,6 +46,11 @@ public:
|
|||
uint getHeight() const {
|
||||
return height;
|
||||
}
|
||||
|
||||
size_t getDataSize() const {
|
||||
size_t channels = 3 + (format == ImageFormat::rgba8888);
|
||||
return width * height * channels;
|
||||
}
|
||||
};
|
||||
|
||||
std::unique_ptr<ImageData> add_atlas_margins(ImageData* image, int grid_size);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue