| Exiv2

Loading...
Searching...
No Matches
List of all members
Exiv2::Internal::TiffReader Class Reference

TIFF composite visitor to read the TIFF structure from a block of memory and build the composite from it (Visitor pattern). Used by TiffParser to read the TIFF data from a block of memory. More...

`#include <tiffvisitor_int.hpp>`

Inheritance diagram for Exiv2::Internal::TiffReader:
[legend]

## Public Member Functions
Creators
| TiffReader (const byte *pData, size_t size, TiffComponent *pRoot, TiffRwState state)
| Constructor. The data buffer and table describing the TIFF structure of the data are set in the constructor.
| TiffReader (const TiffReader &)=delete
TiffReader & | operator= (const TiffReader &)=delete
| ~TiffReader () override=default
| Virtual destructor.
Manipulators
void | visitEntry (TiffEntry *object) override
| Read a TIFF entry from the data buffer.
void | visitDataEntry (TiffDataEntry *object) override
| Read a TIFF data entry from the data buffer.
void | visitImageEntry (TiffImageEntry *object) override
| Read a TIFF image entry from the data buffer.
void | visitSizeEntry (TiffSizeEntry *object) override
| Read a TIFF size entry from the data buffer.
void | visitDirectory (TiffDirectory *object) override
| Read a TIFF directory from the data buffer.
void | visitSubIfd (TiffSubIfd *object) override
| Read a TIFF sub-IFD from the data buffer.
void | visitMnEntry (TiffMnEntry *object) override
| Read a TIFF makernote entry from the data buffer.
void | visitIfdMakernote (TiffIfdMakernote *object) override
| Read an IFD makernote from the data buffer.
void | visitIfdMakernoteEnd (TiffIfdMakernote *object) override
| Reset reader to its original state, undo makernote specific settings.
void | visitBinaryArray (TiffBinaryArray *object) override
| Read a binary array from the data buffer.
void | visitBinaryElement (TiffBinaryElement *object) override
| Read an element of a binary array from the data buffer.
void | readTiffEntry (TiffEntryBase *object)
| Read a standard TIFF entry from the data buffer.
void | readDataEntryBase (TiffDataEntryBase *object)
| Read a TiffDataEntryBase from the data buffer.
void | setMnState (const TiffRwState *state=nullptr)
| Set the state of the reader to one suitable for the Makernote.
void | setOrigState ()
| Set the state to the original state as set in the constructor.
bool | circularReference (const byte *start, IfdId group)
| Check IFD directory pointer start for circular reference.
int | nextIdx (IfdId group)
| Return the next idx sequence number for group.
void | postProcess ()
| Read deferred components.
Public Member Functions inherited from Exiv2::Internal::TiffVisitor
virtual | ~TiffVisitor ()=default
| Virtual destructor.
void | setGo (GoEvent event, bool go)
| Set the stop/go flag: true for go, false for stop.
virtual void | visitDirectoryNext (TiffDirectory *object)
| Operation to perform for a TIFF directory, after all components and before the next entry is processed.
virtual void | visitDirectoryEnd (TiffDirectory *object)
| Operation to perform for a TIFF directory, at the end of the processing.
virtual void | visitBinaryArrayEnd (TiffBinaryArray *object)
| Operation to perform for a TIFF binary array, at the end of the processing.
bool | go (GoEvent event) const
| Check if stop flag for event is clear, return true if it's clear.

## Accessors
ByteOrder | byteOrder () const
| Return the byte order.
size_t | baseOffset () const
| Return the base offset. See class TiffRwState for details.

## Additional Inherited Members
Public Types inherited from Exiv2::Internal::TiffVisitor
enum | GoEvent { geTraverse = 0 , geKnownMakernote = 1 }
| Events for the stop/go flag. See setGo(). More...

## Detailed Description

TIFF composite visitor to read the TIFF structure from a block of memory and build the composite from it (Visitor pattern). Used by TiffParser to read the TIFF data from a block of memory.

## Constructor & Destructor Documentation

## ◆ TiffReader()

Exiv2::Internal::TiffReader::TiffReader | ( | const byte * | pData,
|  | size_t | size,
|  | TiffComponent * | pRoot,
|  | TiffRwState | state )

Constructor. The data buffer and table describing the TIFF structure of the data are set in the constructor.

Parameters

  pData | Pointer to the data buffer, starting with a TIFF header.
  size | Number of bytes in the data buffer.
  pRoot | Root element of the TIFF composite.
  state | State object for creation function, byte order and base offset.

## Member Function Documentation

## ◆ postProcess()

void Exiv2::Internal::TiffReader::postProcess | ( |  | ) |

Read deferred components.

This function is called after the TIFF composite is read by passing a TiffReader to the accept() function of the root component. It reads all components for which reading was deferred during that pass. This is usually done to make sure that all other components are accessible at the time the deferred components are processed.

References setMnState(), and setOrigState().

## ◆ setMnState()

void Exiv2::Internal::TiffReader::setMnState | ( | const TiffRwState * | state = nullptr | ) |

Set the state of the reader to one suitable for the Makernote.

Uses the state passed in, if any, and remembers it for use during subsequent calls without any argument.

References Exiv2::Internal::TiffRwState::baseOffset(), and Exiv2::Internal::TiffRwState::byteOrder().

Referenced by postProcess(), and visitIfdMakernote().

## ◆ visitBinaryArray()

void Exiv2::Internal::TiffReader::visitBinaryArray | ( | TiffBinaryArray * | object | ) |
| override virtual

Read a binary array from the data buffer.

Implements Exiv2::Internal::TiffVisitor.

References Exiv2::Internal::ArrayCfg::concat_, Exiv2::Internal::ArrayDef::count_, Exiv2::Internal::ArrayCfg::cryptFct_, Exiv2::Internal::ArrayCfg::elDefaultDef_, EXV_WARNING, Exiv2::Internal::TiffComponent::group(), Exiv2::Internal::groupName(), Exiv2::Internal::TiffEntryBase::idx(), Exiv2::Internal::ArrayDef::idx_, Exiv2::Internal::TiffBinaryArray::initialize(), readTiffEntry(), Exiv2::Internal::TiffFinder::result(), Exiv2::Internal::TiffComponent::tag(), Exiv2::Internal::ArrayCfg::tagStep(), Exiv2::Internal::ArrayDef::tiffType_, and Exiv2::Internal::ttUndefined.

## ◆ visitBinaryElement()

void Exiv2::Internal::TiffReader::visitBinaryElement | ( | TiffBinaryElement * | object | ) |
| override virtual

Read an element of a binary array from the data buffer.

Implements Exiv2::Internal::TiffVisitor.

References byteOrder(), Exiv2::Value::create(), Exiv2::Internal::TiffBinaryElement::elDef(), Exiv2::Internal::enforce(), Exiv2::Internal::TiffComponent::group(), nextIdx(), Exiv2::Internal::TiffComponent::tag(), Exiv2::Internal::ArrayDef::tiffType_, and Exiv2::Internal::toTypeId().

## ◆ visitDataEntry()

void Exiv2::Internal::TiffReader::visitDataEntry | ( | TiffDataEntry * | object | ) |
| override virtual

Read a TIFF data entry from the data buffer.

Implements Exiv2::Internal::TiffVisitor.

References readDataEntryBase().

## ◆ visitDirectory()

void Exiv2::Internal::TiffReader::visitDirectory | ( | TiffDirectory * | object | ) |
| override virtual

Read a TIFF directory from the data buffer.

Implements Exiv2::Internal::TiffVisitor.

References baseOffset(), byteOrder(), circularReference(), Exiv2::Internal::TiffCreator::create(), EXV_ERROR, EXV_WARNING, Exiv2::getULong(), Exiv2::getUShort(), Exiv2::Internal::TiffComponent::group(), Exiv2::Internal::groupName(), Exiv2::Internal::TiffDirectory::hasNext(), Exiv2::Internal::Tag::next, and Exiv2::Internal::TiffComponent::start().

## ◆ visitEntry()

void Exiv2::Internal::TiffReader::visitEntry | ( | TiffEntry * | object | ) |
| override virtual

Read a TIFF entry from the data buffer.

Implements Exiv2::Internal::TiffVisitor.

References readTiffEntry().

## ◆ visitIfdMakernote()

void Exiv2::Internal::TiffReader::visitIfdMakernote | ( | TiffIfdMakernote * | object | ) |
| override virtual

Read an IFD makernote from the data buffer.

Implements Exiv2::Internal::TiffVisitor.

References byteOrder(), EXV_ERROR, Exiv2::Internal::TiffVisitor::geKnownMakernote, Exiv2::Internal::TiffComponent::group(), Exiv2::Internal::groupName(), Exiv2::hexdump(), Exiv2::Internal::TiffIfdMakernote::ifdOffset(), Exiv2::Internal::TiffIfdMakernote::readHeader(), Exiv2::Internal::TiffVisitor::setGo(), setMnState(), and Exiv2::Internal::TiffComponent::start().

## ◆ visitIfdMakernoteEnd()

void Exiv2::Internal::TiffReader::visitIfdMakernoteEnd | ( | TiffIfdMakernote * | object | ) |
| override virtual

Reset reader to its original state, undo makernote specific settings.

Reimplemented from Exiv2::Internal::TiffVisitor.

References setOrigState().

## ◆ visitImageEntry()

void Exiv2::Internal::TiffReader::visitImageEntry | ( | TiffImageEntry * | object | ) |
| override virtual

Read a TIFF image entry from the data buffer.

Implements Exiv2::Internal::TiffVisitor.

References readDataEntryBase().

## ◆ visitMnEntry()

void Exiv2::Internal::TiffReader::visitMnEntry | ( | TiffMnEntry * | object | ) |
| override virtual

Read a TIFF makernote entry from the data buffer.

Implements Exiv2::Internal::TiffVisitor.

References byteOrder(), Exiv2::Internal::TiffMnCreator::create(), Exiv2::make(), Exiv2::Internal::TiffEntryBase::pData(), readTiffEntry(), Exiv2::Internal::TiffFinder::result(), and Exiv2::Internal::TiffComponent::tag().

## ◆ visitSizeEntry()

void Exiv2::Internal::TiffReader::visitSizeEntry | ( | TiffSizeEntry * | object | ) |
| override virtual

Read a TIFF size entry from the data buffer.

Implements Exiv2::Internal::TiffVisitor.

References baseOffset(), Exiv2::Internal::TiffSizeEntry::dtGroup(), Exiv2::Internal::TiffSizeEntry::dtTag(), Exiv2::Internal::TiffEntryBase::pValue(), readTiffEntry(), and Exiv2::Internal::TiffFinder::result().

## ◆ visitSubIfd()

void Exiv2::Internal::TiffReader::visitSubIfd | ( | TiffSubIfd * | object | ) |
| override virtual

Read a TIFF sub-IFD from the data buffer.

Implements Exiv2::Internal::TiffVisitor.

References baseOffset(), byteOrder(), Exiv2::Internal::TiffComponent::count(), EXV_ERROR, EXV_WARNING, Exiv2::getULong(), Exiv2::Internal::TiffComponent::group(), Exiv2::Internal::groupName(), Exiv2::Internal::TiffEntryBase::pData(), readTiffEntry(), Exiv2::Internal::TiffComponent::tag(), Exiv2::Internal::TiffEntryBase::tiffType(), Exiv2::Internal::ttSignedLong, Exiv2::Internal::ttTiffIfd, and Exiv2::Internal::ttUnsignedLong.

The documentation for this class was generated from the following files:

- tiffvisitor_int.hpp
- tiffvisitor_int.cpp