25 #include <libopenraw/debug.h> 28 #include "endianutils.hpp" 29 #include "rawcontainer.hpp" 31 using namespace Debug;
37 RawContainer::RawContainer(
const IO::Stream::Ptr &_file, off_t _offset)
43 m_file->seek(_offset, SEEK_SET);
52 bool RawContainer::skip(off_t offset)
54 m_file->seek(offset, SEEK_CUR);
59 RawContainer::readInt8(
const IO::Stream::Ptr &f)
62 int s = f->read(&buf, 1);
70 RawContainer::readUInt8(
const IO::Stream::Ptr &f)
73 int s = f->read(&buf, 1);
83 if (m_endian == ENDIAN_NULL) {
85 LOGERR(
"null endian\n");
90 int s = f->read(buf, 2);
108 if (m_endian == ENDIAN_NULL) {
109 LOGERR(
"null endian\n");
113 if (v.size() < count) {
118 for (
size_t i = 0; i < count; i++) {
119 int s = f->read(buf, 2);
140 if (m_endian == ENDIAN_NULL) {
141 LOGERR(
"null endian\n");
144 unsigned char buf[4];
145 int s = f->read(buf, 4);
147 LOGERR(
"read %d bytes\n", s);
162 if (m_endian == ENDIAN_NULL) {
164 LOGERR(
"null endian\n");
168 unsigned char buf[2];
169 int s = f->read(buf, 2);
184 if (m_endian == ENDIAN_NULL) {
185 LOGERR(
"null endian\n");
189 unsigned char buf[4];
190 int s = f->read(buf, 4);
207 m_file->seek(_offset, SEEK_SET);
208 s =
m_file->read(buf, buf_size);
215 return m_file->filesize();
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.
Option< int16_t > readInt16(const IO::Stream::Ptr &f)
Option< uint32_t > readUInt32(const IO::Stream::Ptr &f)
size_t readUInt16Array(const IO::Stream::Ptr &f, std::vector< uint16_t > &v, size_t count)
Option< uint16_t > readUInt16(const IO::Stream::Ptr &f)
Option< int32_t > readInt32(const IO::Stream::Ptr &f)