Exiv2
Friends | List of all members
Exiv2::Internal::TiffIfdMakernote Class Reference

Tiff IFD Makernote. This is a concrete class suitable for all IFD makernotes. More...

#include <tiffcomposite_int.hpp>

Inheritance diagram for Exiv2::Internal::TiffIfdMakernote:
Inheritance graph
[legend]

Public Member Functions

Creators
 TiffIfdMakernote (uint16_t tag, IfdId group, IfdId mnGroup, MnHeader *pHeader, bool hasNext=true)
 Default constructor.
 
 ~TiffIfdMakernote () override
 Virtual destructor.
 
Manipulators
bool readHeader (const byte *pData, uint32_t size, ByteOrder byteOrder)
 Read the header from a data buffer, return true if successful. More...
 
void setByteOrder (ByteOrder byteOrder)
 Set the byte order for the makernote.
 
void setImageByteOrder (ByteOrder byteOrder)
 Set the byte order used for the image.
 
Accessors
uint32_t sizeHeader () const
 Return the size of the header in bytes.
 
uint32_t writeHeader (IoWrapper &ioWrapper, ByteOrder byteOrder) const
 Write the header to a data buffer, return the number of bytes written.
 
uint32_t mnOffset () const
 Return the offset to the makernote from the start of the TIFF header.
 
uint32_t ifdOffset () const
 Return the offset to the start of the Makernote IFD from the start of the Makernote. Returns 0 if there is no header.
 
ByteOrder byteOrder () const
 Return the byte order for the makernote. Requires the image byte order to be set (setImageByteOrder()). Returns the byte order for the image if there is no header or the byte order for the header is invalidByteOrder.
 
ByteOrder imageByteOrder () const
 Return the byte order used for the image.
 
uint32_t baseOffset () const
 Return the base offset for use with the makernote IFD entries relative to the start of the TIFF header. Returns 0 if there is no header.
 
- Public Member Functions inherited from Exiv2::Internal::TiffComponent
 TiffComponent (uint16_t tag, IfdId group)
 Constructor.
 
virtual ~TiffComponent ()=default
 Virtual destructor.
 
TiffComponent * addPath (uint16_t tag, TiffPath &tiffPath, TiffComponent *const pRoot, UniquePtr object=UniquePtr(nullptr))
 Add a TIFF entry tag to the component. Components on the path to the entry are added if they don't exist yet. More...
 
TiffComponent * addChild (UniquePtr tiffComponent)
 Add a child to the component. Default is to do nothing. More...
 
TiffComponent * addNext (UniquePtr tiffComponent)
 Add a "next" component to the component. Default is to do nothing. More...
 
void accept (TiffVisitor &visitor)
 Interface to accept visitors (Visitor pattern). Visitors can perform operations on all components of the composite. More...
 
void setStart (const byte *pStart)
 Set a pointer to the start of the binary representation of the component in a memory buffer. The buffer must be allocated and freed outside of this class.
 
uint32_t write (IoWrapper &ioWrapper, ByteOrder byteOrder, int32_t offset, uint32_t valueIdx, uint32_t dataIdx, uint32_t &imageIdx)
 Write a TiffComponent to a binary image. More...
 
uint16_t tag () const
 Return the tag of this entry.
 
IfdId group () const
 Return the group id of this component.
 
byte * start () const
 Return a pointer to the start of the binary representation of the component.
 
UniquePtr clone () const
 Return an auto-pointer to a copy of itself (deep copy, but without any children). The caller owns this copy and the auto-pointer ensures that it will be deleted.
 
uint32_t writeData (IoWrapper &ioWrapper, ByteOrder byteOrder, int32_t offset, uint32_t dataIdx, uint32_t &imageIdx) const
 Write the IFD data of this component to a binary image. Return the number of bytes written. Components derived from TiffEntryBase implement this method if needed.
 
uint32_t writeImage (IoWrapper &ioWrapper, ByteOrder byteOrder) const
 Write the image data of this component to a binary image. Return the number of bytes written. TIFF components implement this method if needed.
 
uint32_t size () const
 Return the size in bytes of the IFD value of this component when written to a binary image.
 
uint32_t count () const
 Return the number of components in this component.
 
uint32_t sizeData () const
 Return the size in bytes of the IFD data of this component when written to a binary image. This is a support function for write(). Components derived from TiffEntryBase implement this method corresponding to their implementation of writeData().
 
uint32_t sizeImage () const
 Return the size in bytes of the image data of this component when written to a binary image. This is a support function for write(). TIFF components implement this method corresponding to their implementation of writeImage().
 
virtual int idx () const
 Return the unique id of the entry in the image. More...
 

Protected Member Functions

Protected Manipulators
TiffComponent * doAddPath (uint16_t tag, TiffPath &tiffPath, TiffComponent *const pRoot, TiffComponent::UniquePtr object) override
 Implements addPath(). The default implementation does nothing. More...
 
TiffComponent * doAddChild (TiffComponent::UniquePtr tiffComponent) override
 Implements addChild(). The default implementation does nothing. More...
 
TiffComponent * doAddNext (TiffComponent::UniquePtr tiffComponent) override
 Implements addNext(). The default implementation does nothing. More...
 
void doAccept (TiffVisitor &visitor) override
 Implements accept(). More...
 
uint32_t doWrite (IoWrapper &ioWrapper, ByteOrder byteOrder, int32_t offset, uint32_t valueIdx, uint32_t dataIdx, uint32_t &imageIdx) override
 Implements write(). Write the Makernote header, TIFF directory, values and additional data to the ioWrapper, return the number of bytes written. More...
 
Protected Accessors
TiffIfdMakernote * doClone () const override
 Internal virtual copy constructor, implements clone(). More...
 
uint32_t doWriteData (IoWrapper &ioWrapper, ByteOrder byteOrder, int32_t offset, uint32_t dataIdx, uint32_t &imageIdx) const override
 This class does not really implement writeData(), it only has write(). This method must not be called; it commits suicide. More...
 
uint32_t doWriteImage (IoWrapper &ioWrapper, ByteOrder byteOrder) const override
 Implements writeImage(). Write the image data of the IFD of the Makernote. Return the number of bytes written. More...
 
uint32_t doSize () const override
 Implements size(). Return the size of the Makernote header, TIFF directory, values and additional data. More...
 
uint32_t doCount () const override
 Implements count(). Return the number of entries in the IFD of the Makernote. Does not count entries which are marked as deleted. More...
 
uint32_t doSizeData () const override
 This class does not really implement sizeData(), it only has size(). This method must not be called; it commits suicide. More...
 
uint32_t doSizeImage () const override
 Implements sizeImage(). Return the total image data size of the makernote IFD. More...
 
- Protected Member Functions inherited from Exiv2::Internal::TiffComponent

Friends

class TiffReader
 

Additional Inherited Members

- Public Types inherited from Exiv2::Internal::TiffComponent
using UniquePtr = std::unique_ptr< TiffComponent >
 TiffComponent auto_ptr type.
 
using Components = std::vector< TiffComponent * >
 Container type to hold all metadata.
 

Detailed Description

Tiff IFD Makernote. This is a concrete class suitable for all IFD makernotes.

Contains a makernote header (which can be 0) and an IFD and implements child mgmt functions to deal with the IFD entries. The various makernote weirdnesses are taken care of in the makernote header (and possibly in special purpose IFD entries).

Member Function Documentation

◆ doAccept()

void Exiv2::Internal::TiffIfdMakernote::doAccept ( TiffVisitor &  visitor)
overrideprotectedvirtual

◆ doAddChild()

TiffComponent * Exiv2::Internal::TiffIfdMakernote::doAddChild ( TiffComponent::UniquePtr  tiffComponent)
overrideprotectedvirtual

Implements addChild(). The default implementation does nothing.

Reimplemented from Exiv2::Internal::TiffComponent.

References Exiv2::Internal::TiffComponent::addChild().

◆ doAddNext()

TiffComponent * Exiv2::Internal::TiffIfdMakernote::doAddNext ( TiffComponent::UniquePtr  tiffComponent)
overrideprotectedvirtual

Implements addNext(). The default implementation does nothing.

Reimplemented from Exiv2::Internal::TiffComponent.

References Exiv2::Internal::TiffComponent::addNext().

◆ doAddPath()

TiffComponent * Exiv2::Internal::TiffIfdMakernote::doAddPath ( uint16_t  tag,
TiffPath &  tiffPath,
TiffComponent *const  pRoot,
TiffComponent::UniquePtr  object 
)
overrideprotectedvirtual

Implements addPath(). The default implementation does nothing.

Reimplemented from Exiv2::Internal::TiffComponent.

References Exiv2::Internal::TiffComponent::addPath(), and Exiv2::Internal::TiffComponent::tag().

◆ doClone()

TiffIfdMakernote * Exiv2::Internal::TiffIfdMakernote::doClone ( ) const
overrideprotectedvirtual

Internal virtual copy constructor, implements clone().

Implements Exiv2::Internal::TiffComponent.

◆ doCount()

uint32_t Exiv2::Internal::TiffIfdMakernote::doCount ( ) const
overrideprotectedvirtual

Implements count(). Return the number of entries in the IFD of the Makernote. Does not count entries which are marked as deleted.

Implements Exiv2::Internal::TiffComponent.

References Exiv2::Internal::TiffComponent::count().

◆ doSize()

uint32_t Exiv2::Internal::TiffIfdMakernote::doSize ( ) const
overrideprotectedvirtual

Implements size(). Return the size of the Makernote header, TIFF directory, values and additional data.

Implements Exiv2::Internal::TiffComponent.

References Exiv2::Internal::TiffComponent::size(), and sizeHeader().

◆ doSizeData()

uint32_t Exiv2::Internal::TiffIfdMakernote::doSizeData ( ) const
overrideprotectedvirtual

This class does not really implement sizeData(), it only has size(). This method must not be called; it commits suicide.

Implements Exiv2::Internal::TiffComponent.

◆ doSizeImage()

uint32_t Exiv2::Internal::TiffIfdMakernote::doSizeImage ( ) const
overrideprotectedvirtual

Implements sizeImage(). Return the total image data size of the makernote IFD.

Implements Exiv2::Internal::TiffComponent.

References Exiv2::Internal::TiffComponent::sizeImage().

◆ doWrite()

uint32_t Exiv2::Internal::TiffIfdMakernote::doWrite ( IoWrapper &  ioWrapper,
ByteOrder  byteOrder,
int32_t  offset,
uint32_t  valueIdx,
uint32_t  dataIdx,
uint32_t &  imageIdx 
)
overrideprotectedvirtual

Implements write(). Write the Makernote header, TIFF directory, values and additional data to the ioWrapper, return the number of bytes written.

Implements Exiv2::Internal::TiffComponent.

References baseOffset(), byteOrder(), setImageByteOrder(), Exiv2::Internal::TiffComponent::write(), and writeHeader().

◆ doWriteData()

uint32_t Exiv2::Internal::TiffIfdMakernote::doWriteData ( IoWrapper &  ioWrapper,
ByteOrder  byteOrder,
int32_t  offset,
uint32_t  dataIdx,
uint32_t &  imageIdx 
) const
overrideprotectedvirtual

This class does not really implement writeData(), it only has write(). This method must not be called; it commits suicide.

Implements Exiv2::Internal::TiffComponent.

◆ doWriteImage()

uint32_t Exiv2::Internal::TiffIfdMakernote::doWriteImage ( IoWrapper &  ioWrapper,
ByteOrder  byteOrder 
) const
overrideprotectedvirtual

Implements writeImage(). Write the image data of the IFD of the Makernote. Return the number of bytes written.

Implements Exiv2::Internal::TiffComponent.

References byteOrder(), and Exiv2::Internal::TiffComponent::writeImage().

◆ readHeader()

bool Exiv2::Internal::TiffIfdMakernote::readHeader ( const byte *  pData,
uint32_t  size,
ByteOrder  byteOrder 
)

Read the header from a data buffer, return true if successful.

The default implementation simply returns true.

References byteOrder(), Exiv2::Internal::MnHeader::read(), and Exiv2::Internal::TiffComponent::size().

Referenced by Exiv2::Internal::TiffReader::visitIfdMakernote().


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