| 244 | static bool writeBinBitmapFloat(FILE *file, const float *values, int cols, int rows, int rowStride) |
| 245 | #else |
| 246 | static bool writeBinBitmapFloatBE(FILE *file, const float *values, int cols, int rows, int rowStride) |
| 247 | #endif |
| 248 | { |
| 249 | for (int row = 0; row < rows; ++row) { |
| 250 | const float *cur = values; |
| 251 | for (int col = 0; col < cols; ++col) { |
| 252 | const unsigned char *b = reinterpret_cast<const unsigned char *>(cur++); |
| 253 | for (int i = int(sizeof(float)); i--;) |
| 254 | fwrite(b+i, 1, 1, file); |
| 255 | } |
| 256 | values += rowStride; |
| 257 | } |
| 258 | return true; |
| 259 | } |
| 260 | |
| 261 | static bool cmpExtension(const char *path, const char *ext) { |
| 262 | for (const char *a = path+strlen(path)-1, *b = ext+strlen(ext)-1; b >= ext; --a, --b) |