| 172 | |
| 173 | template <int N> |
| 174 | bool 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 | |
| 185 | bool saveTiff(const BitmapConstSection<float, 1> &bitmap, const char *filename) { |
| 186 | return saveTiffFloat(bitmap, filename); |
no test coverage detected