| 243 | } |
| 244 | |
| 245 | int CMP_CDECL CompressBlockBC4(const unsigned char* srcBlock, unsigned int srcStrideInBytes, CMP_GLOBAL unsigned char cmpBlock[8], const void* options = NULL) |
| 246 | { |
| 247 | CMP_BC15Options* BC15options = (CMP_BC15Options*)options; |
| 248 | CMP_BC15Options BC15optionsDefault; |
| 249 | if (BC15options == NULL) |
| 250 | { |
| 251 | BC15options = &BC15optionsDefault; |
| 252 | SetDefaultBC15Options(BC15options); |
| 253 | } |
| 254 | |
| 255 | unsigned char inBlock[16]; |
| 256 | //---------------------------------- |
| 257 | // Fill the inBlock with source data |
| 258 | //---------------------------------- |
| 259 | CGU_INT srcpos = 0; |
| 260 | CGU_INT dstptr = 0; |
| 261 | for (CGU_UINT8 row = 0; row < 4; row++) |
| 262 | { |
| 263 | srcpos = row * srcStrideInBytes; |
| 264 | for (CGU_UINT8 col = 0; col < 4; col++) |
| 265 | { |
| 266 | inBlock[dstptr++] = CGU_UINT8(srcBlock[srcpos++]); |
| 267 | } |
| 268 | } |
| 269 | |
| 270 | CompressBlockBC4_SingleChannel(inBlock, (CMP_GLOBAL CGU_UINT32*)cmpBlock, BC15options); |
| 271 | return CGU_CORE_OK; |
| 272 | } |
| 273 | |
| 274 | int CMP_CDECL DecompressBlockBC4(const unsigned char cmpBlock[8], CMP_GLOBAL unsigned char srcBlock[16], const void* options = NULL) |
| 275 | { |