OpenBF1942-Plus
Refractor 1, rebuilt from scratch
Loading...
Searching...
No Matches
dds.h
Go to the documentation of this file.
1// Textures (public formats): DDS DXT1/DXT3/DXT5 top mip, uncompressed TGA. Output RGBA8, top row first.
2#pragma once
3#include <cstdint>
4#include <string>
5#include <vector>
6
7namespace obf {
8
9struct Image {
10 int w = 0, h = 0;
11 std::vector<uint8_t> rgba;
12};
13
14void dxt1_block(const uint8_t* block, uint8_t out[16][4]);
15Image dds_decode(const std::vector<uint8_t>& file); // throws on unsupported formats
16Image tga_decode(const std::vector<uint8_t>& file); // type 2 (24/32 bit), type 1 (8-bit, 24/32-bit palette), type 3 (8-bit gray)
17
18} // namespace obf
Definition anim.cpp:7
Image tga_decode(const std::vector< uint8_t > &d)
Definition dds.cpp:74
Image dds_decode(const std::vector< uint8_t > &d)
Definition dds.cpp:46
void dxt1_block(const uint8_t *b, uint8_t out[16][4])
Definition dds.cpp:31
Definition dds.h:9
int w
Definition dds.h:10
std::vector< uint8_t > rgba
Definition dds.h:11
int h
Definition dds.h:10