Exiv2
image.hpp
Go to the documentation of this file.
1 // ***************************************************************** -*- C++ -*-
2 /*
3  * Copyright (C) 2004-2018 Exiv2 authors
4  * This program is part of the Exiv2 distribution.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA.
19  */
23 #ifndef IMAGE_HPP_
24 #define IMAGE_HPP_
25 
26 // *****************************************************************************
27 #include "exiv2lib_export.h"
28 
29 // included header files
30 #include "basicio.hpp"
31 #include "exif.hpp"
32 #include "iptc.hpp"
33 #include "xmp_exiv2.hpp"
34 
35 // + standard includes
36 #include <string>
37 #include <vector>
38 
39 // *****************************************************************************
40 // namespace extensions
41 namespace Exiv2 {
42 
43 // *****************************************************************************
44 // class definitions
45 
47  namespace ImageType {
48  const int none = 0;
49  }
50 
52  struct NativePreview {
53  long position_;
54  uint32_t size_;
55  uint32_t width_;
56  uint32_t height_;
59  };
60 
62  typedef std::vector<NativePreview> NativePreviewList;
63 
67  typedef enum { kpsNone, kpsBasic, kpsXMP, kpsRecursive
68  , kpsIccProfile , kpsIptcErase
70 
81  class EXIV2API Image {
82  public:
84  typedef std::auto_ptr<Image> AutoPtr;
85 
87 
88 
93  Image(int imageType,
94  uint16_t supportedMetadata,
95  BasicIo::AutoPtr io);
97  virtual ~Image();
99 
101 
102 
109  virtual void printStructure(std::ostream& out, PrintStructureOption option =kpsNone, int depth=0);
123  virtual void readMetadata() =0;
136  virtual void writeMetadata() =0;
142  virtual void setExifData(const ExifData& exifData);
147  virtual void clearExifData();
153  virtual void setIptcData(const IptcData& iptcData);
158  virtual void clearIptcData();
170  virtual void setXmpPacket(const std::string& xmpPacket);
183  virtual void clearXmpPacket();
196  virtual void setXmpData(const XmpData& xmpData);
210  virtual void clearXmpData();
216  virtual void setComment(const std::string& comment);
221  virtual void clearComment();
228  virtual void setIccProfile(DataBuf& iccProfile,bool bTestValid=true);
233  virtual void clearIccProfile();
238  virtual bool iccProfileDefined() { return iccProfile_.size_?true:false;}
239 
243  virtual DataBuf* iccProfile() { return &iccProfile_; }
250  virtual void setMetadata(const Image& image);
255  virtual void clearMetadata();
267  virtual ExifData& exifData();
279  virtual IptcData& iptcData();
291  virtual XmpData& xmpData();
295  virtual std::string& xmpPacket();
310  void writeXmpFromPacket(bool flag);
320  void setByteOrder(ByteOrder byteOrder);
321 
327  void printTiffStructure(BasicIo& io,std::ostream& out, PrintStructureOption option,int depth,size_t offset=0);
328 
332  void printIFDStructure(BasicIo& io, std::ostream& out, Exiv2::PrintStructureOption option,uint32_t start,bool bSwap,char c,int depth);
333 
337  bool isBigEndianPlatform();
338 
342  bool isLittleEndianPlatform();
343 
344  bool isStringType(uint16_t type);
345  bool isShortType(uint16_t type);
346  bool isLongType(uint16_t type);
347  bool isLongLongType(uint16_t type);
348  bool isRationalType(uint16_t type);
349  bool is2ByteType(uint16_t type);
350  bool is4ByteType(uint16_t type);
351  bool is8ByteType(uint16_t type);
352  bool isPrintXMP(uint16_t type, Exiv2::PrintStructureOption option);
353  bool isPrintICC(uint16_t type, Exiv2::PrintStructureOption option);
354 
355  uint64_t byteSwap(uint64_t value,bool bSwap) const;
356  uint32_t byteSwap(uint32_t value,bool bSwap) const;
357  uint16_t byteSwap(uint16_t value,bool bSwap) const;
358  uint16_t byteSwap2(const DataBuf& buf,size_t offset,bool bSwap) const;
359  uint32_t byteSwap4(const DataBuf& buf,size_t offset,bool bSwap) const;
360  uint64_t byteSwap8(const DataBuf& buf,size_t offset,bool bSwap) const;
361 
363 
365 
366 
370  ByteOrder byteOrder() const;
376  bool good() const;
387  virtual std::string mimeType() const =0;
391  virtual int pixelWidth() const;
395  virtual int pixelHeight() const;
407  virtual const ExifData& exifData() const;
419  virtual const IptcData& iptcData() const;
431  virtual const XmpData& xmpData() const;
435  virtual std::string comment() const;
439  virtual const std::string& xmpPacket() const;
454  virtual BasicIo& io() const;
461  AccessMode checkMode(MetadataId metadataId) const;
466  bool supportsMetadata(MetadataId metadataId) const;
468  bool writeXmpFromPacket() const;
470  const NativePreviewList& nativePreviews() const;
472 
475  int imageType,
476  uint16_t supportedMetadata
477  ) {
478  imageType_ = imageType;
479  supportedMetadata_ = supportedMetadata;
480  }
481 
483  int imageType() const { return imageType_; }
484 
485  protected:
486  // DATA
497 
499  const std::string& tagName(uint16_t tag);
500 
502  const char* typeName(uint16_t tag) const;
503 
504  private:
506 
507  Image(const Image& rhs);
510  Image& operator=(const Image& rhs);
512 
513  // DATA
514  int imageType_;
515  uint16_t supportedMetadata_;
516  bool writeXmpFromPacket_;
517  ByteOrder byteOrder_;
518 
519  std::map<int,std::string> tags_;
520  bool init_;
521 
522  }; // class Image
523 
525  typedef Image::AutoPtr (*NewInstanceFct)(BasicIo::AutoPtr io, bool create);
527  typedef bool (*IsThisTypeFct)(BasicIo& iIo, bool advance);
528 
534  class EXIV2API ImageFactory {
535  friend bool Image::good() const;
536  public:
551  static BasicIo::AutoPtr createIo(const std::string& path, bool useCurl = true);
552 #ifdef EXV_UNICODE_PATH
553 
557  static BasicIo::AutoPtr createIo(const std::wstring& wpath, bool useCurl = true);
558 #endif
559 
572  static Image::AutoPtr open(const std::string& path, bool useCurl = true);
573 #ifdef EXV_UNICODE_PATH
574 
578  static Image::AutoPtr open(const std::wstring& wpath, bool useCurl = true);
579 #endif
580 
591  static Image::AutoPtr open(const byte* data, long size);
609  static Image::AutoPtr open(BasicIo::AutoPtr io);
619  static Image::AutoPtr create(int type, const std::string& path);
620 #ifdef EXV_UNICODE_PATH
621 
625  static Image::AutoPtr create(int type, const std::wstring& wpath);
626 #endif
627 
635  static Image::AutoPtr create(int type);
650  static Image::AutoPtr create(int type, BasicIo::AutoPtr io);
657  static int getType(const std::string& path);
658 #ifdef EXV_UNICODE_PATH
659 
663  static int getType(const std::wstring& wpath);
664 #endif
665 
672  static int getType(const byte* data, long size);
680  static int getType(BasicIo& io);
689  static AccessMode checkMode(int type, MetadataId metadataId);
710  static bool checkType(int type, BasicIo& io, bool advance);
711 
712  private:
714 
715  ImageFactory();
718  ImageFactory(const ImageFactory& rhs);
720 
721  }; // class ImageFactory
722 
723 // *****************************************************************************
724 // template, inline and free functions
725 
727  EXIV2API void append(Exiv2::Blob& blob, const byte* buf, uint32_t len);
728 
729 } // namespace Exiv2
730 
731 #endif // #ifndef IMAGE_HPP_
quicktimevideo.hpp
An Image subclass to support Quick Time video files.
Exiv2::Image::iccProfile
virtual DataBuf * iccProfile()
return iccProfile
Definition: image.hpp:243
Exiv2::newMkvInstance
EXIV2LIB_DEPRECATED_EXPORT Image::AutoPtr newMkvInstance(BasicIo::AutoPtr io, bool create)
Create a new MatroskaVideo instance and return an auto-pointer to it. Caller owns the returned object...
Exiv2::ImageType::sr2
const int sr2
SR2 image type (see class TiffImage)
Definition: tiffimage.hpp:47
Exiv2::BasicIo::open
virtual int open()=0
Open the IO source using the default access mode. The default mode should allow for reading and writi...
image_int.hpp
Internal image helpers.
Exiv2::ImageFactory::checkMode
static AccessMode checkMode(int type, MetadataId metadataId)
Returns the access mode or supported metadata functions for an image type and a metadata type.
Definition: image.cpp:794
Exiv2::MemIo
Provides binary IO on blocks of memory by implementing the BasicIo interface. A copy-on-write impleme...
Definition: basicio.hpp:540
Exiv2::ImageType::pgf
const int pgf
PGF image type (see class PgfImage)
Definition: pgfimage.hpp:50
Exiv2::ExifData::clear
void clear()
Delete all Exifdatum instances resulting in an empty container. Note that this also removes thumbnail...
Definition: exif.cpp:587
Exiv2::ImageType::crw
const int crw
CRW image type (see class CrwImage)
Definition: crwimage.hpp:52
Exiv2::ImageType::xmp
const int xmp
XMP sidecar files (see class XmpSidecar)
Definition: xmpsidecar.hpp:45
Exiv2::isXmpType
EXIV2API bool isXmpType(BasicIo &iIo, bool advance)
Check if the file iIo is an XMP sidecar file.
Definition: xmpsidecar.cpp:209
Exiv2::Image::xmpPacket_
std::string xmpPacket_
XMP packet.
Definition: image.hpp:493
Exiv2::NativePreview::filter_
std::string filter_
Filter.
Definition: image.hpp:57
Exiv2::isOrfType
EXIV2API bool isOrfType(BasicIo &iIo, bool advance)
Check if the file iIo is an ORF image.
Definition: orfimage.cpp:222
Exiv2::ImageType::exv
const int exv
EXV image type (see class ExvImage)
Definition: jpgimage.hpp:52
Exiv2::isQTimeType
EXIV2LIB_DEPRECATED_EXPORT bool isQTimeType(BasicIo &iIo, bool advance)
Check if the file iIo is a Quick Time Video.
tgaimage.hpp
Truevision TARGA v2 image, implemented using the following references: Truevision TGA page on Wikiped...
Exiv2::BasicIo::error
virtual int error() const =0
Returns 0 if the IO source is in a valid state, otherwise nonzero.
Exiv2::DataBuf::pData_
byte * pData_
Pointer to the buffer, 0 if none has been allocated.
Definition: types.hpp:269
nikonmn_int.hpp
Nikon makernote tags. References: [1] MakerNote EXIF Tag of the Nikon 990 by Max Lyons [2] Exif fil...
Exiv2::Image::iptcData_
IptcData iptcData_
IPTC data container.
Definition: image.hpp:489
psdimage.hpp
Photoshop image, implemented using the following references: Adobe Photoshop 6.0 File Format Specific...
Exiv2::newGifInstance
EXIV2API Image::AutoPtr newGifInstance(BasicIo::AutoPtr io, bool create)
Create a new GifImage instance and return an auto-pointer to it. Caller owns the returned object and ...
Definition: gifimage.cpp:106
Exiv2::tiffFloat
@ tiffFloat
TIFF FLOAT type, single precision (4-byte) IEEE format.
Definition: types.hpp:141
Exiv2::Image::clearIptcData
virtual void clearIptcData()
Erase any buffered IPTC data. IPTC data is not removed from the actual image until the writeMetadata(...
Definition: image.cpp:627
Exiv2::Internal::indent
std::string indent(int32_t d)
indent output for kpsRecursive in printStructure() .
Definition: image_int.cpp:106
Exiv2::FileIo
Provides binary file IO by implementing the BasicIo interface.
Definition: basicio.hpp:296
Exiv2::Image::pixelWidth
virtual int pixelWidth() const
Return the pixel width of the image.
Definition: image.cpp:708
Exiv2::Image::Image
Image(int imageType, uint16_t supportedMetadata, BasicIo::AutoPtr io)
Constructor taking the image type, a bitmap of the supported metadata types and an auto-pointer that ...
Definition: image.cpp:165
Exiv2::IoCloser
Utility class that closes a BasicIo instance upon destruction. Meant to be used as a stack variable i...
Definition: basicio.hpp:264
exif.hpp
Encoding and decoding of Exif data.
crwimage.hpp
Class CrwImage to access Canon CRW images. References: The Canon RAW (CRW) File Format by Phil Harv...
Exiv2::BasicIo::Position
Position
Seek starting positions.
Definition: basicio.hpp:61
Exiv2::ImageFactory
Returns an Image instance of the specified type.
Definition: image.hpp:534
Exiv2::newEpsInstance
EXIV2LIB_DEPRECATED_EXPORT Image::AutoPtr newEpsInstance(BasicIo::AutoPtr io, bool create)
Create a new EpsImage instance and return an auto-pointer to it. Caller owns the returned object and ...
Definition: epsimage.cpp:1154
Exiv2::ImageType::tiff
const int tiff
TIFF image type (see class TiffImage)
Definition: tiffimage.hpp:42
bmpimage.hpp
Windows Bitmap (BMP) image.
tiffvisitor_int.hpp
Internal operations on a TIFF composite tree, implemented as visitor classes.
Exiv2::isCr2Type
EXIV2API bool isCr2Type(BasicIo &iIo, bool advance)
Check if the file iIo is a CR2 image.
Definition: cr2image.cpp:212
Exiv2::Image::nativePreviews_
NativePreviewList nativePreviews_
list of native previews
Definition: image.hpp:496
Exiv2::ImageFactory::checkType
static bool checkType(int type, BasicIo &io, bool advance)
Determine if the content of io is an image of type.
Definition: image.cpp:821
Exiv2::NativePreview::width_
uint32_t width_
Width.
Definition: image.hpp:55
Exiv2::Image::typeName
const char * typeName(uint16_t tag) const
Return tag type for given tag id.
Definition: image.cpp:321
Exiv2::Image::isBigEndianPlatform
bool isBigEndianPlatform()
is the host platform bigEndian
Definition: image.cpp:249
Exiv2::undefined
@ undefined
Exif UNDEFINED type, an 8-bit byte that may contain anything.
Definition: types.hpp:137
Exiv2::isGifType
EXIV2API bool isGifType(BasicIo &iIo, bool advance)
Check if the file iIo is a GIF image.
Definition: gifimage.cpp:116
Exiv2::getType
TypeId getType()
Template to determine the TypeId for a type T.
Exiv2::XmpParser::omitAllFormatting
@ omitAllFormatting
Omit all formatting whitespace.
Definition: xmp_exiv2.hpp:285
Exiv2::ImageType::nef
const int nef
NEF image type (see class TiffImage)
Definition: tiffimage.hpp:44
matroskavideo.hpp
An Image subclass to support Matroska video files.
Exiv2::ImageType::cr2
const int cr2
CR2 image type (see class Cr2Image)
Definition: cr2image.hpp:45
Exiv2::Image::comment_
std::string comment_
User comment.
Definition: image.hpp:492
Exiv2::isAsfType
EXIV2LIB_DEPRECATED_EXPORT bool isAsfType(BasicIo &iIo, bool advance)
Check if the file iIo is a Windows Asf Video.
Exiv2::ImageType::bmp
const int bmp
Windows bitmap (bmp) image type (see class BmpImage)
Definition: bmpimage.hpp:45
Exiv2::signedLongLong
@ signedLongLong
Exif LONG LONG type, 64-bit (8-byte) signed integer.
Definition: types.hpp:145
Exiv2::signedShort
@ signedShort
Exif SSHORT type, a 16-bit (2-byte) signed (twos-complement) integer.
Definition: types.hpp:138
Exiv2::isExvType
EXIV2API bool isExvType(BasicIo &iIo, bool advance)
Check if the file iIo is an EXV file.
Definition: jpgimage.cpp:1412
Exiv2::makeSlice
Slice< T > makeSlice(T &cont, size_t begin, size_t end)
Return a new slice with the given bounds.
Definition: slice.hpp:673
Exiv2::comment
@ comment
Exiv2 type for the Exif user comment.
Definition: types.hpp:150
Exiv2::XmpData::clear
void clear()
Delete all Xmpdatum instances resulting in an empty container.
Definition: xmp.cpp:345
Exiv2::asciiString
@ asciiString
Exif ASCII type, 8-bit byte.
Definition: types.hpp:132
Exiv2::NativePreview
Native preview information. This is meant to be used only by the PreviewManager.
Definition: image.hpp:52
Exiv2::Image::comment
virtual std::string comment() const
Return a copy of the image comment. May be an empty string.
Definition: image.cpp:733
Exiv2::Image::nativePreviews
const NativePreviewList & nativePreviews() const
Return list of native previews. This is meant to be used only by the PreviewManager.
Definition: image.cpp:753
Exiv2::strError
EXIV2API std::string strError()
Return a system error message and the error code (errno). See strerror(3).
Definition: futils.cpp:352
Exiv2::ImageType::mrw
const int mrw
MRW image type (see class MrwImage)
Definition: mrwimage.hpp:46
Exiv2::Image::pixelHeight
virtual int pixelHeight() const
Return the pixel height of the image.
Definition: image.cpp:713
Exiv2::Image::setComment
virtual void setComment(const std::string &comment)
Set the image comment. The new comment is not written to the image until the writeMetadata() method i...
Definition: image.cpp:678
Exiv2::ImageType::gif
const int gif
GIF image type (see class GifImage)
Definition: gifimage.hpp:46
Exiv2::isMrwType
EXIV2API bool isMrwType(BasicIo &iIo, bool advance)
Check if the file iIo is a MRW image.
Definition: mrwimage.cpp:171
Exiv2::Internal::iopTagList
const TagInfo * iopTagList()
Return read-only list of built-in IOP tags.
Definition: tags_int.cpp:2034
Exiv2::ImageType::raf
const int raf
RAF image type (see class RafImage)
Definition: rafimage.hpp:50
Exiv2::HttpIo
Provides the http read/write access for the RemoteIo.
Definition: basicio.hpp:1015
Exiv2::isRw2Type
EXIV2API bool isRw2Type(BasicIo &iIo, bool advance)
Check if the file iIo is a RW2 image.
Definition: rw2image.cpp:256
Exiv2::Image::exifData_
ExifData exifData_
Exif data container.
Definition: image.hpp:488
Exiv2::newTiffInstance
EXIV2API Image::AutoPtr newTiffInstance(BasicIo::AutoPtr io, bool create)
Create a new TiffImage instance and return an auto-pointer to it. Caller owns the returned object and...
Definition: tiffimage.cpp:310
Exiv2::Image::printIFDStructure
void printIFDStructure(BasicIo &io, std::ostream &out, Exiv2::PrintStructureOption option, uint32_t start, bool bSwap, char c, int depth)
Print out the structure of a TIFF IFD.
Definition: image.cpp:349
Exiv2::isPgfType
EXIV2API bool isPgfType(BasicIo &iIo, bool advance)
Check if the file iIo is a PGF image.
Definition: pgfimage.cpp:333
Exiv2::isTiffType
EXIV2API bool isTiffType(BasicIo &iIo, bool advance)
Check if the file iIo is a TIFF image.
Definition: tiffimage.cpp:319
Exiv2::unsignedLong
@ unsignedLong
Exif LONG type, 32-bit (4-byte) unsigned integer.
Definition: types.hpp:134
asfvideo.hpp
An Image subclass to support ASF video files.
Exiv2::tiffIfd8
@ tiffIfd8
TIFF IFD type, 64-bit (8-byte) unsigned integer.
Definition: types.hpp:146
Exiv2::Image::setIptcData
virtual void setIptcData(const IptcData &iptcData)
Assign new IPTC data. The new IPTC data is not written to the image until the writeMetadata() method ...
Definition: image.cpp:632
gifimage.hpp
GIF image, implemented using the following references: GIF89 specification by W3C
Exiv2::isTgaType
EXIV2API bool isTgaType(BasicIo &iIo, bool advance)
Check if the file iIo is a Targa v2 image.
Definition: tgaimage.cpp:138
Exiv2::Image::setTypeSupported
void setTypeSupported(int imageType, uint16_t supportedMetadata)
set type support for this image format
Definition: image.hpp:474
Exiv2::Internal::binaryToString
binaryToStringHelper< T > binaryToString(const Slice< T > sl)
format binary data for display in Image::printStructure()
Definition: image_int.hpp:125
Exiv2::tiffDouble
@ tiffDouble
TIFF DOUBLE type, double precision (8-byte) IEEE format.
Definition: types.hpp:142
Exiv2::IptcData::clear
void clear()
Delete all Iptcdatum instances resulting in an empty container.
Definition: iptc.hpp:218
Exiv2::Image::iccProfileDefined
virtual bool iccProfileDefined()
Erase iccProfile. the profile is not removed from the actual image until the writeMetadata() method i...
Definition: image.hpp:238
cr2image.hpp
Class Cr2Image.
Exiv2::Image::pixelHeight_
int pixelHeight_
image pixel height
Definition: image.hpp:495
Exiv2::isPsdType
EXIV2API bool isPsdType(BasicIo &iIo, bool advance)
Check if the file iIo is a Photoshop image.
Definition: psdimage.cpp:702
Exiv2::ImageType::psd
const int psd
Photoshop (PSD) image type (see class PsdImage)
Definition: psdimage.hpp:48
Exiv2::pathOfFileUrl
EXIV2API std::string pathOfFileUrl(const std::string &url)
Get the path of file URL.
Definition: futils.cpp:337
Exiv2::newJpegInstance
EXIV2API Image::AutoPtr newJpegInstance(BasicIo::AutoPtr io, bool create)
Create a new JpegImage instance and return an auto-pointer to it. Caller owns the returned object and...
Definition: jpgimage.cpp:1351
rafimage.hpp
Fujifilm RAW image.
Exiv2::isWebPType
EXIV2API bool isWebPType(BasicIo &iIo, bool advance)
Check if the file iIo is a WebP Video.
Definition: webpimage.cpp:749
Exiv2::newRiffInstance
EXIV2LIB_DEPRECATED_EXPORT Image::AutoPtr newRiffInstance(BasicIo::AutoPtr io, bool create)
Create a new RiffVideo instance and return an auto-pointer to it. Caller owns the returned object and...
Exiv2::Image::clearMetadata
virtual void clearMetadata()
Erase all buffered metadata. Metadata is not removed from the actual image until the writeMetadata() ...
Definition: image.cpp:561
Exiv2::newCr2Instance
EXIV2API Image::AutoPtr newCr2Instance(BasicIo::AutoPtr io, bool create)
Create a new Cr2Image instance and return an auto-pointer to it. Caller owns the returned object and ...
Definition: cr2image.cpp:203
Exiv2::Image::clearXmpData
virtual void clearXmpData()
Erase any buffered XMP data. XMP data is not removed from the actual image until the writeMetadata() ...
Definition: image.cpp:652
Exiv2::Internal::Nikon1MakerNote::tagList
static const TagInfo * tagList()
Return read-only list of built-in Nikon1 tags.
Definition: nikonmn_int.cpp:264
Exiv2::newQTimeInstance
EXIV2LIB_DEPRECATED_EXPORT Image::AutoPtr newQTimeInstance(BasicIo::AutoPtr io, bool create)
Create a new QuicktimeVideo instance and return an auto-pointer to it. Caller owns the returned objec...
Exiv2::ImageType::asf
const int asf
Treating asf as an image type>
Definition: asfvideo.hpp:43
enforce.hpp
Port of D's enforce() to C++ & Exiv2.
Exiv2::tiffIfd
@ tiffIfd
TIFF IFD type, 32-bit (4-byte) unsigned integer.
Definition: types.hpp:143
Exiv2::NativePreview::position_
long position_
Position.
Definition: image.hpp:53
Exiv2::Image::setMetadata
virtual void setMetadata(const Image &image)
Copy all existing metadata from source Image. The data is copied into internal buffers and is not wri...
Definition: image.cpp:597
Exiv2::ImageFactory::open
static Image::AutoPtr open(const std::string &path, bool useCurl=true)
Create an Image subclass of the appropriate type by reading the specified file. Image type is derived...
Definition: image.cpp:913
Exiv2::NativePreview::size_
uint32_t size_
Size.
Definition: image.hpp:54
Exiv2::ImageType::jp2
const int jp2
JPEG-2000 image type.
Definition: jp2image.hpp:45
Exiv2::MetadataId
MetadataId
An identifier for each type of metadata.
Definition: types.hpp:119
Exiv2::DataBuf::free
void free()
Free the internal buffer and reset the size to 0.
Definition: types.cpp:180
Exiv2::Image::clearComment
virtual void clearComment()
Erase any buffered comment. Comment is not removed from the actual image until the writeMetadata() me...
Definition: image.cpp:673
Exiv2::newExvInstance
EXIV2API Image::AutoPtr newExvInstance(BasicIo::AutoPtr io, bool create)
Create a new ExvImage instance and return an auto-pointer to it. Caller owns the returned object and ...
Definition: jpgimage.cpp:1404
Exiv2::Image::isLittleEndianPlatform
bool isLittleEndianPlatform()
is the host platform littleEndian
Definition: image.cpp:258
slice.hpp
Simple implementation of slices (=views) for STL containers and C-arrays.
xmpsidecar.hpp
An Image subclass to support XMP sidecar files.
Exiv2::Internal::stringFormat
std::string stringFormat(const char *format,...)
format a string in the pattern of sprintf .
Definition: image_int.cpp:32
pgfimage.hpp
PGF image, implemented using the following references: PGF specification from libpgf web site
Exiv2::unsignedRational
@ unsignedRational
Exif RATIONAL type, two LONGs: numerator and denumerator of a fraction.
Definition: types.hpp:135
Exiv2::Image::supportsMetadata
bool supportsMetadata(MetadataId metadataId) const
Check if image supports a particular type of metadata. This method is deprecated. Use checkMode() ins...
Definition: image.cpp:765
Exiv2::Image::setByteOrder
void setByteOrder(ByteOrder byteOrder)
Set the byte order to encode the Exif metadata in.
Definition: image.cpp:698
Exiv2::ImageFactory::getType
static int getType(const std::string &path)
Returns the image type of the provided file.
Definition: image.cpp:830
Exiv2::Image::byteOrder
ByteOrder byteOrder() const
Return the byte order in which the Exif metadata of the image is encoded. Initially,...
Definition: image.cpp:703
Exiv2::newRafInstance
EXIV2API Image::AutoPtr newRafInstance(BasicIo::AutoPtr io, bool create)
Create a new RafImage instance and return an auto-pointer to it. Caller owns the returned object and ...
Definition: rafimage.cpp:343
Exiv2::newXmpInstance
EXIV2API Image::AutoPtr newXmpInstance(BasicIo::AutoPtr io, bool create)
Create a new XmpSidecar instance and return an auto-pointer to it. Caller owns the returned object an...
Definition: xmpsidecar.cpp:200
Exiv2::IptcData::printStructure
static void printStructure(std::ostream &out, const Slice< byte * > &bytes, uint32_t depth)
dump iptc formatted binary data (used by printStructure kpsRecursive)
Definition: iptc.cpp:352
tiffimage_int.hpp
Internal class TiffParserWorker to parse TIFF data.
Exiv2::newOrfInstance
EXIV2API Image::AutoPtr newOrfInstance(BasicIo::AutoPtr io, bool create)
Create a new OrfImage instance and return an auto-pointer to it. Caller owns the returned object and ...
Definition: orfimage.cpp:213
Exiv2::append
EXIV2API void append(Exiv2::Blob &blob, const byte *buf, uint32_t len)
Append len bytes pointed to by buf to blob.
Definition: image.cpp:1004
Exiv2::NewInstanceFct
Image::AutoPtr(* NewInstanceFct)(BasicIo::AutoPtr io, bool create)
Type for function pointer that creates new Image instances.
Definition: image.hpp:525
Exiv2::Image::pixelWidth_
int pixelWidth_
image pixel width
Definition: image.hpp:494
enforce
void enforce(bool condition, const T &arg1)
Ensure that condition is true, otherwise throw an exception of the type exception_t.
Definition: enforce.hpp:43
mrwimage.hpp
Minolta RAW image, implemented using the following references: Minolta Raw file format by Dalibor Jel...
Exiv2::Image::good
bool good() const
Check if the Image instance is valid. Use after object construction.
Definition: image.cpp:758
Exiv2::isMkvType
EXIV2LIB_DEPRECATED_EXPORT bool isMkvType(BasicIo &iIo, bool advance)
Check if the file iIo is a Matroska Video.
Exiv2::Image::printTiffStructure
void printTiffStructure(BasicIo &io, std::ostream &out, PrintStructureOption option, int depth, size_t offset=0)
Print out the structure of image file.
Definition: image.cpp:543
Exiv2::ImageFactory::createIo
static BasicIo::AutoPtr createIo(const std::string &path, bool useCurl=true)
Create the appropriate class type implemented BasicIo based on the protocol of the input.
Definition: image.cpp:862
Exiv2::isEpsType
EXIV2LIB_DEPRECATED_EXPORT bool isEpsType(BasicIo &iIo, bool advance)
Check if the file iIo is a EPS image.
Definition: epsimage.cpp:1163
Exiv2::fileProtocol
EXIV2API Protocol fileProtocol(const std::string &path)
Return the protocol of the path.
Definition: futils.cpp:257
riffvideo.hpp
An Image subclass to support RIFF video files.
Exiv2::DataBuf
Utility class containing a character array. All it does is to take care of memory allocation and dele...
Definition: types.hpp:204
Exiv2::unsignedByte
@ unsignedByte
Exif BYTE type, 8-bit unsigned integer.
Definition: types.hpp:131
Exiv2::ImageType::qtime
const int qtime
Treating qtime as an image type>
Definition: quicktimevideo.hpp:46
Exiv2::XmpParser::useCompactFormat
@ useCompactFormat
Use a compact form of RDF.
Definition: xmp_exiv2.hpp:281
Exiv2::isRafType
EXIV2API bool isRafType(BasicIo &iIo, bool advance)
Check if the file iIo is a RAF image.
Definition: rafimage.cpp:352
Exiv2::signedByte
@ signedByte
Exif SBYTE type, an 8-bit signed (twos-complement) integer.
Definition: types.hpp:136
Exiv2::XmpData::count
long count() const
Get the number of metadata entries.
Definition: xmp.cpp:370
Exiv2::DataBuf::size_
long size_
The current size of the buffer.
Definition: types.hpp:271
Exiv2::XmpParser::encode
static int encode(std::string &xmpPacket, const XmpData &xmpData, uint16_t formatFlags=useCompactFormat, uint32_t padding=0)
Encode (serialize) XMP metadata from xmpData into a string xmpPacket. The XMP packet returned in the ...
Definition: xmp.cpp:836
Exiv2::isBmpType
EXIV2API bool isBmpType(BasicIo &iIo, bool advance)
Check if the file iIo is a Windows Bitmap image.
Definition: bmpimage.cpp:132
Exiv2::find
const T * find(T(&src)[N], const K &key)
Find an element that matches key in the array src.
Definition: types.hpp:508
Exiv2::newAsfInstance
EXIV2LIB_DEPRECATED_EXPORT Image::AutoPtr newAsfInstance(BasicIo::AutoPtr io, bool create)
Create a new AsfVideo instance and return an auto-pointer to it. Caller owns the returned object and ...
orfimage.hpp
Olympus RAW image.
Exiv2::ImageType::mkv
const int mkv
Treating mkv as an image type>
Definition: matroskavideo.hpp:45
Exiv2::BasicIo::read
virtual DataBuf read(long rcount)=0
Read data from the IO source. Reading starts at the current IO position and the position is advanced ...
Exiv2::isRiffType
EXIV2LIB_DEPRECATED_EXPORT bool isRiffType(BasicIo &iIo, bool advance)
Check if the file iIo is a Riff Video.
Exiv2::Protocol
Protocol
the collection of protocols.
Definition: futils.hpp:46
Exiv2::unsignedShort
@ unsignedShort
Exif SHORT type, 16-bit (2-byte) unsigned integer.
Definition: types.hpp:133
Exiv2::Image::imageType
int imageType() const
set type support for this image format
Definition: image.hpp:483
Exiv2
Provides classes and functions to encode and decode Exif and Iptc data. The libexiv2 API consists of ...
Definition: asfvideo.hpp:36
Exiv2::Internal::mpfTagList
const TagInfo * mpfTagList()
Return read-only list of built-in mfp Tags http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/MPF....
Definition: tags_int.cpp:2001
Exiv2::XmpData
A container for XMP data. This is a top-level class of the Exiv2 library.
Definition: xmp_exiv2.hpp:173
Exiv2::Image::clearIccProfile
virtual void clearIccProfile()
Erase iccProfile. the profile is not removed from the actual image until the writeMetadata() method i...
Definition: image.cpp:693
Exiv2::signedLong
@ signedLong
Exif SLONG type, a 32-bit (4-byte) signed (twos-complement) integer.
Definition: types.hpp:139
Exiv2::newWebPInstance
EXIV2API Image::AutoPtr newWebPInstance(BasicIo::AutoPtr io, bool create)
Create a new WebPImage instance and return an auto-pointer to it. Caller owns the returned object and...
Definition: webpimage.cpp:740
Exiv2::Image::io
virtual BasicIo & io() const
Return a reference to the BasicIo instance being used for Io.
Definition: image.cpp:743
Exiv2::ImageType::pef
const int pef
PEF image type (see class TiffImage)
Definition: tiffimage.hpp:45
image.hpp
Exiv2::ImageType::none
const int none
Not an image.
Definition: image.hpp:48
Exiv2::ImageType::webp
const int webp
Treating webp as an image type>
Definition: webpimage.hpp:45
Exiv2::Image::clearXmpPacket
virtual void clearXmpPacket()
Erase the buffered XMP packet. XMP data is not removed from the actual image until the writeMetadata(...
Definition: image.cpp:637
Exiv2::BasicIo::path
virtual std::string path() const =0
Return the path to the IO resource. Often used to form comprehensive error messages where only a Basi...
Exiv2::newPngInstance
EXIV2API Image::AutoPtr newPngInstance(BasicIo::AutoPtr io, bool create)
Create a new PngImage instance and return an auto-pointer to it. Caller owns the returned object and ...
Exiv2::signedRational
@ signedRational
Exif SRATIONAL type, two SLONGs: numerator and denumerator of a fraction.
Definition: types.hpp:140
Exiv2::newPgfInstance
EXIV2API Image::AutoPtr newPgfInstance(BasicIo::AutoPtr io, bool create)
Create a new PgfImage instance and return an auto-pointer to it. Caller owns the returned object and ...
Definition: pgfimage.cpp:323
Exiv2::NativePreview::height_
uint32_t height_
Height.
Definition: image.hpp:56
Exiv2::TagInfo
Tag information.
Definition: tags.hpp:82
Exiv2::Internal::exifTagList
const TagInfo * exifTagList()
Return read-only list of built-in Exif IFD tags.
Definition: tags_int.cpp:1757
safe_op.hpp
Overflow checks for integers.
Exiv2::ImageType::orf
const int orf
ORF image type (see class OrfImage)
Definition: orfimage.hpp:45
webpimage.hpp
An Image subclass to support WEBP image files.
Exiv2::Internal::operator==
bool operator==(const TagDetails &td, const LensTypeAndFocalLengthAndMaxAperture &ltfl)
Compare tag details with a lens entry.
Definition: canonmn_int.cpp:1809
Exiv2::ImageType::jpeg
const int jpeg
JPEG image type (see class JpegImage)
Definition: jpgimage.hpp:51
Exiv2::Image::setExifData
virtual void setExifData(const ExifData &exifData)
Assign new Exif data. The new Exif data is not written to the image until the writeMetadata() method ...
Definition: image.cpp:622
Exiv2::Internal::gpsTagList
const TagInfo * gpsTagList()
Return read-only list of built-in GPS tags.
Definition: tags_int.cpp:1931
Exiv2::Image::io_
BasicIo::AutoPtr io_
Image data IO pointer.
Definition: image.hpp:487
Exiv2::BasicIo::size
virtual size_t size() const =0
Get the current size of the IO source in bytes.
Exiv2::ByteOrder
ByteOrder
Type to express the byte order (little or big endian)
Definition: types.hpp:113
Exiv2::Image::iccProfile_
DataBuf iccProfile_
ICC buffer (binary data)
Definition: image.hpp:491
Exiv2::newRw2Instance
EXIV2API Image::AutoPtr newRw2Instance(BasicIo::AutoPtr io, bool create)
Create a new Rw2Image instance and return an auto-pointer to it. Caller owns the returned object and ...
Definition: rw2image.cpp:247
Exiv2::AccessMode
AccessMode
An identifier for each mode of metadata support.
Definition: types.hpp:122
Exiv2::makeSliceUntil
Slice< container > makeSliceUntil(container &cont, size_t end)
Return a new slice spanning until end.
Definition: slice.hpp:710
Exiv2::ImageType::dng
const int dng
DNG image type (see class TiffImage)
Definition: tiffimage.hpp:43
Exiv2::Internal::ifdTagList
const TagInfo * ifdTagList()
Return read-only list of built-in IFD0/1 tags.
Definition: tags_int.cpp:1428
Exiv2::Image::AutoPtr
std::auto_ptr< Image > AutoPtr
Image auto_ptr type.
Definition: image.hpp:84
Exiv2::Image::xmpPacket
virtual std::string & xmpPacket()
Return a modifiable reference to the raw XMP packet.
Definition: image.cpp:586
Exiv2::newBmpInstance
EXIV2API Image::AutoPtr newBmpInstance(BasicIo::AutoPtr io, bool create)
Create a new BmpImage instance and return an auto-pointer to it. Caller owns the returned object and ...
Definition: bmpimage.cpp:123
Exiv2::Image::checkMode
AccessMode checkMode(MetadataId metadataId) const
Returns the access mode, i.e., the metadata functions, which this image supports for the metadata typ...
Definition: image.cpp:770
Exiv2::isCrwType
EXIV2API bool isCrwType(BasicIo &iIo, bool advance)
Check if the file iIo is a CRW image.
Definition: crwimage.cpp:195
pngimage.hpp
PNG image, implemented using the following references: PNG specification by W3C PNG tags list by Phi...
Exiv2::ImageType::riff
const int riff
Treating riff as an image type>
Definition: riffvideo.hpp:46
Safe::add
T add(T summand_1, T summand_2)
Safe addition, throws an exception on overflow.
Definition: safe_op.hpp:295
Exiv2::BasicIo::AutoPtr
std::auto_ptr< BasicIo > AutoPtr
BasicIo auto_ptr type.
Definition: basicio.hpp:58
epsimage.hpp
EPS image. References: [1] Adobe PostScript Language Document Structuring Conventions Specification...
Exiv2::Image::writeXmpFromPacket
bool writeXmpFromPacket() const
Return the flag indicating the source when writing XMP metadata.
Definition: image.cpp:748
Exiv2::XPathIo
Provides binary IO for the data from stdin and data uri path.
Definition: basicio.hpp:761
Exiv2::Error
BasicError< char > Error
Error class used for exceptions (std::string based)
Definition: error.hpp:324
Exiv2::isJpegType
EXIV2API bool isJpegType(BasicIo &iIo, bool advance)
Check if the file iIo is a JPEG image.
Definition: jpgimage.cpp:1360
Exiv2::IptcData
A container for IPTC data. This is a top-level class of the Exiv2 library.
Definition: iptc.hpp:173
Exiv2::Image::setXmpPacket
virtual void setXmpPacket(const std::string &xmpPacket)
Assign a raw XMP packet. The new XMP packet is not written to the image until the writeMetadata() met...
Definition: image.cpp:643
Exiv2::NativePreviewList
std::vector< NativePreview > NativePreviewList
List of native previews. This is meant to be used only by the PreviewManager.
Definition: image.hpp:62
Exiv2::unsignedLongLong
@ unsignedLongLong
Exif LONG LONG type, 64-bit (8-byte) unsigned integer.
Definition: types.hpp:144
Exiv2::ImageType::tga
const int tga
Truevision TARGA (tga) image type (see class TgaImage)
Definition: tgaimage.hpp:47
Exiv2::ImageType::arw
const int arw
ARW image type (see class TiffImage)
Definition: tiffimage.hpp:46
Exiv2::Image::clearExifData
virtual void clearExifData()
Erase any buffered Exif data. Exif data is not removed from the actual image until the writeMetadata(...
Definition: image.cpp:617
Exiv2::ImageType::rw2
const int rw2
RW2 image type (see class Rw2Image)
Definition: rw2image.hpp:45
Exiv2::Image::tagName
const std::string & tagName(uint16_t tag)
Return tag name for given tag id.
Definition: image.cpp:775
Exiv2::TagInfo::tag_
uint16_t tag_
Tag.
Definition: tags.hpp:95
Exiv2::newJp2Instance
EXIV2API Image::AutoPtr newJp2Instance(BasicIo::AutoPtr io, bool create)
Create a new Jp2Image instance and return an auto-pointer to it. Caller owns the returned object and ...
Definition: jp2image.cpp:965
Exiv2::string
@ string
IPTC string type.
Definition: types.hpp:147
Exiv2::newPsdInstance
EXIV2API Image::AutoPtr newPsdInstance(BasicIo::AutoPtr io, bool create)
Create a new PsdImage instance and return an auto-pointer to it. Caller owns the returned object and ...
Definition: psdimage.cpp:692
Exiv2::PrintStructureOption
PrintStructureOption
Options for printStructure.
Definition: image.hpp:67
Exiv2::BasicIo::tell
virtual long tell() const =0
Get the current IO position.
Exiv2::BasicIo::seek
virtual int seek(long offset, Position pos)=0
Move the current IO position.
Exiv2::ErrorCode
ErrorCode
Complete list of all Exiv2 error codes.
Definition: error.hpp:191
Exiv2::ImageType::png
const int png
PNG image type (see class PngImage)
Definition: pngimage.hpp:51
Exiv2::isJp2Type
EXIV2API bool isJp2Type(BasicIo &iIo, bool advance)
Check if the file iIo is a JPEG-2000 image.
Definition: jp2image.cpp:975
Exiv2::BasicIo
An interface for simple binary IO.
Definition: basicio.hpp:55
Exiv2::ImageFactory::create
static Image::AutoPtr create(int type, const std::string &path)
Create an Image subclass of the requested type by creating a new image file. If the file already exis...
Definition: image.cpp:950
Exiv2::FileIo::close
virtual int close()
Flush and unwritten data and close the file . It is safe to call close on an already closed instance.
Definition: basicio.cpp:981
Exiv2::Image::xmpData_
XmpData xmpData_
XMP data container.
Definition: image.hpp:490
Exiv2::FileIo::open
int open(const std::string &mode)
Open the file using using the specified mode.
Definition: basicio.cpp:958
rw2image.hpp
Class Rw2Image.
Exiv2::Image::xmpData
virtual XmpData & xmpData()
Returns an XmpData instance containing currently buffered XMP data.
Definition: image.cpp:581
Exiv2::Image
Abstract base class defining the interface for an image. This is the top-level interface to the Exiv2...
Definition: image.hpp:81
Exiv2::newTgaInstance
EXIV2API Image::AutoPtr newTgaInstance(BasicIo::AutoPtr io, bool create)
Create a new TgaImage instance and return an auto-pointer to it. Caller owns the returned object and ...
Definition: tgaimage.cpp:128
Exiv2::newMrwInstance
EXIV2API Image::AutoPtr newMrwInstance(BasicIo::AutoPtr io, bool create)
Create a new MrwImage instance and return an auto-pointer to it. Caller owns the returned object and ...
Definition: mrwimage.cpp:162
Exiv2::Image::setIccProfile
virtual void setIccProfile(DataBuf &iccProfile, bool bTestValid=true)
Set the image iccProfile. The new profile is not written to the image until the writeMetadata() metho...
Definition: image.cpp:683
Exiv2::NativePreview::mimeType_
std::string mimeType_
MIME type.
Definition: image.hpp:58
Exiv2::IsThisTypeFct
bool(* IsThisTypeFct)(BasicIo &iIo, bool advance)
Type for function pointer that checks image types.
Definition: image.hpp:527
Exiv2::ImageType::srw
const int srw
SRW image type (see class TiffImage)
Definition: tiffimage.hpp:48
Exiv2::newCrwInstance
EXIV2API Image::AutoPtr newCrwInstance(BasicIo::AutoPtr io, bool create)
Create a new CrwImage instance and return an auto-pointer to it. Caller owns the returned object and ...
Definition: crwimage.cpp:186
futils.hpp
Basic file utility functions required by Exiv2.
Exiv2::XmpParser::decode
static int decode(XmpData &xmpData, const std::string &xmpPacket)
Decode XMP metadata from an XMP packet xmpPacket into xmpData. The format of the XMP packet must foll...
Definition: xmp.cpp:723
Exiv2::Image::iptcData
virtual IptcData & iptcData()
Returns an IptcData instance containing currently buffered IPTC data.
Definition: image.cpp:576
Exiv2::getULong
EXIV2API uint32_t getULong(const byte *buf, ByteOrder byteOrder)
Read a 4 byte unsigned long value from the data buffer.
Definition: types.cpp:283
Exiv2::Image::~Image
virtual ~Image()
Virtual Destructor.
Definition: image.cpp:184
error.hpp
Error class for exceptions, log message class.
Exiv2::Image::setXmpData
virtual void setXmpData(const XmpData &xmpData)
Assign new XMP data. The new XMP data is not written to the image until the writeMetadata() method is...
Definition: image.cpp:658
Exiv2::Image::exifData
virtual ExifData & exifData()
Returns an ExifData instance containing currently buffered Exif data.
Definition: image.cpp:571
tiffcomposite_int.hpp
Internal classes used in a TIFF composite structure.
Exiv2::Blob
std::vector< byte > Blob
Container for binary data.
Definition: types.hpp:162
jpgimage.hpp
Class JpegImage to access JPEG images.
iptc.hpp
Encoding and decoding of IPTC data.
Exiv2::ImageType::eps
const int eps
EPS image type.
Definition: epsimage.hpp:53
Exiv2::Image::printStructure
virtual void printStructure(std::ostream &out, PrintStructureOption option=kpsNone, int depth=0)
Print out the structure of image file.
Definition: image.cpp:188
Exiv2::ExifData
A container for Exif data. This is a top-level class of the Exiv2 library. The container holds Exifda...
Definition: exif.hpp:434
Exiv2::isPngType
EXIV2API bool isPngType(BasicIo &iIo, bool advance)
Check if the file iIo is a PNG image.