| 911 | } |
| 912 | |
| 913 | std::vector<uint8_t> CompressDXT1(const uint8_t* rgba, int width, int height) |
| 914 | { |
| 915 | size_t sz = CompressedSize(width, height, true); |
| 916 | std::vector<uint8_t> out(sz); |
| 917 | int bw = (width + 3) / 4; |
| 918 | int bh = (height + 3) / 4; |
| 919 | auto* dst = reinterpret_cast<DXTBlock64*>(out.data()); |
| 920 | |
| 921 | for (int by = 0; by < bh; ++by) |
| 922 | { |
| 923 | for (int bx = 0; bx < bw; ++bx) |
| 924 | { |
| 925 | DWORD pixels[16]; |
| 926 | extractBlockARGB(rgba, width, height, bx, by, pixels); |
| 927 | CompressDXT1Block(*dst, pixels); |
| 928 | dst++; |
| 929 | } |
| 930 | } |
| 931 | return out; |
| 932 | } |
| 933 | |
| 934 | std::vector<uint8_t> CompressDXT3(const uint8_t* rgba, int width, int height) |
| 935 | { |
no test coverage detected