24 #include <libopenraw/debug.h> 27 #include "endianutils.hpp" 28 #include "rawcontainer.hpp" 30 using namespace Debug;
36 RawContainer::RawContainer(
const IO::Stream::Ptr &_file, off_t _offset)
42 m_file->seek(_offset, SEEK_SET);
52 bool RawContainer::readInt8(
const IO::Stream::Ptr &f, int8_t & v)
55 int s = f->read(&buf, 1);
63 bool RawContainer::readUInt8(
const IO::Stream::Ptr &f, uint8_t & v)
66 int s = f->read(&buf, 1);
77 if (m_endian == ENDIAN_NULL) {
79 Trace(ERROR) <<
"null endian\n";
84 int s = f->read(buf, 2);
101 if (m_endian == ENDIAN_NULL) {
103 Trace(ERROR) <<
"null endian\n";
107 unsigned char buf[4];
108 int s = f->read(buf, 4);
110 Trace(ERROR) <<
"read " << s <<
" bytes\n";
128 if (m_endian == ENDIAN_NULL) {
130 Trace(ERROR) <<
"null endian\n";
134 unsigned char buf[2];
135 int s = f->read(buf, 2);
152 if (m_endian == ENDIAN_NULL) {
154 Trace(ERROR) <<
"null endian\n";
158 unsigned char buf[4];
159 int s = f->read(buf, 4);
180 m_file->seek(_offset, SEEK_SET);
181 s =
m_file->read(buf, buf_size);
size_t fetchData(void *buf, off_t offset, size_t buf_size)
CIFF is the container for CRW files. It is an attempt from Canon to make this a standard. I guess it failed.
bool readUInt32(const IO::Stream::Ptr &f, uint32_t &v)
bool readUInt16(const IO::Stream::Ptr &f, uint16_t &v)
bool readInt32(const IO::Stream::Ptr &f, int32_t &v)
bool readInt16(const IO::Stream::Ptr &f, int16_t &v)