HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ImfHuf.h
Go to the documentation of this file.
1 //
2 // SPDX-License-Identifier: BSD-3-Clause
3 // Copyright (c) Contributors to the OpenEXR Project.
4 //
5 
6 #ifndef INCLUDED_IMF_HUF_H
7 #define INCLUDED_IMF_HUF_H
8 
9 #include "ImfExport.h"
10 #include "ImfNamespace.h"
11 
12 //-----------------------------------------------------------------------------
13 //
14 // 16-bit Huffman compression and decompression:
15 //
16 // hufCompress (r, nr, c)
17 //
18 // Compresses the contents of array r (of length nr),
19 // stores the compressed data in array c, and returns
20 // the size of the compressed data (in bytes).
21 //
22 // To avoid buffer overflows, the size of array c should
23 // be at least 2 * nr + 65536.
24 //
25 // hufUncompress (c, nc, r, nr)
26 //
27 // Uncompresses the data in array c (with length nc),
28 // and stores the results in array r (with length nr).
29 //
30 //-----------------------------------------------------------------------------
31 
33 
35 int hufCompress (
36  const unsigned short raw[/*nRaw*/],
37  int nRaw,
38  char compressed[/*2 * nRaw + 65536*/]);
39 
41 void hufUncompress (
42  const char compressed[/*nCompressed*/],
43  int nCompressed,
44  unsigned short raw[/*nRaw*/],
45  int nRaw);
46 
48 
49 #endif
OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER IMF_EXPORT int hufCompress(const unsigned short raw[], int nRaw, char compressed[])
#define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT
Definition: ImfNamespace.h:83
IMF_EXPORT void hufUncompress(const char compressed[], int nCompressed, unsigned short raw[], int nRaw)
#define IMF_EXPORT
Definition: ImfExport.h:54
#define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER
Definition: ImfNamespace.h:80