libopenraw
|
#include <rawcontainer.h>
Public Types | |
enum | EndianType { ENDIAN_NULL = 0, ENDIAN_BIG, ENDIAN_LITTLE } |
Public Member Functions | |
RawContainer (IO::Stream *_file, off_t offset) | |
virtual | ~RawContainer () |
IO::Stream * | file () |
EndianType | endian () const |
bool | readInt8 (IO::Stream *f, int8_t &v) |
bool | readUInt8 (IO::Stream *f, uint8_t &v) |
bool | readInt16 (IO::Stream *f, int16_t &v) |
bool | readInt32 (IO::Stream *f, int32_t &v) |
bool | readUInt16 (IO::Stream *f, uint16_t &v) |
bool | readUInt32 (IO::Stream *f, uint32_t &v) |
size_t | fetchData (void *buf, const off_t offset, const size_t buf_size) |
Protected Member Functions | |
RawContainer (const RawContainer &) | |
RawContainer & | operator= (const RawContainer &) |
void | setEndian (EndianType _endian) |
Protected Attributes | |
IO::Stream * | m_file |
off_t | m_offset |
EndianType | m_endian |
Generic interface for the RAW file container
Definition at line 44 of file rawcontainer.h.
define the endian of the container
ENDIAN_BIG |
no endian found: means invalid file |
ENDIAN_LITTLE |
big endian found little endian found |
Definition at line 48 of file rawcontainer.h.
OpenRaw::Internals::RawContainer::RawContainer | ( | IO::Stream * | _file, |
off_t | offset | ||
) |
file | the stream to read from |
offset | the offset since starting the beginning of the file for the container |
Definition at line 38 of file rawcontainer.cpp.
References m_file, OpenRaw::IO::Stream::open(), and OpenRaw::IO::Stream::seek().
OpenRaw::Internals::RawContainer::~RawContainer | ( | ) | [virtual] |
destructor
Definition at line 48 of file rawcontainer.cpp.
References OpenRaw::IO::Stream::close(), and m_file.
size_t OpenRaw::Internals::RawContainer::fetchData | ( | void * | buf, |
const off_t | offset, | ||
const size_t | buf_size | ||
) |
Fetch the data chunk from the file
buf | the buffer to load into |
offset | the offset |
buf_size | the size of the data to fetch |
Definition at line 178 of file rawcontainer.cpp.
References m_file, OpenRaw::IO::Stream::read(), and OpenRaw::IO::Stream::seek().
Referenced by OpenRaw::Internals::MRWFile::_getRawData(), OpenRaw::Internals::IFDFile::_getRawDataFromDir(), OpenRaw::Internals::MRWFile::_getThumbnail(), OpenRaw::Internals::MRW::DataBlock::DataBlock(), OpenRaw::Internals::CIFF::RecordEntry::fetchData(), OpenRaw::Internals::NEFFile::isCompressed(), and OpenRaw::Internals::IFDEntry::loadData().
bool OpenRaw::Internals::RawContainer::readInt16 | ( | IO::Stream * | f, |
int16_t & | v | ||
) |
Read an int16 following the m_endian set
Definition at line 77 of file rawcontainer.cpp.
References ENDIAN_LITTLE, and OpenRaw::IO::Stream::read().
Referenced by OpenRaw::Internals::IFDDir::load(), and OpenRaw::Internals::IFDDir::nextIFD().
bool OpenRaw::Internals::RawContainer::readInt32 | ( | IO::Stream * | f, |
int32_t & | v | ||
) |
Read an int32 following the m_endian set
Definition at line 101 of file rawcontainer.cpp.
References ENDIAN_LITTLE, and OpenRaw::IO::Stream::read().
Referenced by OpenRaw::Internals::MRW::DataBlock::DataBlock(), OpenRaw::Internals::IFDFileContainer::getDirectoryDataSize(), OpenRaw::Internals::IFDDir::load(), OpenRaw::Internals::IFDDir::nextIFD(), and OpenRaw::Internals::CIFF::ImageSpec::readFrom().
bool OpenRaw::Internals::RawContainer::readUInt16 | ( | IO::Stream * | f, |
uint16_t & | v | ||
) |
Read an uint16 following the m_endian set
Definition at line 128 of file rawcontainer.cpp.
References ENDIAN_LITTLE, and OpenRaw::IO::Stream::read().
Referenced by OpenRaw::Internals::CRWFile::_getRawData(), OpenRaw::Internals::IFDDir::load(), OpenRaw::Internals::CIFF::RecordEntry::readFrom(), and OpenRaw::Internals::MRW::DataBlock::uint16_val().
bool OpenRaw::Internals::RawContainer::readUInt32 | ( | IO::Stream * | f, |
uint32_t & | v | ||
) |
Read an uint32 following the m_endian set
Definition at line 152 of file rawcontainer.cpp.
References ENDIAN_LITTLE, and OpenRaw::IO::Stream::read().
Referenced by OpenRaw::Internals::CRWFile::_getRawData(), OpenRaw::Internals::CIFF::ImageSpec::readFrom(), and OpenRaw::Internals::CIFF::RecordEntry::readFrom().
IO::Stream* OpenRaw::Internals::RawContainer::m_file [protected] |
the file handle
Definition at line 102 of file rawcontainer.h.
Referenced by fetchData(), OpenRaw::Internals::IFDFileContainer::getDirectoryDataSize(), RawContainer(), and ~RawContainer().
off_t OpenRaw::Internals::RawContainer::m_offset [protected] |
the offset from the beginning of the file
Definition at line 104 of file rawcontainer.h.