31 #include "../image_info.hpp"
62 static std::streampos
read_header(std::ifstream &is,
103 std::fill(data.begin(),data.end(),0);
104 typename CTYPE::iterator iter = data.begin();
105 typename CTYPE::value_type v_old = 0;
107 for(
typename CTYPE::value_type &v: data)
114 try { is.read((
char *)(&buffer),1); }
117 throw file_error(EXCEPTION_RECORD,
118 "Error reading 1Byte from the CBF stream!");
121 if (((
unsigned char) buffer) != 0x80)
130 try { is.read((
char *) (&buffer), 2); }
133 throw file_error(EXCEPTION_RECORD,
134 "Error reading 2Byte from the CBF stream!");
137 if (((
unsigned short) buffer) != 0x8000)
146 try { is.read((
char*) (&buffer), 4); }
149 throw file_error(EXCEPTION_RECORD,
150 "Error reading 4byte from the CBF stream!");
153 if (((
unsigned int) buffer) != 0x800000)
compression_id
CBF compression id.
Definition: types.hpp:33
image information type
Definition: image_info.hpp:43
reader for DECTRIS detector data
Definition: dectris_reader.hpp:46
Definition: cbf_reader.hpp:41
static void read_data_byte_offset(std::ifstream &is, const pni::io::image_info &info, CTYPE &data)
read data
Definition: dectris_reader.hpp:94
static std::streampos read_header(std::ifstream &is, std::vector< pni::io::image_info > &info, compression_id &ct)
read header information
Definition: dectris_reader.cpp:36