9 #ifndef DOXYGEN_SHOULD_SKIP_THIS 12 template <
class TI,
class TO,
int dim>
bool readBuffer(Image<TO,dim> &I, std::istream &in) {
13 size_t size = I.totalSize();
14 TI *buffer =
new TI[size];
15 in.read((
char *)buffer,size*
sizeof(TI));
16 for (
size_t i=0;i<size;i++) I[i] = TO( buffer[i] );
21 template <
class TO,
class TI,
int dim>
bool writeBuffer(
const Image<TI,dim> &I, std::ostream &out) {
22 size_t size = I.totalSize();
23 TO *buffer =
new TO[size];
24 for (
size_t i=0;i<size;i++) buffer[i] = TO( I[i] );
25 out.write((
char *)buffer,size*
sizeof(TO));
Imagine++ namespace.
Definition: Array.h:7