1
// ***************************************************************** -*- C++ -*-
3
* Copyright (C) 2004-2009 Andreas Huggel <ahuggel@gmx.net>
5
* This program is part of the Exiv2 distribution.
7
* This program is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU General Public License
9
* as published by the Free Software Foundation; either version 2
10
* of the License, or (at your option) any later version.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA.
25
@author Andreas Huggel (ahu)
26
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
27
@date 06-Jan-09, ahu: created
32
// *****************************************************************************
33
// included header files
35
#include "basicio.hpp"
38
// + standard includes
41
// *****************************************************************************
42
// namespace extensions
45
// *****************************************************************************
48
// Add RW2 to the supported image formats
50
const int rw2 = 16; //!< RW2 image type (see class Rw2Image)
54
@brief Class to access raw Panasonic RW2 images. Exif metadata is
55
supported directly, IPTC and XMP are read from the Exif data, if
58
class EXIV2API Rw2Image : public Image {
63
@brief Constructor to open an existing RW2 image. Since the
64
constructor can not return a result, callers should check the
65
good() method after object construction to determine success or
67
@param io An auto-pointer that owns a BasicIo instance used for
68
reading and writing image metadata. \b Important: The constructor
69
takes ownership of the passed in BasicIo instance through the
70
auto-pointer. Callers should not continue to use the BasicIo
71
instance after it is passed to this method. Use the Image::io()
72
method to get a temporary reference.
74
Rw2Image(BasicIo::AutoPtr io);
77
//! @name Manipulators
81
@brief Todo: Write metadata back to the image. This method is not
82
yet implemented. Calling it will throw an Error(31).
86
@brief Todo: Not supported yet, requires writeMetadata(). Calling
87
this function will throw an Error(32).
89
void setExifData(const ExifData& exifData);
91
@brief Todo: Not supported yet, requires writeMetadata(). Calling
92
this function will throw an Error(32).
94
void setIptcData(const IptcData& iptcData);
96
@brief Not supported. RW2 format does not contain a comment.
97
Calling this function will throw an Error(32).
99
void setComment(const std::string& comment);
104
std::string mimeType() const { return "image/x-raw"; }
105
int pixelWidth() const;
106
int pixelHeight() const;
110
//! @name NOT implemented
113
Rw2Image(const Rw2Image& rhs);
114
//! Assignment operator
115
Rw2Image& operator=(const Rw2Image& rhs);
121
@brief Stateless parser class for data in RW2 format. Images use this
122
class to decode and encode RW2 data. Only decoding is currently
123
implemented. See class TiffParser for details.
125
class EXIV2API Rw2Parser {
128
@brief Decode metadata from a buffer \em pData of length \em size
129
with data in RW2 format to the provided metadata containers.
130
See TiffParser::decode().
132
static ByteOrder decode(
140
}; // class Rw2Parser
142
// *****************************************************************************
143
// template, inline and free functions
145
// These could be static private functions on Image subclasses but then
146
// ImageFactory needs to be made a friend.
148
@brief Create a new Rw2Image instance and return an auto-pointer to it.
149
Caller owns the returned object and the auto-pointer ensures that
152
EXIV2API Image::AutoPtr newRw2Instance(BasicIo::AutoPtr io, bool create);
154
//! Check if the file iIo is a RW2 image.
155
EXIV2API bool isRw2Type(BasicIo& iIo, bool advance);
159
#endif // #ifndef RW2IMAGE_HPP_