#include <tiffvisitor_int.hpp>
Inheritance diagram for Exiv2::Internal::TiffEncoder:
Public Member Functions | |
Creators | |
TiffEncoder (const ExifData &exifData, const IptcData &iptcData, const XmpData &xmpData, TiffComponent *pRoot, ByteOrder byteOrder, FindEncoderFct findEncoderFct) | |
Constructor, taking the root element of the composite to encode to, the image with the metadata to encode and a function to find special encoders. | |
virtual | ~TiffEncoder () |
Virtual destructor. | |
Manipulators | |
virtual void | visitEntry (TiffEntry *object) |
Encode a TIFF entry. | |
virtual void | visitDataEntry (TiffDataEntry *object) |
Encode a TIFF data entry. | |
virtual void | visitImageEntry (TiffImageEntry *object) |
Encode a TIFF image entry. | |
virtual void | visitSizeEntry (TiffSizeEntry *object) |
Encode a TIFF size entry. | |
virtual void | visitDirectory (TiffDirectory *object) |
Encode a TIFF directory. | |
virtual void | visitDirectoryNext (TiffDirectory *object) |
Update directory entries. | |
virtual void | visitSubIfd (TiffSubIfd *object) |
Encode a TIFF sub-IFD. | |
virtual void | visitMnEntry (TiffMnEntry *object) |
Encode a TIFF makernote. | |
virtual void | visitIfdMakernote (TiffIfdMakernote *object) |
Encode an IFD makernote. | |
virtual void | visitIfdMakernoteEnd (TiffIfdMakernote *object) |
Reset encoder to its original state, undo makernote specific settings. | |
virtual void | visitBinaryArray (TiffBinaryArray *object) |
Encode a binary array. | |
virtual void | visitBinaryArrayEnd (TiffBinaryArray *object) |
Re-encrypt binary array if necessary. | |
virtual void | visitBinaryElement (TiffBinaryElement *object) |
Encode an element of a binary array. | |
void | encodeTiffComponent (TiffEntryBase *object, const Exifdatum *datum=0) |
Top level encoder function. Determines how to encode each TIFF component. This function is called by the visit methods of the encoder as well as the add() method. | |
void | encodeBinaryElement (TiffBinaryElement *object, const Exifdatum *datum) |
Callback encoder function for an element of a binary array. | |
void | encodeBinaryArray (TiffBinaryArray *object, const Exifdatum *datum) |
Callback encoder function for a binary array. | |
void | encodeDataEntry (TiffDataEntry *object, const Exifdatum *datum) |
Callback encoder function for a data entry. | |
void | encodeTiffEntry (TiffEntry *object, const Exifdatum *datum) |
Callback encoder function for a standard TIFF entry. | |
void | encodeImageEntry (TiffImageEntry *object, const Exifdatum *datum) |
Callback encoder function for an image entry. | |
void | encodeMnEntry (TiffMnEntry *object, const Exifdatum *datum) |
Callback encoder function for a Makernote entry. | |
void | encodeSizeEntry (TiffSizeEntry *object, const Exifdatum *datum) |
Callback encoder function for a size entry. | |
void | encodeSubIfd (TiffSubIfd *object, const Exifdatum *datum) |
Callback encoder function for a sub-IFD entry. | |
void | encodeTiffEntryBase (TiffEntryBase *object, const Exifdatum *datum) |
Special encoder function for the base part of a TIFF entry. | |
void | encodeOffsetEntry (TiffEntryBase *object, const Exifdatum *datum) |
Special encoder function for an offset entry. | |
void | encodeIptc (TiffEntryBase *object, const Exifdatum *datum) |
Special encoder function to encode IPTC data to an IPTCNAA or Photoshop ImageResources tag. | |
void | add (TiffComponent *pRootDir, TiffComponent *pSourceDir, uint32_t root) |
Add metadata from image to the TIFF composite. | |
void | setDirty (bool flag=true) |
Set the dirty flag and end of traversing signal. | |
Accessors | |
ByteOrder | byteOrder () const |
Return the applicable byte order. May be different for the Makernote and the rest of the TIFF entries. | |
bool | dirty () const |
True if any tag was deleted or allocated in the process of visiting a TIFF composite tree. | |
WriteMethod | writeMethod () const |
Return the write method used. |
For non-intrusive writing, the encoder is used as a visitor (by passing it to the accept() member of a TiffComponent). The composite tree is then traversed and metadata from the image is used to encode each existing component.
For intrusive writing, add() is called, which loops through the metadata and creates and populates corresponding TiffComponents as needed.
|
Add metadata from image to the TIFF composite. For each Exif metadatum, the corresponding TiffComponent is created if necessary and populated using encodeTiffComponent(). The add() function is used during intrusive writing, to create a new TIFF structure.
|
|
Top level encoder function. Determines how to encode each TIFF component. This function is called by the visit methods of the encoder as well as the add() method. If no datum is provided, search the metadata based on tag and group of the object. This is the case if the function is called from a visit method. Then check if a special encoder function is registered for the tag, and if so use it to encode the object. Else use the callback encoder function at the object (which results in a double-dispatch to the appropriate encoding function of the encoder.
|