| 932 | } |
| 933 | |
| 934 | std::vector<uint8_t> CompressDXT3(const uint8_t* rgba, int width, int height) |
| 935 | { |
| 936 | size_t sz = CompressedSize(width, height, false); |
| 937 | std::vector<uint8_t> out(sz); |
| 938 | int bw = (width + 3) / 4; |
| 939 | int bh = (height + 3) / 4; |
| 940 | auto* dst = reinterpret_cast<DXTBlock128*>(out.data()); |
| 941 | |
| 942 | for (int by = 0; by < bh; ++by) |
| 943 | { |
| 944 | for (int bx = 0; bx < bw; ++bx) |
| 945 | { |
| 946 | DWORD pixels[16]; |
| 947 | extractBlockARGB(rgba, width, height, bx, by, pixels); |
| 948 | CompressDXT1Block(dst->color, pixels, true); |
| 949 | CompressDXTABlock(dst->alphaExp, pixels); |
| 950 | dst++; |
| 951 | } |
| 952 | } |
| 953 | return out; |
| 954 | } |
| 955 | |
| 956 | std::vector<uint8_t> CompressDXT5(const uint8_t* rgba, int width, int height) |
| 957 | { |
no test coverage detected