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  NUM_COMPRESSION_METHODS // number of different compression methods.
55 };
56 
57 /// Returns a codec ID's short name (lowercase).
58 IMF_EXPORT void getCompressionNameFromId (Compression id, std::string& name);
59 
60 /// Returns a codec ID's short description (lowercase).
61 IMF_EXPORT void
62 getCompressionDescriptionFromId (Compression id, std::string& desc);
63 
64 /// Returns the codec name's ID, NUM_COMPRESSION_METHODS if not found.
65 IMF_EXPORT void
66 getCompressionIdFromName (const std::string& name, Compression& id);
67 
68 /// Return true if a compression id exists.
69 IMF_EXPORT bool isValidCompression (int id);
70 
71 /// Return a string enumerating all compression names, with a custom separator.
72 IMF_EXPORT void
73 getCompressionNamesString (const std::string& separator, std::string& in);
74 
75 /// Return the number of scan lines expected by a given compression method.
77 
78 /// Return true is the compression method exists and doesn't preserves data integrity.
80 
81 /// Return true is the compression method exists and supports deep data.
83 
84 /// Controls the default zip compression level used. Zip is used for
85 /// the 2 zip levels as well as some modes of the DWAA/B compression.
87 
88 /// Controls the default quality level for the DWA lossy compression
90 
92 
93 #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.
#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
IMF_EXPORT bool isValidDeepCompression(Compression id)
Return true is the compression method exists and supports deep data.