Clean image types
This commit is contained in:
parent
e7683cd94e
commit
c6d03f16d0
18 changed files with 169 additions and 107 deletions
26
src/image/ImagePrimitives.h
Normal file
26
src/image/ImagePrimitives.h
Normal file
|
@ -0,0 +1,26 @@
|
|||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
class ImagePrimitives
|
||||
{
|
||||
public:
|
||||
static void drawCheckerboard(uint8_t* data, int width, int height, int offset = 0)
|
||||
{
|
||||
auto pixels = (uint32_t *)&(data)[offset];
|
||||
for (int y = 0; y < height; ++y)
|
||||
{
|
||||
for (int x = 0; x < width; ++x)
|
||||
{
|
||||
if ((x + y / 8 * 8) % 16 < 8)
|
||||
{
|
||||
pixels[y * width + x] = 0xFF666666;
|
||||
}
|
||||
else
|
||||
{
|
||||
pixels[y * width + x] = 0xFFEEEEEE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue