prototype code
| 200 | |
| 201 | // prototype code |
| 202 | int CMP_CDECL CompressBlockBC4S(const char* srcBlock, unsigned int srcStrideInBytes, CMP_GLOBAL unsigned char cmpBlock[8], const void* options = NULL) |
| 203 | { |
| 204 | char inBlock[16]; |
| 205 | //---------------------------------- |
| 206 | // Fill the inBlock with source data |
| 207 | //---------------------------------- |
| 208 | CGU_INT srcpos = 0; |
| 209 | CGU_INT dstptr = 0; |
| 210 | for (CGU_UINT8 row = 0; row < 4; row++) |
| 211 | { |
| 212 | srcpos = row * srcStrideInBytes; |
| 213 | for (CGU_UINT8 col = 0; col < 4; col++) |
| 214 | { |
| 215 | inBlock[dstptr++] = CGU_INT8(srcBlock[srcpos++]); |
| 216 | } |
| 217 | } |
| 218 | |
| 219 | CMP_BC15Options* BC15options = (CMP_BC15Options*)options; |
| 220 | CMP_BC15Options BC15optionsDefault; |
| 221 | if (BC15options == NULL) |
| 222 | { |
| 223 | BC15options = &BC15optionsDefault; |
| 224 | SetDefaultBC15Options(BC15options); |
| 225 | } |
| 226 | |
| 227 | CompressBlockBC4S_SingleChannel(inBlock, (CMP_GLOBAL CGU_UINT32*)cmpBlock, BC15options); |
| 228 | return CGU_CORE_OK; |
| 229 | } |
| 230 | |
| 231 | // prototype code |
| 232 | int CMP_CDECL DecompressBlockBC4S(const unsigned char cmpBlock[8], CMP_GLOBAL char srcBlock[16], const void* options = NULL) |