HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ImfCompression.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_COMPRESSION_H
7 #define INCLUDED_IMF_COMPRESSION_H
8 
9 //-----------------------------------------------------------------------------
10 //
11 // enum Compression
12 //
13 // This file enumerates available compression methods and defines a simple API
14 // to query them.
15 //
16 // ----------------------------------------------------------------------------
17 
18 #include "ImfForward.h"
19 #include <string>
20 
22 
23 // All available compression methods.
24 // NOTE: Must be extended to add a new codec. Ids must be continuous.
26 {
27  NO_COMPRESSION = 0, // no compression.
28 
29  RLE_COMPRESSION = 1, // run length encoding.
30 
31  ZIPS_COMPRESSION = 2, // zlib compression, one scan line at a time.
32 
33  ZIP_COMPRESSION = 3, // zlib compression, in blocks of 16 scan lines.
34 
35  PIZ_COMPRESSION = 4, // piz-based wavelet compression.
36 
37  PXR24_COMPRESSION = 5, // lossy 24-bit float compression
38 
39  B44_COMPRESSION = 6, // lossy 4-by-4 pixel block compression,
40  // fixed compression rate.
41 
42  B44A_COMPRESSION = 7, // lossy 4-by-4 pixel block compression,
43  // flat fields are compressed more.
44 
45  DWAA_COMPRESSION = 8, // lossy DCT based compression, in blocks
46  // of 32 scanlines. More efficient for partial
47  // buffer access.
48 
49  DWAB_COMPRESSION = 9, // lossy DCT based compression, in blocks
50  // of 256 scanlines. More efficient space
51  // wise and faster to decode full frames
52  // than DWAA_COMPRESSION.
53 
54  HTJ2K256_COMPRESSION = 10, // High-Throughput JPEG2000 (HTJ2K), 256 scanlines
55 
56  HTJ2K32_COMPRESSION = 11, // High-Throughput JPEG2000 (HTJ2K), 32 scanlines
57 
58  NUM_COMPRESSION_METHODS // number of different compression methods
59 };
60 
61 /// Returns a codec ID's short name (lowercase).
62 IMF_EXPORT void getCompressionNameFromId (Compression id, std::string& name);
63 
64 /// Returns a codec ID's short description (lowercase).
65 IMF_EXPORT void
66 getCompressionDescriptionFromId (Compression id, std::string& desc);
67 
68 /// Returns the codec name's ID, NUM_COMPRESSION_METHODS if not found.
69 IMF_EXPORT void
70 getCompressionIdFromName (const std::string& name, Compression& id);
71 
72 /// Return true if a compression id exists.
73 IMF_EXPORT bool isValidCompression (int id);
74 
75 /// Return a string enumerating all compression names, with a custom separator.
76 IMF_EXPORT void
77 getCompressionNamesString (const std::string& separator, std::string& in);
78 
79 /// Return the number of scan lines expected by a given compression method.
81 
82 /// Return true is the compression method exists and doesn't preserves data integrity.
84 
85 /// Return true is the compression method exists and supports deep data.
87 
88 /// Controls the default zip compression level used. Zip is used for
89 /// the 2 zip levels as well as some modes of the DWAA/B compression.
91 
92 /// Controls the default quality level for the DWA lossy compression
94 
96 
97 #endif
#define IMF_EXPORT_ENUM
Definition: ImfExport.h:56
ZIP_COMPRESSION
#define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT
Definition: ImfNamespace.h:83
IMF_EXPORT bool isValidCompression(int id)
Return true if a compression id exists.
OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER enum IMF_EXPORT_ENUM Compression
IMF_EXPORT void getCompressionNameFromId(Compression id, std::string &name)
Returns a codec ID's short name (lowercase).
GLint level
Definition: glcorearb.h:108
B44_COMPRESSION
IMF_EXPORT bool isLossyCompression(Compression id)
Return true is the compression method exists and doesn't preserves data integrity.
PXR24_COMPRESSION
constexpr auto in(type t, int set) -> bool
Definition: core.h:611
IMF_EXPORT void setDefaultDwaCompressionLevel(float level)
Controls the default quality level for the DWA lossy compression.
NO_COMPRESSION
DWAB_COMPRESSION
IMF_EXPORT int getCompressionNumScanlines(Compression id)
Return the number of scan lines expected by a given compression method.
PIZ_COMPRESSION
DWAA_COMPRESSION
ZIPS_COMPRESSION
IMF_EXPORT void getCompressionNamesString(const std::string &separator, std::string &in)
Return a string enumerating all compression names, with a custom separator.
#define IMF_EXPORT
Definition: ImfExport.h:54
GLuint const GLchar * name
Definition: glcorearb.h:786
B44A_COMPRESSION
IMF_EXPORT void getCompressionIdFromName(const std::string &name, Compression &id)
Returns the codec name's ID, NUM_COMPRESSION_METHODS if not found.
HTJ2K32_COMPRESSION
#define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER
Definition: ImfNamespace.h:80
IMF_EXPORT void setDefaultZipCompressionLevel(int level)
IMF_EXPORT void getCompressionDescriptionFromId(Compression id, std::string &desc)
Returns a codec ID's short description (lowercase).
RLE_COMPRESSION
HTJ2K256_COMPRESSION
IMF_EXPORT bool isValidDeepCompression(Compression id)
Return true is the compression method exists and supports deep data.