1
// ***************************************************************** -*- C++ -*-
3
* Copyright (C) 2004-2008 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.
23
@brief JPEG-2000 image, implemented using the following references:
24
<a href="http://jpeg.org/public/fcd15444-6.pdf">ISO/IEC JTC 1/SC 29/WG1 N2401: JPEG 2000 Part 6 FCD 15444-6</a><br>
26
@author Marco Piovanelli, Ovolab (marco)
27
<a href="mailto:marco.piovanelli@pobox.com">marco.piovanelli@pobox.com</a>
28
@date 12-Mar-2007, marco: created
33
// *****************************************************************************
34
// included header files
39
// + standard includes
42
// *****************************************************************************
43
// namespace extensions
46
// *****************************************************************************
49
// Add JPEG-2000 to the supported image formats
51
const int jp2 = 15; //!< JPEG-2000 image type
55
@brief Class to access JPEG-2000 images.
57
class Jp2Image : public Image {
58
//! @name NOT Implemented
61
Jp2Image(const Jp2Image& rhs);
62
//! Assignment operator
63
Jp2Image& operator=(const Jp2Image& rhs);
70
@brief Constructor to open a JPEG-2000 image. Since the
71
constructor can not return a result, callers should check the
72
good() method after object construction to determine success
74
@param io An auto-pointer that owns a BasicIo instance used for
75
reading and writing image metadata. \b Important: The constructor
76
takes ownership of the passed in BasicIo instance through the
77
auto-pointer. Callers should not continue to use the BasicIo
78
instance after it is passed to this method. Use the Image::io()
79
method to get a temporary reference.
81
Jp2Image(BasicIo::AutoPtr io);
84
//! @name Manipulators
88
@brief Todo: Write metadata back to the image. This method is not
89
yet implemented. Calling it will throw an Error(31).
93
@brief Todo: Not supported yet. Calling this function will throw
94
an instance of Error(32).
96
void setExifData(const ExifData& exifData);
98
@brief Todo: Not supported yet. Calling this function will throw
99
an instance of Error(32).
101
void setIptcData(const IptcData& iptcData);
103
@brief Todo: Not supported yet(?). Calling this function will throw
104
an instance of Error(32).
106
void setComment(const std::string& comment);
111
std::string mimeType() const { return "image/jp2"; }
116
// *****************************************************************************
117
// template, inline and free functions
119
// These could be static private functions on Image subclasses but then
120
// ImageFactory needs to be made a friend.
122
@brief Create a new Jp2Image instance and return an auto-pointer to it.
123
Caller owns the returned object and the auto-pointer ensures that
126
Image::AutoPtr newJp2Instance(BasicIo::AutoPtr io, bool create);
128
//! Check if the file iIo is a JPEG-2000 image.
129
bool isJp2Type(BasicIo& iIo, bool advance);
133
#endif // #ifndef JP2IMAGE_HPP_