Loading...
Searching...
No Matches
pgfimage.hpp
// SPDX-License-Identifier: GPL-2.0-or-later
#ifndef PGFIMAGE_HPP_
#define PGFIMAGE_HPP_
// *****************************************************************************
#include "exiv2lib_export.h"
// included header files
#include "image.hpp"
// *****************************************************************************
// namespace extensions
namespace Exiv2 {
// *****************************************************************************
// class definitions
class EXIV2API PgfImage : public Image {
public:
PgfImage(BasicIo::UniquePtr io, bool create);
void readMetadata() override;
void writeMetadata() override;
[[nodiscard]] std::string mimeType() const override {
return "image/pgf";
}
private:
bool bSwap_; // true for bigEndian hardware, else false
void doWriteMetadata(BasicIo& outIo);
static byte readPgfMagicNumber(BasicIo& iIo);
size_t readPgfHeaderSize(BasicIo& iIo) const;
DataBuf readPgfHeaderStructure(BasicIo& iIo, uint32_t& width, uint32_t& height) const;
}; // class PgfImage
// *****************************************************************************
// 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::UniquePtr newPgfInstance(BasicIo::UniquePtr io, bool create);
EXIV2API bool isPgfType(BasicIo& iIo, bool advance);
} // namespace Exiv2
#endif // #ifndef PGFIMAGE_HPP_
Exiv2::BasicIo
An interface for simple binary IO.
Definition basicio.hpp:35
Exiv2::BasicIo::UniquePtr
std::unique_ptr< BasicIo > UniquePtr
BasicIo auto_ptr type.
Definition basicio.hpp:38
Exiv2::Image::Image
Image(ImageType type, uint16_t supportedMetadata, BasicIo::UniquePtr io)
Constructor taking the image type, a bitmap of the supported metadata types and an auto-pointer that ...
Definition image.cpp:132
Exiv2::Image::io
virtual BasicIo & io() const
Return a reference to the BasicIo instance being used for Io.
Definition image.cpp:696
Exiv2::Image::UniquePtr
std::unique_ptr< Image > UniquePtr
Image auto_ptr type.
Definition image.hpp:53
Exiv2::PgfImage::mimeType
std::string mimeType() const override
Return the MIME type of the image.
Definition pgfimage.hpp:52
Exiv2::PgfImage::readMetadata
void readMetadata() override
Read all metadata supported by a specific image format from the image. Before this method is called,...
Definition pgfimage.cpp:67
Exiv2::PgfImage::writeMetadata
void writeMetadata() override
Write metadata back to the image.
Definition pgfimage.cpp:116
Exiv2::PgfImage::PgfImage
PgfImage(BasicIo::UniquePtr io, bool create)
Constructor that can either open an existing PGF image or create a new image from scratch....
Definition pgfimage.cpp:52
Exiv2
Class CrwImage to access Canon CRW images. References: The Canon RAW (CRW) File Format by Phil Harv...
Definition asfvideo.hpp:15
Exiv2::isPgfType
EXIV2API bool isPgfType(BasicIo &iIo, bool advance)
Check if the file iIo is a PGF image.
Definition pgfimage.cpp:297
Exiv2::newPgfInstance
EXIV2API Image::UniquePtr newPgfInstance(BasicIo::UniquePtr io, bool create)
Create a new PgfImage instance and return an auto-pointer to it. Caller owns the returned object and ...
Definition pgfimage.cpp:289
Exiv2::DataBuf
Utility class containing a character array. All it does is to take care of memory allocation and dele...
Definition types.hpp:124