Exiv2
List of all members
Exiv2::Internal::TiffHeaderBase Class Referenceabstract

Abstract base class defining the interface of an image header. Used internally by classes for TIFF-based images. Default implementation is for the regular TIFF header. More...

#include <tiffimage_int.hpp>

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

Public Member Functions

Creators
 TiffHeaderBase (uint16_t tag, uint32_t size, ByteOrder byteOrder, uint32_t offset)
 Constructor taking tag, size and default byteOrder and offset.
 
virtual ~TiffHeaderBase ()=0
 Virtual destructor.
 
Manipulators
virtual bool read (const byte *pData, uint32_t size)
 Read the image header from a data buffer. Return false if the data buffer does not contain an image header of the expected format, else true. More...
 
virtual void setByteOrder (ByteOrder byteOrder)
 Set the byte order.
 
virtual void setOffset (uint32_t offset)
 Set the offset to the start of the root directory.
 
Accessors
virtual DataBuf write () const
 Return the image header in binary format. The caller owns this data and DataBuf ensures that it will be deleted. More...
 
virtual void print (std::ostream &os, const std::string &prefix="") const
 Print debug info for the image header to os. More...
 
virtual ByteOrder byteOrder () const
 Return the byte order (little or big endian).
 
virtual uint32_t offset () const
 Return the offset to the start of the root directory.
 
virtual uint32_t size () const
 Return the size (in bytes) of the image header.
 
virtual uint16_t tag () const
 Return the tag value (magic number) which identifies the buffer as TIFF data.
 
virtual bool isImageTag (uint16_t tag, IfdId group, const PrimaryGroups *pPrimaryGroups) const
 Return true if the Exif tag from group is an image tag. More...
 

Detailed Description

Abstract base class defining the interface of an image header. Used internally by classes for TIFF-based images. Default implementation is for the regular TIFF header.

Member Function Documentation

◆ isImageTag()

bool Exiv2::Internal::TiffHeaderBase::isImageTag ( uint16_t  tag,
IfdId  group,
const PrimaryGroups pPrimaryGroups 
) const
virtual

Return true if the Exif tag from group is an image tag.

Certain tags of TIFF and TIFF-like images are required to correctly display the primary image. These image tags contain image data rather than metadata.

Parameters
tagTag number.
groupGroup identifier.
pPrimaryGroupsPointer to a list of TIFF groups that contain primary images, empty if none are marked.
Returns
The default implementation returns false.

Reimplemented in Exiv2::Internal::TiffHeader, and Exiv2::Internal::Cr2Header.

Referenced by Exiv2::Internal::TiffCopier::copyObject().

◆ print()

void Exiv2::Internal::TiffHeaderBase::print ( std::ostream &  os,
const std::string &  prefix = "" 
) const
virtual

Print debug info for the image header to os.

Parameters
osOutput stream to write to.
prefixPrefix to be written before each line of output.

◆ read()

bool Exiv2::Internal::TiffHeaderBase::read ( const byte pData,
uint32_t  size 
)
virtual

Read the image header from a data buffer. Return false if the data buffer does not contain an image header of the expected format, else true.

Parameters
pDataPointer to the data buffer.
sizeNumber of bytes in the data buffer.
Returns
True if the TIFF header was read successfully. False if the data buffer does not contain a valid TIFF header.

Reimplemented in Exiv2::Internal::OrfHeader, and Exiv2::Internal::Cr2Header.

References Exiv2::getULong(), Exiv2::getUShort(), and size().

Referenced by Exiv2::isRw2Type(), Exiv2::isTiffType(), Exiv2::Internal::Nikon3MnHeader::read(), and Exiv2::TiffImage::writeMetadata().

◆ write()

DataBuf Exiv2::Internal::TiffHeaderBase::write ( ) const
virtual

Return the image header in binary format. The caller owns this data and DataBuf ensures that it will be deleted.

Returns
Binary header data.

Reimplemented in Exiv2::Internal::OrfHeader, Exiv2::Internal::Rw2Header, and Exiv2::Internal::Cr2Header.

References Exiv2::DataBuf::pData_, Exiv2::ul2Data(), and Exiv2::us2Data().

Referenced by Exiv2::Internal::Nikon3MnHeader::write().


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