1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
#pragma once
#include <cstdint>
#include <vector>
#include <cstddef>
enum class TextureType {
Error,
RGBA32bpp,
RGBA16bpp,
Palette4bpp,
Palette8bpp,
Grayscale4bpp,
Grayscale8bpp,
GrayscaleAlpha4bpp,
GrayscaleAlpha8bpp,
GrayscaleAlpha16bpp,
GrayscaleAlpha1bpp,
TLUT
};
struct TextureFormat {
TextureType type;
uint32_t depth;
};
class TextureUtils {
public:
static size_t CalculateTextureSize(TextureType type, uint32_t width, uint32_t height);
static std::vector<uint8_t> alloc_ia8_text_from_i1(uint16_t *in, int16_t width, int16_t height);
};
|