1
// ***************************************************************** -*- C++ -*-
3
* Copyright (C) 2005 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23
@brief Basic Sony MakerNote implementation
25
@author Andreas Huggel (ahu)
26
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
27
@date 18-Apr-05, ahu: created
32
// *****************************************************************************
33
// included header files
35
#include "makernote.hpp"
38
// + standard includes
43
// *****************************************************************************
44
// namespace extensions
47
// *****************************************************************************
51
// *****************************************************************************
55
@brief Return an auto-pointer to a newly created empty MakerNote
56
initialized to operate in the memory management model indicated.
57
The caller owns this copy and the auto-pointer ensures that it
60
@param alloc Memory management model for the new MakerNote. Determines if
61
memory required to store data should be allocated and deallocated
62
(true) or not (false). If false, only pointers to the buffer
63
provided to read() will be kept. See Ifd for more background on
65
@param buf Pointer to the makernote character buffer (not used).
66
@param len Length of the makernote character buffer (not used).
67
@param byteOrder Byte order in which the Exif data (and possibly the
68
makernote) is encoded (not used).
69
@param offset Offset from the start of the TIFF header of the makernote
72
@return An auto-pointer to a newly created empty MakerNote. The caller
73
owns this copy and the auto-pointer ensures that it will be
76
MakerNote::AutoPtr createSonyMakerNote(bool alloc,
82
// *****************************************************************************
85
//! MakerNote for Sony cameras
86
class SonyMakerNote : public IfdMakerNote {
88
//! Shortcut for a %SonyMakerNote auto pointer.
89
typedef std::auto_ptr<SonyMakerNote> AutoPtr;
94
@brief Constructor. Allows to choose whether or not memory management
95
is required for the makernote entries.
97
SonyMakerNote(bool alloc =true);
99
SonyMakerNote(const SonyMakerNote& rhs);
100
//! Virtual destructor
101
virtual ~SonyMakerNote() {}
104
//! @name Manipulators
106
int readHeader(const byte* buf,
108
ByteOrder byteOrder);
113
int checkHeader() const;
114
AutoPtr create(bool alloc =true) const;
115
AutoPtr clone() const;
119
// Public only so that we can create a static instance
126
//! Internal virtual create function.
127
SonyMakerNote* create_(bool alloc =true) const;
128
//! Internal virtual copy constructor.
129
SonyMakerNote* clone_() const;
132
static const TagInfo tagInfo_[];
134
}; // class SonyMakerNote
136
static SonyMakerNote::RegisterMn registerSonyMakerNote;
139
#endif // #ifndef SONYMN_HPP_