compressed_io.h
1/***************************************************************************
2 *
3 * Copyright (C) 1999 by Willem van Straten
4 * Licensed under the Academic Free License version 2.1
5 *
6 ***************************************************************************/
7#include <stdio.h>
8#include <vector>
9
10// ///////////////////////////////////////////////////////////////////////
11// fwrite_compressed
12// writes out a vector of floats to file as an array of unsigned short
13// writes:
14// float offset;
15// float ratio;
16// float nelements;
17// unsigned short elements [nelements];
18// where:
19// vals[N] = offset + elements[N] * ratio;
20
21int fwrite_compressed (FILE* fptr, const std::vector<float>& vals);
22
23// ///////////////////////////////////////////////////////////////////////
24// fread_compressed
25// reads in a vector of floats written by the above function...
26// set 'swapendian' to true if the file was written on a machine of
27// opposite endian.
28int fread_compressed (FILE* fptr, std::vector<float>* vals,
29 bool swapendian=false);

Generated using doxygen 1.14.0