Loading...
Searching...
No Matches
pngimage.hpp
// ***************************************************************** -*- C++ -*-
/*
* Copyright (C) 2004-2021 Exiv2 authors
* This program is part of the Exiv2 distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA.
*/
#ifndef PNGIMAGE_HPP_
#define PNGIMAGE_HPP_
// *****************************************************************************
#include "exiv2lib_export.h"
// included header files
#include "image.hpp"
// *****************************************************************************
// namespace extensions
namespace Exiv2
{
// *****************************************************************************
// class definitions
// Add PNG to the supported image formats
namespace ImageType
{
const int png = 6;
}
class EXIV2API PngImage : public Image {
public:
PngImage(BasicIo::AutoPtr io, bool create);
void readMetadata();
void writeMetadata();
void printStructure(std::ostream& out, PrintStructureOption option,int depth);
std::string mimeType() const;
private:
PngImage(const PngImage& rhs);
PngImage& operator=(const PngImage& rhs);
void doWriteMetadata(BasicIo& oIo);
std::string profileName_;
}; // class PngImage
// *****************************************************************************
// template, inline and free functions
// These could be static private functions on Image subclasses but then
// ImageFactory needs to be made a friend.
EXIV2API Image::AutoPtr newPngInstance(BasicIo::AutoPtr io, bool create);
EXIV2API bool isPngType(BasicIo& iIo, bool advance);
} // namespace Exiv2
#endif // #ifndef PNGIMAGE_HPP_
Exiv2::BasicIo
An interface for simple binary IO.
Definition basicio.hpp:55
Exiv2::BasicIo::AutoPtr
std::auto_ptr< BasicIo > AutoPtr
BasicIo auto_ptr type.
Definition basicio.hpp:58
Exiv2::Image
Abstract base class defining the interface for an image. This is the top-level interface to the Exiv2...
Definition image.hpp:78
Exiv2::Image::AutoPtr
std::auto_ptr< Image > AutoPtr
Image auto_ptr type.
Definition image.hpp:81
Exiv2::PngImage
Class to access PNG images. Exif and IPTC metadata are supported directly.
Definition pngimage.hpp:47
Exiv2::PngImage::readMetadata
void readMetadata()
Read all metadata supported by a specific image format from the image. Before this method is called,...
Exiv2::PngImage::writeMetadata
void writeMetadata()
Write metadata back to the image.
Exiv2::PngImage::PngImage
PngImage(BasicIo::AutoPtr io, bool create)
Constructor that can either open an existing PNG image or create a new image from scratch....
Exiv2::PngImage::mimeType
std::string mimeType() const
Return the MIME type of the image.
Exiv2::PngImage::printStructure
void printStructure(std::ostream &out, PrintStructureOption option, int depth)
Print out the structure of image file.
Exiv2::ImageType::png
const int png
PNG image type (see class PngImage)
Definition pngimage.hpp:40
Exiv2
Provides classes and functions to encode and decode Exif and Iptc data. The libexiv2 API consists of ...
Definition asfvideo.hpp:36
Exiv2::PrintStructureOption
PrintStructureOption
Options for printStructure.
Definition image.hpp:64
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::isPngType
EXIV2API bool isPngType(BasicIo &iIo, bool advance)
Check if the file iIo is a PNG image.