22 #ifndef OR_INTERNALS_IFDENTRY_H 23 #define OR_INTERNALS_IFDENTRY_H 28 #include <sys/types.h> 35 #include "exception.hpp" 37 #include "endianutils.hpp" 38 #include "rawcontainer.hpp" 47 class IfdFileContainer;
55 static const uint16_t
type;
57 static T EL(
const uint8_t* d,
size_t len) noexcept;
58 static T BE(
const uint8_t* d,
size_t len) noexcept;
59 static T
get(
IfdEntry & e, uint32_t idx = 0,
bool ignore_type =
false)
106 s.assign((
const char*)b, strnlen((
const char*)b, len));
118 s.assign((
const char*)b, strnlen((
const char*)b, len));
130 r.denom = EL32(b + 4);
139 r.denom = BE32(b + 4);
148 r.denom = EL32(b + 4);
157 r.denom = BE32(b + 4);
165 typedef std::shared_ptr<IfdEntry>
Ref;
167 IfdEntry(uint16_t _id, int16_t _type, int32_t _count,
172 int16_t type() const noexcept
201 static size_t type_unit_size(IFD::ExifTagType _type);
207 bool loadData(
size_t unit_size);
215 template <
typename T>
219 std::vector<T> array;
220 array.reserve(m_count);
221 for (uint32_t i = 0; i < m_count; i++) {
226 catch(
const std::exception & e)
228 LOGERR(
"Exception: %s\n", e.what());
232 uint32_t getIntegerArrayItem(
int idx);
261 template <
typename T>
266 if(!ignore_type && (e.m_type != IFD::EXIF_FORMAT_UNDEFINED)) {
271 if (idx + 1 > e.m_count) {
281 if (e.m_dataptr == NULL) {
282 data = (uint8_t*)&e.m_data;
uint32_t count() const noexcept
CIFF is the container for CRW files. It is an attempt from Canon to make this a standard. I guess it failed.
static T get(IfdEntry &e, uint32_t idx=0, bool ignore_type=false) noexcept(false)
std::shared_ptr< IfdEntry > Ref
Option< std::vector< T > > getArray()
static const uint16_t type