Exiv2
epsimage.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  */
34 #ifndef EPSIMAGE_HPP_
35 #define EPSIMAGE_HPP_
36 
37 // *****************************************************************************
38 #include "exiv2lib_export.h"
39 
40 // included header files
41 #include "image.hpp"
42 
43 // *****************************************************************************
44 // namespace extensions
45 namespace Exiv2
46 {
47 
48 // *****************************************************************************
49 // class definitions
50 
51  // Add EPS to the supported image formats
52  namespace ImageType {
53  const int eps = 18;
54  }
55 
59  class EXIV2LIB_DEPRECATED_EXPORT EpsImage : public Image {
60  public:
62 
63 
77  EpsImage(BasicIo::AutoPtr io, bool create);
79 
81 
82  void readMetadata();
83  void writeMetadata();
88  void setComment(const std::string& comment);
90 
92 
93  std::string mimeType() const;
95 
96  private:
98 
99  EpsImage(const EpsImage& rhs);
102  EpsImage& operator=(const EpsImage& rhs);
104 
105  }; // class EpsImage
106 
107 // *****************************************************************************
108 // template, inline and free functions
109 
110  // These could be static private functions on Image subclasses but then
111  // ImageFactory needs to be made a friend.
117  EXIV2LIB_DEPRECATED_EXPORT Image::AutoPtr newEpsInstance(BasicIo::AutoPtr io, bool create);
118 
120  EXIV2LIB_DEPRECATED_EXPORT bool isEpsType(BasicIo& iIo, bool advance);
121 
122 } // namespace Exiv2
123 
124 #endif // #ifndef EPSIMAGE_HPP_
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...
Exiv2::MemIo
Provides binary IO on blocks of memory by implementing the BasicIo interface. A copy-on-write impleme...
Definition: basicio.hpp:540
Exiv2::Image::xmpPacket_
std::string xmpPacket_
XMP packet.
Definition: image.hpp:493
Exiv2::BasicIo::isopen
virtual bool isopen() const =0
Returns true if the IO source is open, otherwise false.
Exiv2::BasicIo::transfer
virtual void transfer(BasicIo &src)=0
Remove all data from this object's IO source and then transfer data from the src BasicIo object into ...
Exiv2::NativePreview::filter_
std::string filter_
Filter.
Definition: image.hpp:57
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
Exiv2::IoCloser
Utility class that closes a BasicIo instance upon destruction. Meant to be used as a stack variable i...
Definition: basicio.hpp:264
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::Image::nativePreviews_
NativePreviewList nativePreviews_
list of native previews
Definition: image.hpp:496
EXV_DEBUG
#define EXV_DEBUG
Shorthand to create a temp debug log message object and return its ostringstream.
Definition: error.hpp:144
Exiv2::NativePreview::width_
uint32_t width_
Width.
Definition: image.hpp:55
Exiv2::EpsImage::mimeType
std::string mimeType() const
Return the MIME type of the image.
Definition: epsimage.cpp:1098
Exiv2::comment
Exiv2 type for the Exif user comment.
Definition: types.hpp:150
Exiv2::NativePreview
Native preview information. This is meant to be used only by the PreviewManager.
Definition: image.hpp:52
Exiv2::strError
EXIV2API std::string strError()
Return a system error message and the error code (errno). See strerror(3).
Definition: futils.cpp:352
version.hpp
Precompiler define and a function to test the Exiv2 version. References: Similar versioning defines a...
Exiv2::EpsImage::writeMetadata
void writeMetadata()
Write metadata back to the image.
Definition: epsimage.cpp:1130
Exiv2::EpsImage
Class to access EPS images.
Definition: epsimage.hpp:59
Exiv2::NativePreview::position_
long position_
Position.
Definition: image.hpp:53
Exiv2::BasicIo::close
virtual int close()=0
Close the IO source. After closing a BasicIo instance can not be read or written. Closing flushes any...
Exiv2::NativePreview::size_
uint32_t size_
Size.
Definition: image.hpp:54
Exiv2::byte
uint8_t byte
1 byte unsigned integer type.
Definition: types.hpp:105
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::EpsImage::setComment
void setComment(const std::string &comment)
Not supported. Calling this function will throw an instance of Error(kerInvalidSettingForImage).
Definition: epsimage.cpp:1103
Exiv2::EpsImage::readMetadata
void readMetadata()
Read all metadata supported by a specific image format from the image. Before this method is called,...
Definition: epsimage.cpp:1108
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::us2Data
EXIV2API long us2Data(byte *buf, uint16_t s, ByteOrder byteOrder)
Convert an unsigned short to data, write the data to the buffer, return number of bytes written.
Definition: types.cpp:395
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::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
Provides classes and functions to encode and decode Exif and Iptc data. The libexiv2 API consists of ...
Definition: asfvideo.hpp:36
image.hpp
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::ul2Data
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:408
Exiv2::NativePreview::height_
uint32_t height_
Height.
Definition: image.hpp:56
EXV_WARNING
#define EXV_WARNING
Shorthand for a temp warning log message object and return its ostringstream.
Definition: error.hpp:148
Exiv2::BasicIo::write
virtual long write(const byte *data, long wcount)=0
Write data to the IO source. Current IO position is advanced by the number of bytes written.
Exiv2::getUShort
EXIV2API uint16_t getUShort(const byte *buf, ByteOrder byteOrder)
Read a 2 byte unsigned short value from the data buffer.
Definition: types.cpp:278
Exiv2::BasicIo::mmap
virtual byte * mmap(bool isWriteable=false)=0
Direct access to the IO data. For files, this is done by mapping the file into the process's address ...
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::Image::AutoPtr
std::auto_ptr< Image > AutoPtr
Image auto_ptr type.
Definition: image.hpp:84
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:728
Exiv2::Error
BasicError< char > Error
Error class used for exceptions (std::string based)
Definition: error.hpp:323
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::string
IPTC string type.
Definition: types.hpp:147
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::toString
std::string toString(const T &arg)
Utility function to convert the argument of any type to a string.
Definition: types.hpp:521
Exiv2::BasicIo
An interface for simple binary IO.
Definition: basicio.hpp:55
Exiv2::Image::xmpData_
XmpData xmpData_
XMP data container.
Definition: image.hpp:490
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::NativePreview::mimeType_
std::string mimeType_
MIME type.
Definition: image.hpp:58
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::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
error.hpp
Error class for exceptions, log message class.
Exiv2::ImageType::eps
const int eps
EPS image type.
Definition: epsimage.hpp:53
Exiv2::versionNumberHexString
EXIV2API std::string versionNumberHexString()
Return the version of Exiv2 as hex string of fixed length 6.
Definition: version.cpp:95