Exiv2
crwimage.hpp
Go to the documentation of this file.
1// ***************************************************************** -*- C++ -*-
2/*
3 * Copyright (C) 2004-2021 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 */
29#ifndef CRWIMAGE_HPP_
30#define CRWIMAGE_HPP_
31
32// *****************************************************************************
33#include "exiv2lib_export.h"
34
35// included header files
36#include "image.hpp"
37
38// *****************************************************************************
39// namespace extensions
40namespace Exiv2 {
41
42// *****************************************************************************
43// class declarations
44 class ExifData;
45 class IptcData;
46
47// *****************************************************************************
48// class definitions
49
50 // Add CRW to the supported image formats
51 namespace ImageType {
52 const int crw = 3;
53 }
54
59 class EXIV2API CrwImage : public Image {
60 public:
62
63
78 CrwImage(BasicIo::AutoPtr io, bool create);
80
82
83 void readMetadata();
84 void writeMetadata();
89 void setIptcData(const IptcData& iptcData);
91
93
94 std::string mimeType() const;
95 int pixelWidth() const;
96 int pixelHeight() const;
98
99 private:
101
102
103 CrwImage(const CrwImage& rhs);
105 CrwImage& operator=(const CrwImage& rhs);
107
108 }; // class CrwImage
109
113 class EXIV2API CrwParser {
114 public:
130 static void decode(CrwImage* pCrwImage, const byte* pData, uint32_t size);
145 static void encode(
146 Blob& blob,
147 const byte* pData,
148 uint32_t size,
149 const CrwImage* pCrwImage
150 );
151
152 }; // class CrwParser
153
154// *****************************************************************************
155// template, inline and free functions
156
157 // These could be static private functions on Image subclasses but then
158 // ImageFactory needs to be made a friend.
164 EXIV2API Image::AutoPtr newCrwInstance(BasicIo::AutoPtr io, bool create);
165
167 EXIV2API bool isCrwType(BasicIo& iIo, bool advance);
168
169} // namespace Exiv2
170
171#endif // #ifndef CRWIMAGE_HPP_
An interface for simple binary IO.
Definition: basicio.hpp:55
std::auto_ptr< BasicIo > AutoPtr
BasicIo auto_ptr type.
Definition: basicio.hpp:58
Class to access raw Canon CRW images. Only Exif metadata and a comment are supported....
Definition: crwimage.hpp:59
Definition: crwimage.hpp:113
Abstract base class defining the interface for an image. This is the top-level interface to the Exiv2...
Definition: image.hpp:78
std::auto_ptr< Image > AutoPtr
Image auto_ptr type.
Definition: image.hpp:81
A container for IPTC data. This is a top-level class of the Exiv2 library.
Definition: iptc.hpp:170
const int crw
CRW image type (see class CrwImage)
Definition: crwimage.hpp:52
Provides classes and functions to encode and decode Exif and Iptc data. The libexiv2 API consists of ...
Definition: asfvideo.hpp:36
EXIV2API Image::AutoPtr newCrwInstance(BasicIo::AutoPtr io, bool create)
Create a new CrwImage instance and return an auto-pointer to it. Caller owns the returned object and ...
Definition: crwimage.cpp:186
std::vector< byte > Blob
Container for binary data.
Definition: types.hpp:151
EXIV2API bool isCrwType(BasicIo &iIo, bool advance)
Check if the file iIo is a CRW image.
Definition: crwimage.cpp:195