HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ImfOpaqueAttribute.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 
7 #ifndef INCLUDED_IMF_OPAQUE_ATTRIBUTE_H
8 #define INCLUDED_IMF_OPAQUE_ATTRIBUTE_H
9 
10 //-----------------------------------------------------------------------------
11 //
12 // class OpaqueAttribute
13 //
14 // When an image file is read, OpqaqueAttribute objects are used
15 // to hold the values of attributes whose types are not recognized
16 // by the reading program. OpaqueAttribute objects can be read
17 // from an image file, copied, and written back to to another image
18 // file, but their values are inaccessible.
19 //
20 //-----------------------------------------------------------------------------
21 
22 #include "ImfExport.h"
23 #include "ImfNamespace.h"
24 
25 #include "ImfAttribute.h"
26 #include "ImfArray.h"
27 
29 
30 
32 {
33  public:
34 
35  //----------------------------
36  // Constructors and destructor
37  //----------------------------
38 
39  IMF_EXPORT OpaqueAttribute (const char typeName[]);
40  IMF_EXPORT OpaqueAttribute (const OpaqueAttribute &other);
41  IMF_EXPORT virtual ~OpaqueAttribute ();
42 
43 
44  //-------------------------------
45  // Get this attribute's type name
46  //-------------------------------
47 
48  IMF_EXPORT virtual const char * typeName () const;
49 
50 
51  //------------------------------
52  // Make a copy of this attribute
53  //------------------------------
54 
55  IMF_EXPORT virtual Attribute * copy () const;
56 
57 
58  //----------------
59  // I/O and copying
60  //----------------
61 
63  int version) const;
64 
66  int size,
67  int version);
68 
69  IMF_EXPORT virtual void copyValueFrom (const Attribute &other);
70 
71 
72  int dataSize() const { return _dataSize; }
73  const Array<char>& data() const { return _data; }
74 
75  private:
76 
77  std::string _typeName;
78  long _dataSize;
79  Array<char> _data;
80 };
81 
82 
84 
85 #endif
#define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT
Definition: ImfNamespace.h:80
GLsizei const GLchar *const * string
Definition: glcorearb.h:814
virtual Attribute * copy() const =0
virtual void writeValueTo(OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &os, int version) const =0
const Array< char > & data() const
#define IMF_EXPORT
Definition: ImfExport.h:54
class IMF_EXPORT_TYPE OStream
Definition: ImfForward.h:88
GT_API const UT_StringHolder version
GLsizeiptr size
Definition: glcorearb.h:664
int dataSize() const
#define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER
Definition: ImfNamespace.h:79
virtual const char * typeName() const =0
virtual void readValueFrom(OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &is, int size, int version)=0
#define IMF_EXPORT_TYPE
Definition: ImfExport.h:57
virtual void copyValueFrom(const Attribute &other)=0
class IMF_EXPORT_TYPE IStream
Definition: ImfForward.h:89