|
libopenraw
0.3.7
|
#include <ifddir.hpp>
Public Types | |
| typedef std::weak_ptr< IfdDir > | WeakRef |
| Weak ptr of an IfdDir. | |
| typedef std::shared_ptr< IfdDir > | Ref |
| Shared ptr of an IfdDir. | |
| typedef std::vector< Ref > | RefVec |
| Vector of shared ptr of IfdDir. More... | |
| typedef std::map< uint16_t, IfdEntry::Ref > | Entries |
| Ifd Entries map type. More... | |
Public Member Functions | |
| IfdDir (off_t _offset, RawContainer &_container, IfdDirType _type, const TagTable &tag_table=exif_tag_names) | |
| Construct an IfdDir. More... | |
| IfdDirType | type () const |
| Get the type of the IfdDir. | |
| void | setType (IfdDirType type_) |
| Set the type of the IfdDir. | |
| off_t | baseOffset () const |
| Get the base offset for the data. More... | |
| void | setBaseOffset (off_t base) |
| Set the base offset. | |
| bool | isPrimary () const |
| The IFD is a primary in the TIFF/EP sense. More... | |
| bool | isThumbnail () const |
| The IFD is for a thumnail. More... | |
| off_t | offset () const |
| Return the offset. | |
| const RawContainer & | container () const |
| The container for the IfdDir, const. | |
| RawContainer & | container () |
| The container for the IfdDir. | |
| virtual bool | load () |
| Load the directory to memory. More... | |
| int | numTags () |
| Return the number of entries. | |
| IfdEntry::Ref | getEntry (uint16_t id) const |
| Get the IfdEntry for the tag id. More... | |
| const Entries & | entries () const |
| Direct access to the entries. | |
| RawContainer::EndianType | endian () const |
| the Container endian More... | |
| void | setEndian (RawContainer::EndianType _endian) |
| Set the endian for the IFD. More... | |
| template<typename T > | |
| Option< T > | getValue (uint16_t id) const |
| Get a T value from an entry. More... | |
| Option< uint32_t > | getIntegerValue (uint16_t id) |
| Get an loosely typed integer value from an entry. More... | |
| off_t | nextIFD () |
| Get the offset of the next IFD in absolute. | |
| Ref | getSubIFD (uint32_t idx=0) const |
| Get the SubIFD at index idx. More... | |
| Option< std::vector< IfdDir::Ref > > | getSubIFDs () |
| Get all SubIFDs. More... | |
| Ref | getExifIFD () |
| Get the Exif IFD. More... | |
| Ref | getMakerNoteIfd (or_rawfile_type file_type) |
| Get the MakerNote IFD. More... | |
| void | setTagTable (const TagTable &tag_table) |
| Set the tag table for tag to name correspondance. More... | |
| const char * | getTagName (uint32_t tag) const |
| Return the tag name for tag. More... | |
| template<typename T > | |
| Option< std::vector< T > > | getEntryArrayValue (IfdEntry &e) const |
| Get the entry value as an array. More... | |
| template<typename T > | |
| T | getEntryValue (IfdEntry &e, uint32_t idx=0, bool ignore_type=false) const |
| Get the typed entry value. More... | |
| uint32_t | getEntryIntegerArrayItemValue (IfdEntry &e, int idx) const |
| Return the integer value at index. It will coerce the type. More... | |
| MetaValue * | makeMetaValue (IfdEntry &e) const |
| Make a meta value out of the IFD entry. More... | |
Protected Attributes | |
| Entries | m_entries |
An IFD directory.
Definition at line 51 of file ifddir.hpp.
| typedef std::map<uint16_t, IfdEntry::Ref> OpenRaw::Internals::IfdDir::Entries |
| typedef std::vector<Ref> OpenRaw::Internals::IfdDir::RefVec |
Vector of shared ptr of IfdDir.
Used for situations like with IfdFileContainer.
Definition at line 61 of file ifddir.hpp.
| OpenRaw::Internals::IfdDir::IfdDir | ( | off_t | _offset, |
| RawContainer & | _container, | ||
| IfdDirType | _type, | ||
| const TagTable & | tag_table = exif_tag_names |
||
| ) |
Construct an IfdDir.
| _offset | The offset from the begining of the container (where it starts) |
| _container | The container |
| _type | The IFD type. |
| tag_table | The tag to name table. By default it is the Exif tags. |
Definition at line 52 of file ifddir.cpp.
|
inline |
|
inline |
the Container endian
Usually it is the same as the file, but MakerNote are weird and might have a different idea.
Definition at line 137 of file ifddir.hpp.
Referenced by OpenRaw::Internals::CIFF::CiffMainIfd::load().
| IfdEntry::Ref OpenRaw::Internals::IfdDir::getEntry | ( | uint16_t | id | ) | const |
Get the IfdEntry for the tag id.
Requires load() to have been called once.
Definition at line 96 of file ifddir.cpp.
References m_entries.
Referenced by OpenRaw::Internals::MakerNoteDir::getIfdInEntry(), getIntegerValue(), getMakerNoteIfd(), getSubIFD(), getSubIFDs(), and getValue().
| uint32_t OpenRaw::Internals::IfdDir::getEntryIntegerArrayItemValue | ( | IfdEntry & | e, |
| int | idx | ||
| ) | const |
Return the integer value at index. It will coerce the type.
| e | the IFD entry |
| idx | the index |
Definition at line 227 of file ifddir.cpp.
References OpenRaw::Internals::IfdEntry::type().
Referenced by getIntegerValue().
| IfdDir::Ref OpenRaw::Internals::IfdDir::getExifIFD | ( | ) |
Get the Exif IFD.
The SubIFD is located at offset found in the field EXIF_TAG_SUB_IFDS
Definition at line 179 of file ifddir.cpp.
| Option< uint32_t > OpenRaw::Internals::IfdDir::getIntegerValue | ( | uint16_t | id | ) |
Get an loosely typed integer value from an entry.
This method is preferred over getLongValue() or getShortValue() unless you really want the strong typing that IFD structure provide.
| id | the IFD field id |
Definition at line 107 of file ifddir.cpp.
References getEntry(), and getEntryIntegerArrayItemValue().
| IfdDir::Ref OpenRaw::Internals::IfdDir::getMakerNoteIfd | ( | or_rawfile_type | file_type | ) |
Get the MakerNote IFD.
| file_type | the file type as a hint |
Definition at line 197 of file ifddir.cpp.
References getEntry().
| IfdDir::Ref OpenRaw::Internals::IfdDir::getSubIFD | ( | uint32_t | idx = 0 | ) | const |
Get the SubIFD at index idx.
The SubIFD is locate at offset found in the field EXIF_TAG_SUB_IFDS
Definition at line 137 of file ifddir.cpp.
References getEntry().
| Option< std::vector< IfdDir::Ref > > OpenRaw::Internals::IfdDir::getSubIFDs | ( | ) |
Get all SubIFDs.
Definition at line 157 of file ifddir.cpp.
References getEntry().
| const char * OpenRaw::Internals::IfdDir::getTagName | ( | uint32_t | tag | ) | const |
Return the tag name for tag.
Definition at line 218 of file ifddir.cpp.
|
inline |
Get a T value from an entry.
| id | the IFD field id |
Definition at line 156 of file ifddir.hpp.
References getEntry().
| bool OpenRaw::Internals::IfdDir::isPrimary | ( | ) | const |
The IFD is a primary in the TIFF/EP sense.
Definition at line 40 of file ifddir.cpp.
| bool OpenRaw::Internals::IfdDir::isThumbnail | ( | ) | const |
The IFD is for a thumnail.
Definition at line 46 of file ifddir.cpp.
|
virtual |
Load the directory to memory.
The only reason you'd want to override is to synthesize an IFD from non-IFD.
Reimplemented in OpenRaw::Internals::NonMakerNoteDir, OpenRaw::Internals::CIFF::CiffExifIfd, and OpenRaw::Internals::CIFF::CiffMainIfd.
Definition at line 65 of file ifddir.cpp.
References m_entries, OpenRaw::Internals::RawContainer::readInt16(), OpenRaw::Internals::RawContainer::readInt32(), OpenRaw::Internals::RawContainer::readUInt16(), and type().
Make a meta value out of the IFD entry.
Definition at line 290 of file ifddir.cpp.
References OpenRaw::Internals::IfdEntry::type().
|
inline |
Set the endian for the IFD.
By default it's the same as the container but you might want to set it if, for example, parsing a MakerNote.
Definition at line 146 of file ifddir.hpp.
|
inline |
Set the tag table for tag to name correspondance.
This is used to override the tag name in IFD that use non standard tags, like MakerNote or Panasonic RW2.
Definition at line 211 of file ifddir.hpp.
|
protected |
The IFD entries
Definition at line 240 of file ifddir.hpp.
Referenced by entries(), getEntry(), load(), OpenRaw::Internals::CIFF::CiffExifIfd::load(), nextIFD(), and numTags().