libopenraw  0.3.7
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
OpenRaw::Internals::IfdEntry Class Reference

An entry in the IfdDir. More...

#include <ifdentry.hpp>

Public Types

typedef std::shared_ptr< IfdEntryRef
 IfdEntry reference (ie shared pointer)
 

Public Member Functions

 IfdEntry (uint16_t _id, int16_t _type, int32_t _count, uint32_t _data, const IfdDir &_dir, bool synthetic=false)
 
int16_t id () const noexcept
 id (i.e. tag) of the entry
 
int16_t type () const noexcept
 Type of the entry data. More...
 
uint32_t count () const noexcept
 The count of items in the entry.
 
off_t offset () noexcept
 The offset of the data. More...
 
RawContainer::EndianType endian () const
 Get the endian from the owning IfdDir.
 
const uint8_t * dataptr () const
 Return the raw data pointer.
 
bool loadData (size_t unit_size, off_t offset)
 Load the data for the entry if m_loaded is false. More...
 
size_t loadDataInto (uint8_t *dataptr, size_t data_size, off_t offset) const
 Load data into a buffer. More...
 
void setData (const uint8_t *dataptr, size_t data_size)
 Set the data of the entry.
 

Static Public Member Functions

static size_t typeUnitSize (IFD::ExifTagType _type)
 Unit size for type.
 

Friends

template<typename T >
struct IfdTypeTrait
 

Detailed Description

An entry in the IfdDir.

Definition at line 198 of file ifdentry.hpp.

Member Function Documentation

◆ loadData()

bool OpenRaw::Internals::IfdEntry::loadData ( size_t  unit_size,
off_t  offset 
)

Load the data for the entry if m_loaded is false.

If all the data fits in m_data, it will keep it there it will set m_loaded in case of success.

Parameters
unit_sizethe size of 1 unit of data
offsetoffset from the begining of the container. Usually 0.
Returns
true m_loaded

Definition at line 109 of file ifdentry.cpp.

◆ loadDataInto()

size_t OpenRaw::Internals::IfdEntry::loadDataInto ( uint8_t *  dataptr,
size_t  data_size,
off_t  offset 
) const

Load data into a buffer.

Parameters
dataptrThe target byte buffer.
data_sizethe size of the buffer.
offsetAn extra offset to load the data from. For a standard IFD it is 0.
Returns
Return the size effectively loaded.

Definition at line 96 of file ifdentry.cpp.

◆ offset()

off_t OpenRaw::Internals::IfdEntry::offset ( )
inlinenoexcept

The offset of the data.

It can just be the value if the entry is self contained.

Definition at line 232 of file ifdentry.hpp.

References endian(), and OpenRaw::Internals::RawContainer::ENDIAN_LITTLE.

◆ type()

int16_t OpenRaw::Internals::IfdEntry::type ( ) const
inlinenoexcept

Type of the entry data.

The value is from ExifTagType and is size like it is stored in the file.

Definition at line 217 of file ifdentry.hpp.

Referenced by OpenRaw::Internals::IfdDir::getEntryIntegerArrayItemValue(), and OpenRaw::Internals::IfdDir::makeMetaValue().


The documentation for this class was generated from the following files: