Exiv2
pngimage.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  */
31 #ifndef PNGIMAGE_HPP_
32 #define PNGIMAGE_HPP_
33 
34 // *****************************************************************************
35 #include "exiv2lib_export.h"
36 
37 // included header files
38 #include "image.hpp"
39 
40 // *****************************************************************************
41 // namespace extensions
42 namespace Exiv2
43 {
44 
45 // *****************************************************************************
46 // class definitions
47 
48  // Add PNG to the supported image formats
49  namespace ImageType
50  {
51  const int png = 6;
52  }
53 
58  class EXIV2API PngImage : public Image {
59  public:
61 
62 
77  PngImage(BasicIo::AutoPtr io, bool create);
79 
81 
82  void readMetadata();
83  void writeMetadata();
84 
91  void printStructure(std::ostream& out, PrintStructureOption option,int depth);
93 
95 
96  std::string mimeType() const;
98 
99  private:
101 
102  PngImage(const PngImage& rhs);
105  PngImage& operator=(const PngImage& rhs);
113  void doWriteMetadata(BasicIo& oIo);
115 
116  std::string profileName_;
117 
118  }; // class PngImage
119 
120 // *****************************************************************************
121 // template, inline and free functions
122 
123  // These could be static private functions on Image subclasses but then
124  // ImageFactory needs to be made a friend.
130  EXIV2API Image::AutoPtr newPngInstance(BasicIo::AutoPtr io, bool create);
131 
133  EXIV2API bool isPngType(BasicIo& iIo, bool advance);
134 
135 } // namespace Exiv2
136 
137 #endif // #ifndef PNGIMAGE_HPP_
An interface for simple binary IO.
Definition: basicio.hpp:55
std::auto_ptr< Image > AutoPtr
Image auto_ptr type.
Definition: image.hpp:84
Abstract base class defining the interface for an image. This is the top-level interface to the Exiv2...
Definition: image.hpp:81
PrintStructureOption
Options for printStructure.
Definition: image.hpp:67
std::auto_ptr< BasicIo > AutoPtr
BasicIo auto_ptr type.
Definition: basicio.hpp:58
const int png
PNG image type (see class PngImage)
Definition: pngimage.hpp:51
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 ...
IPTC string type.
Definition: types.hpp:147
Provides classes and functions to encode and decode Exif and Iptc data. The libexiv2 API consists of ...
Definition: asfvideo.hpp:36
Class to access PNG images. Exif and IPTC metadata are supported directly.
Definition: pngimage.hpp:58
EXIV2API bool isPngType(BasicIo &iIo, bool advance)
Check if the file iIo is a PNG image.