22 #ifndef _OPENRAW_INTERNALS_IFDENTRY_H
23 #define _OPENRAW_INTERNALS_IFDENTRY_H
26 #include <boost/shared_ptr.hpp>
27 #include <libopenraw/types.h>
29 #include "exception.h"
30 #include "endianutils.h"
31 #include "rawcontainer.h"
37 class IFDFileContainer;
45 static const uint16_t
type;
47 static T EL(
const uint8_t* d);
48 static T BE(
const uint8_t* d);
49 static T
get(
IFDEntry & e, uint32_t idx = 0,
bool ignore_type =
false)
61 inline uint8_t IFDTypeTrait<uint8_t>::BE(
const uint8_t* b)
68 inline uint16_t IFDTypeTrait<uint16_t>::EL(
const uint8_t* b)
74 inline uint16_t IFDTypeTrait<uint16_t>::BE(
const uint8_t* b)
80 inline uint32_t IFDTypeTrait<uint32_t>::EL(
const uint8_t* b)
86 inline uint32_t IFDTypeTrait<uint32_t>::BE(
const uint8_t* b)
92 inline std::string IFDTypeTrait<std::string>::EL(
const uint8_t* b)
94 return std::string((
const char*)b);
98 inline std::string IFDTypeTrait<std::string>::BE(
const uint8_t* b)
100 return std::string((
const char*)b);
103 #if defined(__APPLE_CC__)
106 inline unsigned long IFDTypeTrait<unsigned long>::EL(
const uint8_t* b)
112 inline unsigned long IFDTypeTrait<unsigned long>::BE(
const uint8_t* b)
122 typedef boost::shared_ptr<IFDEntry>
Ref;
124 IFDEntry(uint16_t _id, int16_t _type, int32_t _count,
167 template <
typename T>
171 array.reserve(m_count);
172 for (uint32_t i = 0; i < m_count; i++) {
176 catch(std::exception & e)
210 template <
typename T>
215 if(!ignore_type && (e.m_type != IFD::EXIF_FORMAT_UNDEFINED)) {
220 if (idx + 1 > e.m_count) {
230 if (e.m_dataptr == NULL) {
231 data = (uint8_t*)&e.m_data;
static T get(IFDEntry &e, uint32_t idx=0, bool ignore_type=false)
static const uint16_t type
bool loadData(size_t unit_size)
void getArray(std::vector< T > &array)
boost::shared_ptr< IFDEntry > Ref