libopenraw
Main Page
Related Pages
Namespaces
Classes
Files
File List
lib
ifddir.h
1
/*
2
* libopenraw - ifddir.h
3
*
4
* Copyright (C) 2006-2007 Hubert Figuiere
5
*
6
* This library is free software: you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public License
8
* as published by the Free Software Foundation, either version 3 of
9
* the License, or (at your option) any later version.
10
*
11
* This library 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 GNU
14
* Lesser General Public License for more details.
15
*
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with this library. If not, see
18
* <http://www.gnu.org/licenses/>.
19
*/
20
21
22
#ifndef _OPENRAW_INTERNALS_IFDDIR_H
23
#define _OPENRAW_INTERNALS_IFDDIR_H
24
25
#include <map>
26
27
#include <boost/config.hpp>
28
#include <boost/shared_ptr.hpp>
29
#include "ifdentry.h"
30
#include "trace.h"
31
32
namespace
OpenRaw {
33
namespace
Internals {
34
35
class
IFDFileContainer;
36
37
class
IFDDir
38
{
39
public
:
40
typedef
boost::shared_ptr<IFDDir> Ref;
41
typedef
std::vector<Ref> RefVec;
42
struct
isPrimary
43
{
44
bool
operator()(
const
Ref &dir);
45
};
46
struct
isThumbnail
47
{
48
bool
operator()(
const
Ref &dir);
49
};
50
51
IFDDir
(off_t _offset,
IFDFileContainer
& _container);
52
virtual
~
IFDDir
();
53
55
off_t
offset
()
const
56
{
57
return
m_offset;
58
}
59
61
bool
load
();
63
int
numTags
()
64
{
65
return
m_entries.size();
66
}
67
IFDEntry::Ref
getEntry(uint16_t
id
)
const
;
68
74
template
<
typename
T>
75
bool
getValue
(uint16_t
id
, T &v)
const
76
{
77
bool
success =
false
;
78
IFDEntry::Ref
e = getEntry(
id
);
79
if
(e != NULL) {
80
try
{
81
v =
IFDTypeTrait<T>::get
(*e);
82
success =
true
;
83
}
84
catch
(
const
std::exception & ex) {
85
Debug::Trace
(ERROR) <<
"Exception raised "
<< ex.what()
86
<<
" fetch value for "
<<
id
<<
"\n"
;
87
}
88
}
89
return
success;
90
}
91
100
bool
getIntegerValue
(uint16_t
id
, uint32_t &v);
101
105
off_t
nextIFD
();
106
110
Ref
getSubIFD
(uint32_t idx = 0)
const
;
115
bool
getSubIFDs
(std::vector<IFDDir::Ref> & ifds);
116
120
Ref
getExifIFD
();
121
private
:
122
off_t m_offset;
123
IFDFileContainer
& m_container;
124
std::map<uint16_t, IFDEntry::Ref> m_entries;
125
};
126
127
128
}
129
}
130
131
132
#endif
133
OpenRaw::Internals::IFDTypeTrait::get
static T get(IFDEntry &e, uint32_t idx=0, bool ignore_type=false)
Definition:
ifdentry.h:211
OpenRaw::Internals::IFDDir::load
bool load()
Definition:
ifddir.cpp:63
OpenRaw::Internals::IFDDir::getIntegerValue
bool getIntegerValue(uint16_t id, uint32_t &v)
Definition:
ifddir.cpp:100
OpenRaw::Internals::IFDDir::getExifIFD
Ref getExifIFD()
Definition:
ifddir.cpp:201
Debug::Trace
Definition:
trace.h:37
OpenRaw::Internals::IFDFileContainer
Definition:
ifdfilecontainer.h:45
OpenRaw::Internals::IFDDir::getSubIFDs
bool getSubIFDs(std::vector< IFDDir::Ref > &ifds)
Definition:
ifddir.cpp:175
OpenRaw::Internals::IFDDir
Definition:
ifddir.h:37
OpenRaw::Internals::IFDDir::offset
off_t offset() const
Definition:
ifddir.h:55
OpenRaw::Internals::IFDDir::nextIFD
off_t nextIFD()
Definition:
ifddir.cpp:129
OpenRaw::Internals::IFDDir::getSubIFD
Ref getSubIFD(uint32_t idx=0) const
Definition:
ifddir.cpp:154
OpenRaw::Internals::IFDDir::numTags
int numTags()
Definition:
ifddir.h:63
OpenRaw::Internals::IFDDir::getValue
bool getValue(uint16_t id, T &v) const
Definition:
ifddir.h:75
OpenRaw::Internals::IFDDir::isPrimary
Definition:
ifddir.h:42
OpenRaw::Internals::IFDEntry::Ref
boost::shared_ptr< IFDEntry > Ref
Definition:
ifdentry.h:122
OpenRaw::Internals::IFDDir::isThumbnail
Definition:
ifddir.h:46
Generated on Sat Oct 19 2013 07:46:54 for libopenraw by
1.8.5