 |
Exiv2
|
29 #include "exiv2lib_export.h"
89 void setComment(
const std::string&
comment);
94 std::string mimeType()
const;
111 void doWriteMetadata(
BasicIo& oIo);
140 #endif // #ifndef JP2IMAGE_HPP_
Provides binary IO on blocks of memory by implementing the BasicIo interface. A copy-on-write impleme...
Definition: basicio.hpp:540
void clear()
Delete all Exifdatum instances resulting in an empty container. Note that this also removes thumbnail...
Definition: exif.cpp:611
const int xmp
XMP sidecar files (see class XmpSidecar)
Definition: xmpsidecar.hpp:38
std::string xmpPacket_
XMP packet.
Definition: image.hpp:490
virtual int error() const =0
Returns 0 if the IO source is in a valid state, otherwise nonzero.
byte * pData_
Pointer to the buffer, 0 if none has been allocated.
Definition: types.hpp:258
IptcData iptcData_
IPTC data container.
Definition: image.hpp:486
void setComment(const std::string &comment)
Todo: Not supported yet(?). Calling this function will throw an instance of Error(kerInvalidSettingFo...
Definition: jp2image.cpp:161
Utility class that closes a BasicIo instance upon destruction. Meant to be used as a stack variable i...
Definition: basicio.hpp:264
Class to access JPEG-2000 images.
Definition: jp2image.hpp:51
void writeMetadata()
Write metadata back to the image.
Definition: jp2image.cpp:634
static int decode(IptcData &iptcData, const byte *pData, uint32_t size)
Decode binary IPTC data in IPTC IIM4 format from a buffer pData of length size to the provided metada...
Definition: iptc.cpp:433
Slice< T > makeSlice(T &cont, size_t begin, size_t end)
Return a new slice with the given bounds.
Definition: slice.hpp:665
@ comment
Exiv2 type for the Exif user comment.
Definition: types.hpp:139
EXIV2API std::string strError()
Return a system error message and the error code (errno). See strerror(3).
Definition: futils.cpp:316
ExifData exifData_
Exif data container.
Definition: image.hpp:485
static ByteOrder decode(ExifData &exifData, IptcData &iptcData, XmpData &xmpData, const byte *pData, uint32_t size)
Decode metadata from a buffer pData of length size with data in TIFF format to the provided metadata ...
Definition: tiffimage.cpp:248
binaryToStringHelper< T > binaryToString(const Slice< T > sl)
format binary data for display in Image::printStructure()
Definition: image_int.hpp:118
void clear()
Delete all Iptcdatum instances resulting in an empty container.
Definition: iptc.hpp:215
virtual bool iccProfileDefined()
Erase iccProfile. the profile is not removed from the actual image until the writeMetadata() method i...
Definition: image.hpp:235
int pixelHeight_
image pixel height
Definition: image.hpp:492
Jp2Image(BasicIo::AutoPtr io, bool create)
Constructor to open a JPEG-2000 image. Since the constructor can not return a result,...
Definition: jp2image.cpp:135
const int jp2
JPEG-2000 image type.
Definition: jp2image.hpp:45
static WriteMethod encode(Blob &blob, const byte *pData, uint32_t size, ByteOrder byteOrder, const ExifData &exifData)
Encode Exif metadata from the provided metadata to binary Exif format.
Definition: exif.cpp:668
std::string stringFormat(const char *format,...)
format a string in the pattern of sprintf .
Definition: image_int.cpp:32
void setByteOrder(ByteOrder byteOrder)
Set the byte order to encode the Exif metadata in.
Definition: image.cpp:707
std::string mimeType() const
Return the MIME type of the image.
Definition: jp2image.cpp:156
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:347
EXIV2API int16_t getShort(const byte *buf, ByteOrder byteOrder)
Read a 2 byte signed short value from the data buffer.
Definition: types.cpp:313
int pixelWidth_
image pixel width
Definition: image.hpp:491
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:552
Utility class containing a character array. All it does is to take care of memory allocation and dele...
Definition: types.hpp:193
void alloc(long size)
Allocate a data buffer of at least the given size. Note that if the requested size is less than the c...
Definition: types.cpp:156
long size_
The current size of the buffer.
Definition: types.hpp:260
EXIV2API int32_t getLong(const byte *buf, ByteOrder byteOrder)
Read a 4 byte signed long value from the data buffer.
Definition: types.cpp:323
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:1000
virtual bool eof() const =0
Returns true if the IO position has reached the end, otherwise false.
virtual DataBuf read(long rcount)=0
Read data from the IO source. Reading starts at the current IO position and the position is advanced ...
long count() const
Get the number of metadata entries.
Definition: exif.hpp:514
Provides classes and functions to encode and decode Exif and Iptc data. The libexiv2 API consists of ...
Definition: asfvideo.hpp:36
EXIV2API long ul2Data(byte *buf, uint32_t l, ByteOrder byteOrder)
Convert an unsigned long to data, write the data to the buffer, return number of bytes written.
Definition: types.cpp:403
#define EXV_WARNING
Shorthand for a temp warning log message object and return its ostringstream.
Definition: error.hpp:148
BasicIo::AutoPtr io_
Image data IO pointer.
Definition: image.hpp:484
ByteOrder
Type to express the byte order (little or big endian)
Definition: types.hpp:102
DataBuf iccProfile_
ICC buffer (binary data)
Definition: image.hpp:488
void printStructure(std::ostream &out, PrintStructureOption option, int depth)
Print out the structure of image file.
Definition: jp2image.cpp:469
std::auto_ptr< Image > AutoPtr
Image auto_ptr type.
Definition: image.hpp:81
T add(T summand_1, T summand_2)
Safe addition, throws an exception on overflow.
Definition: safe_op.hpp:288
std::auto_ptr< BasicIo > AutoPtr
BasicIo auto_ptr type.
Definition: basicio.hpp:58
bool writeXmpFromPacket() const
Return the flag indicating the source when writing XMP metadata.
Definition: image.cpp:757
BasicError< char > Error
Error class used for exceptions (std::string based)
Definition: error.hpp:324
static DataBuf encode(const IptcData &iptcData)
Encode the IPTC datasets from iptcData to a binary representation in IPTC IIM4 format.
Definition: iptc.cpp:510
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:975
PrintStructureOption
Options for printStructure.
Definition: image.hpp:64
#define EXV_ERROR
Shorthand for a temp error log message object and return its ostringstream.
Definition: error.hpp:150
virtual int seek(long offset, Position pos)=0
Move the current IO position.
EXIV2API bool isJp2Type(BasicIo &iIo, bool advance)
Check if the file iIo is a JPEG-2000 image.
Definition: jp2image.cpp:985
An interface for simple binary IO.
Definition: basicio.hpp:55
long count() const
Get the number of metadata entries.
Definition: iptc.hpp:257
XmpData xmpData_
XMP data container.
Definition: image.hpp:487
virtual XmpData & xmpData()
Returns an XmpData instance containing currently buffered XMP data.
Definition: image.cpp:590
Abstract base class defining the interface for an image. This is the top-level interface to the Exiv2...
Definition: image.hpp:78
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:692
void readMetadata()
Read all metadata supported by a specific image format from the image. Before this method is called,...
Definition: jp2image.cpp:207
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:887
virtual IptcData & iptcData()
Returns an IptcData instance containing currently buffered IPTC data.
Definition: image.cpp:585
EXIV2API uint32_t getULong(const byte *buf, ByteOrder byteOrder)
Read a 4 byte unsigned long value from the data buffer.
Definition: types.cpp:278
Error class for exceptions, log message class.
virtual ExifData & exifData()
Returns an ExifData instance containing currently buffered Exif data.
Definition: image.cpp:580
std::vector< byte > Blob
Container for binary data.
Definition: types.hpp:151