HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
openexr_compression.h
Go to the documentation of this file.
1 /*
2 ** SPDX-License-Identifier: BSD-3-Clause
3 ** Copyright Contributors to the OpenEXR Project.
4 */
5 
6 #ifndef OPENEXR_CORE_COMPRESSION_H
7 #define OPENEXR_CORE_COMPRESSION_H
8 
9 #include "openexr_context.h"
10 
11 #include "openexr_encode.h"
12 #include "openexr_decode.h"
13 
14 #include <stddef.h>
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
20 /** @file */
21 
22 /** Computes a buffer that will be large enough to hold the compressed
23  * data. This may include some extra padding for headers / scratch */
25 size_t exr_compress_max_buffer_size (size_t in_bytes);
26 
27 /** Compresses a buffer using a zlib style compression.
28  *
29  * If the level is -1, will use the default compression set to the library
30  * \ref exr_set_default_zip_compression_level
31  * data. This may include some extra padding for headers / scratch */
35  int level,
36  const void* in,
37  size_t in_bytes,
38  void* out,
39  size_t out_bytes_avail,
40  size_t* actual_out);
41 
42 /** Decompresses a buffer using a zlib style compression. */
46  const void* in,
47  size_t in_bytes,
48  void* out,
49  size_t out_bytes_avail,
50  size_t* actual_out);
51 
52 /** Apply simple run length encoding and put in the output buffer. */
55  size_t in_bytes,
56  const void* in,
57  void* out,
58  size_t out_bytes_avail);
59 
60 /** Decode run length encoding and put in the output buffer. */
63  size_t in_bytes,
64  size_t max_len,
65  const void* in,
66  void* out);
67 
68 
69 /** Routine to query the lines required per chunk to compress with the
70  * specified method.
71  *
72  * This is only meaningful for scanline encodings, tiled
73  * representations have a different interpretation of this.
74  *
75  * These are constant values, this function returns -1 if the compression
76  * type is unknown.
77  */
80 
81 /** Exposes a method to apply compression to a chunk of data.
82  *
83  * This can be useful for inheriting default behavior of the
84  * compression stage of an encoding pipeline, or other helper classes
85  * to expose compression.
86  *
87  * NB: As implied, this function will be used during a normal encode
88  * and write operation but can be used directly with a temporary
89  * context (i.e. not running the full encode pipeline).
90  */
93 
94 /** Exposes a method to decompress a chunk of data.
95  *
96  * This can be useful for inheriting default behavior of the
97  * uncompression stage of an decoding pipeline, or other helper classes
98  * to expose compress / uncompress operations.
99  *
100  * NB: This function will be used during a normal read and decode
101  * operation but can be used directly with a temporary context (i.e.
102  * not running the full decode pipeline).
103  */
106 
107 #ifdef __cplusplus
108 } /* extern "C" */
109 #endif
110 
111 #endif /* OPENEXR_CORE_COMPRESSION_H */
EXR_EXPORT size_t exr_rle_compress_buffer(size_t in_bytes, const void *in, void *out, size_t out_bytes_avail)
EXR_EXPORT exr_result_t exr_compress_buffer(exr_const_context_t ctxt, int level, const void *in, size_t in_bytes, void *out, size_t out_bytes_avail, size_t *actual_out)
EXR_EXPORT exr_result_t exr_uncompress_chunk(exr_decode_pipeline_t *decode_state)
GLint level
Definition: glcorearb.h:108
EXR_EXPORT size_t exr_compress_max_buffer_size(size_t in_bytes)
EXR_EXPORT exr_result_t exr_compress_chunk(exr_encode_pipeline_t *encode_state)
const struct _priv_exr_context_t * exr_const_context_t
constexpr auto in(type t, int set) -> bool
Definition: core.h:611
EXR_EXPORT exr_result_t exr_uncompress_buffer(exr_const_context_t ctxt, const void *in, size_t in_bytes, void *out, size_t out_bytes_avail, size_t *actual_out)
int32_t exr_result_t
#define EXR_EXPORT
EXR_EXPORT int exr_compression_lines_per_chunk(exr_compression_t comptype)
exr_compression_t
Definition: openexr_attr.h:36
EXR_EXPORT size_t exr_rle_uncompress_buffer(size_t in_bytes, size_t max_len, const void *in, void *out)