6 #ifndef INCLUDED_IMF_HEADER_H
7 #define INCLUDED_IMF_HEADER_H
51 float screenWindowWidth = 1,
68 float screenWindowWidth = 1,
84 float screenWindowWidth = 1,
93 Header (
const Header& other);
149 void erase (
const char name[]);
151 void erase (
const std::string& name);
174 Attribute& operator[] (
const char name[]);
176 const Attribute& operator[] (
const char name[])
const;
179 Attribute& operator[] (
const std::string& name);
181 const Attribute& operator[] (
const std::string& name)
const;
183 template <
class T>
T& typedAttribute (
const char name[]);
184 template <
class T>
const T& typedAttribute (
const char name[])
const;
186 template <
class T>
T& typedAttribute (
const std::string& name);
187 template <
class T>
const T& typedAttribute (
const std::string& name)
const;
189 template <
class T>
T* findTypedAttribute (
const char name[]);
190 template <
class T>
const T* findTypedAttribute (
const char name[])
const;
192 template <
class T>
T* findTypedAttribute (
const std::string& name);
194 const T* findTypedAttribute (
const std::string& name)
const;
208 ConstIterator
begin ()
const;
213 ConstIterator
end ()
const;
216 Iterator
find (
const char name[]);
218 ConstIterator
find (
const char name[])
const;
221 Iterator
find (
const std::string& name);
223 ConstIterator
find (
const std::string& name)
const;
250 float& screenWindowWidth ();
252 const float& screenWindowWidth ()
const;
279 void resetDefaultCompressionLevels ();
281 int& zipCompressionLevel ();
283 int zipCompressionLevel ()
const;
285 float& dwaCompressionLevel ();
287 float dwaCompressionLevel ()
const;
295 void setName (
const string& name);
300 const string&
name ()
const;
303 bool hasName ()
const;
306 void setType (
const string&
Type);
311 const string&
type ()
const;
314 bool hasType ()
const;
325 bool hasVersion ()
const;
332 void setChunkCount (
int chunks);
334 bool hasChunkCount ()
const;
336 const int& chunkCount ()
const;
345 void setView (
const string& view);
347 bool hasView ()
const;
351 const string& view ()
const;
383 bool hasTileDescription ()
const;
415 bool hasPreviewImage ()
const;
427 void sanityCheck (
bool isTiled =
false,
bool isMultipartFile =
false)
const;
446 static void setMaxImageSize (
int maxWidth,
int maxHeight);
448 static void setMaxTileSize (
int maxWidth,
int maxHeight);
450 static void getMaxImageSize (
int& maxWidth,
int& maxHeight);
452 static void getMaxTileSize (
int& maxWidth,
int& maxHeight);
458 bool readsNothing ();
494 Iterator (
const Header::AttributeMap::iterator& i);
497 Iterator& operator++ ();
499 Iterator operator++ (
int);
502 const char*
name ()
const;
509 Header::AttributeMap::iterator _i;
518 ConstIterator (
const Header::AttributeMap::const_iterator& i);
523 ConstIterator& operator++ ();
525 ConstIterator operator++ (
int);
528 const char*
name ()
const;
533 friend bool operator== (
const ConstIterator&,
const ConstIterator&);
534 friend bool operator!= (
const ConstIterator&,
const ConstIterator&);
536 Header::AttributeMap::const_iterator _i;
559 inline Header::Iterator::Iterator () : _i ()
564 inline Header::Iterator::Iterator (
const Header::AttributeMap::iterator& i)
571 Header::Iterator::operator++ ()
578 Header::Iterator::operator++ (
int)
580 Iterator tmp = *
this;
597 inline Header::ConstIterator::ConstIterator () : _i ()
602 inline Header::ConstIterator::ConstIterator (
603 const Header::AttributeMap::const_iterator& i)
616 Header::ConstIterator::operator++ ()
623 Header::ConstIterator::operator++ (
int)
625 ConstIterator tmp = *
this;
663 T* tattr =
dynamic_cast<T*
> (attr);
665 if (tattr == 0)
throw IEX_NAMESPACE::TypeExc (
"Unexpected attribute type.");
675 const T* tattr =
dynamic_cast<const T*
> (attr);
677 if (tattr == 0)
throw IEX_NAMESPACE::TypeExc (
"Unexpected attribute type.");
686 return typedAttribute<T> (name.c_str ());
693 return typedAttribute<T> (name.c_str ());
700 AttributeMap::iterator i = _map.find (name);
701 return (i == _map.end ()) ? 0 : dynamic_cast<T*> (i->second);
708 AttributeMap::const_iterator i = _map.find (name);
709 return (i == _map.end ()) ? 0 : dynamic_cast<const T*> (i->second);
716 return findTypedAttribute<T> (name.c_str ());
723 return findTypedAttribute<T> (name.c_str ());
#define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT
OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER enum IMF_EXPORT_ENUM Compression
OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER enum IMF_EXPORT_ENUM LineOrder
FMT_CONSTEXPR auto find(Ptr first, Ptr last, T value, Ptr &out) -> bool
OIIO_FORCEINLINE vbool4 insert(const vbool4 &a, bool val)
Helper: substitute val for a[i].
GLint GLsizei GLsizei height
class IMF_EXPORT_TYPE Header
IMF_EXPORT bool isTiled(const std::string &name)
Box< V2i > Box2i
2D box of base type int.
OPENVDB_API void setVersion(std::ios_base &, const VersionId &libraryVersion, uint32_t fileVersion)
Associate specific file format and library version numbers with the given stream. ...
bool operator!=(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Inequality operator, does exact floating point comparisons.
GLuint const GLchar * name
HUSD_API const char * pixelAspectRatio()
class IMF_EXPORT_TYPE OStream
GT_API const UT_StringHolder version
Vec2< float > V2f
Vec2 of float.
LeafData & operator=(const LeafData &)=delete
OIIO_API bool attribute(string_view name, TypeDesc type, const void *val)
#define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER
bool operator==(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Equality operator, does exact floating point comparisons.
ImageBuf OIIO_API channels(const ImageBuf &src, int nchannels, cspan< int > channelorder, cspan< float > channelvalues={}, cspan< std::string > newchannelnames={}, bool shuffle_channel_names=false, int nthreads=0)
class IMF_EXPORT_TYPE IStream
PcpNodeRef_ChildrenIterator begin(const PcpNodeRef::child_const_range &r)
Support for range-based for loops for PcpNodeRef children ranges.