libopenraw
|
Public Types | |
enum | { IFD_NONE = -1, IFD_EXIF = -2, IFD_GPS = -3, IFD_INTEROP = -4 } |
![]() | |
enum | EndianType { ENDIAN_NULL = 0, ENDIAN_BIG, ENDIAN_LITTLE } |
Public Member Functions | |
IfdFileContainer (const IO::Stream::Ptr &file, off_t offset) | |
virtual | ~IfdFileContainer () |
virtual EndianType | isMagicHeader (const char *p, int len) |
IfdDir::Ref | setDirectory (int dir) |
int | countDirectories (void) |
std::vector< IfdDir::Ref > & | directories () |
int | currentDirectory () |
size_t | getDirectoryDataSize () |
int | lastError () const |
int | exifOffsetCorrection () const |
void | setExifOffsetCorrection (int corr) |
::or_error | locateImageData (const IfdDir::Ref &dir, uint32_t &x, uint32_t &y, ::or_data_type &t) |
![]() | |
RawContainer (const IO::Stream::Ptr &_file, off_t offset) | |
virtual | ~RawContainer () |
const IO::Stream::Ptr & | file () |
EndianType | endian () const |
off_t | offset () const |
bool | skip (off_t offset) |
Option< int8_t > | readInt8 (const IO::Stream::Ptr &f) |
Option< uint8_t > | readUInt8 (const IO::Stream::Ptr &f) |
Option< int16_t > | readInt16 (const IO::Stream::Ptr &f) |
Option< int32_t > | readInt32 (const IO::Stream::Ptr &f) |
Option< uint16_t > | readUInt16 (const IO::Stream::Ptr &f) |
size_t | readUInt16Array (const IO::Stream::Ptr &f, std::vector< uint16_t > &v, size_t count) |
Option< uint32_t > | readUInt32 (const IO::Stream::Ptr &f) |
size_t | fetchData (void *buf, off_t offset, size_t buf_size) |
off_t | size () const |
Protected Member Functions | |
virtual bool | locateDirsPreHook () |
![]() | |
RawContainer (const RawContainer &)=delete | |
RawContainer & | operator= (const RawContainer &)=delete |
void | setEndian (EndianType _endian) |
Additional Inherited Members | |
![]() | |
IO::Stream::Ptr | m_file |
off_t | m_offset |
EndianType | m_endian |
Definition at line 47 of file ifdfilecontainer.hpp.
anonymous enum |
due to the way Exif works, we have to set specific index to address these IFD
Enumerator | |
---|---|
IFD_NONE | invalid IFD. Means an error |
IFD_EXIF | exif IFD: see field 0x6789 in IFD 0 |
IFD_GPS | GPS IFD: see field 0x8825 in IFD 0 |
IFD_INTEROP | interoperability IFD: see field 0xa005 in exif IFD |
Definition at line 65 of file ifdfilecontainer.hpp.
OpenRaw::Internals::IfdFileContainer::IfdFileContainer | ( | const IO::Stream::Ptr & | file, |
off_t | offset | ||
) |
constructor
file | the file handle |
offset | the offset from the start of the file |
Definition at line 38 of file ifdfilecontainer.cpp.
|
virtual |
destructor
Definition at line 47 of file ifdfilecontainer.cpp.
int OpenRaw::Internals::IfdFileContainer::countDirectories | ( | void | ) |
Count the number of image file directories, not including EXIF, GPS and INTEROP.
Definition at line 68 of file ifdfilecontainer.cpp.
Referenced by directories(), and setDirectory().
int OpenRaw::Internals::IfdFileContainer::currentDirectory | ( | ) |
Get the number of the current directory
std::vector< IfdDir::Ref > & OpenRaw::Internals::IfdFileContainer::directories | ( | ) |
Get the directories, loading them if necessary
Definition at line 80 of file ifdfilecontainer.cpp.
References countDirectories().
|
inline |
Return the Exif offset from the container begining. By default it is 0, but some format like MRW needs a different one. This is an adjustement for the offset in the Exif IFD tag.
Definition at line 129 of file ifdfilecontainer.hpp.
Referenced by OpenRaw::Internals::IfdEntry::loadData().
size_t OpenRaw::Internals::IfdFileContainer::getDirectoryDataSize | ( | ) |
get the extra data size chunk associated to the current image directory
Definition at line 111 of file ifdfilecontainer.cpp.
References OpenRaw::Internals::RawContainer::m_file, and OpenRaw::Internals::RawContainer::readInt32().
|
virtual |
Check the IFD magic header
p | the pointer to check |
len | the length of the block to check. Likely to be at least 4. |
subclasses needs to override it for like Olympus RAW
Reimplemented in OpenRaw::Internals::MRWContainer, OpenRaw::Internals::OrfContainer, and OpenRaw::Internals::Rw2Container.
Definition at line 52 of file ifdfilecontainer.cpp.
References OpenRaw::Internals::RawContainer::ENDIAN_BIG, and OpenRaw::Internals::RawContainer::ENDIAN_LITTLE.
Referenced by locateDirsPreHook().
|
inline |
|
protectedvirtual |
hook to be called at the start of _locateDirs()
Reimplemented in OpenRaw::Internals::MRWContainer.
Definition at line 134 of file ifdfilecontainer.cpp.
References isMagicHeader(), OpenRaw::Internals::RawContainer::m_file, OpenRaw::Internals::RawContainer::m_offset, and OpenRaw::Internals::RawContainer::readInt32().
Referenced by setExifOffsetCorrection().
::or_error OpenRaw::Internals::IfdFileContainer::locateImageData | ( | const IfdDir::Ref & | dir, |
uint32_t & | x, | ||
uint32_t & | y, | ||
::or_data_type & | t | ||
) |
locate image data in the ifd (excepted RAW)
dir | the IFD dir to locate the image data in |
t | the type of the image data |
Referenced by setExifOffsetCorrection().
IfdDir::Ref OpenRaw::Internals::IfdFileContainer::setDirectory | ( | int | dir | ) |
Set the current directory
dir | the index of the directory to read, or one of the specific IFD index values that are < -1 |
Definition at line 88 of file ifdfilecontainer.cpp.
References countDirectories().
|
inline |
Set the exif offset if needed.
Definition at line 135 of file ifdfilecontainer.hpp.
References locateDirsPreHook(), and locateImageData().