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

Function saveTiffFloat

MyGUIEngine/src/msdfgen/core/save-tiff.cpp:174–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172
173template <int N>
174bool saveTiffFloat(BitmapConstSection<float, N> bitmap, const char *filename) {
175 FILE *file = fopen(filename, "wb");
176 if (!file)
177 return false;
178 bitmap.reorient(Y_DOWNWARD);
179 writeTiffHeader(file, bitmap.width, bitmap.height, N);
180 for (int y = 0; y < bitmap.height; ++y)
181 fwrite(bitmap(0, y), sizeof(float), N*bitmap.width, file);
182 return !fclose(file);
183}
184
185bool saveTiff(const BitmapConstSection<float, 1> &bitmap, const char *filename) {
186 return saveTiffFloat(bitmap, filename);

Callers 1

saveTiffFunction · 0.85

Calls 2

writeTiffHeaderFunction · 0.85
reorientMethod · 0.45

Tested by

no test coverage detected