MCPcopy Create free account
hub / github.com/MyGUI/mygui / writeBinBitmapFloatBE

Function writeBinBitmapFloatBE

MyGUIEngine/src/msdfgen/main.cpp:246–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

244static bool writeBinBitmapFloat(FILE *file, const float *values, int cols, int rows, int rowStride)
245#else
246static 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
261static 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)

Callers 1

writeOutputFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected