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 #ifndef INCLUDED_IMF_OPAQUE_ATTRIBUTE_H
7 #define INCLUDED_IMF_OPAQUE_ATTRIBUTE_H
8 
9 //-----------------------------------------------------------------------------
10 //
11 // class OpaqueAttribute
12 //
13 // When an image file is read, OpqaqueAttribute objects are used
14 // to hold the values of attributes whose types are not recognized
15 // by the reading program. OpaqueAttribute objects can be read
16 // from an image file, copied, and written back to to another image
17 // file, but their values are inaccessible.
18 //
19 //-----------------------------------------------------------------------------
20 
21 #include "ImfExport.h"
22 #include "ImfNamespace.h"
23 
24 #include "ImfArray.h"
25 #include "ImfAttribute.h"
26 
28 
30 {
31 public:
32  //----------------------------
33  // Constructors and destructor
34  //----------------------------
35 
36  IMF_EXPORT OpaqueAttribute (const char typeName[]);
37  IMF_EXPORT OpaqueAttribute (const OpaqueAttribute& other);
38  IMF_EXPORT virtual ~OpaqueAttribute ();
39 
40  //-------------------------------
41  // Get this attribute's type name
42  //-------------------------------
43 
44  IMF_EXPORT virtual const char* typeName () const;
45 
46  //------------------------------
47  // Make a copy of this attribute
48  //------------------------------
49 
50  IMF_EXPORT virtual Attribute* copy () const;
51 
52  //----------------
53  // I/O and copying
54  //----------------
55 
56  IMF_EXPORT virtual void writeValueTo (
58 
59  IMF_EXPORT virtual void readValueFrom (
60  OPENEXR_IMF_INTERNAL_NAMESPACE::IStream& is, int size, int version);
61 
62  IMF_EXPORT virtual void copyValueFrom (const Attribute& other);
63 
64  int dataSize () const { return _dataSize; }
65  const Array<char>& data () const { return _data; }
66 
67 private:
68  std::string _typeName;
69  long _dataSize;
70  Array<char> _data;
71 };
72 
74 
75 #endif
#define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT
Definition: ImfNamespace.h:83
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:86
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:80
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:87