Boost logo

Boost :

Subject: [boost] best way to serialize a GIL image
From: Tom Brinkman (reportbase_at_[hidden])
Date: 2009-03-25 17:42:20


int width = 200;
int height = 200;
rgb8_image_t img(width,height);
unsigned char* buffer = interleaved_view_get_raw_data(view(img));

FILE* fd = fopen(path,"wb");
fprintf(fd, "P6\n# CREATOR: unknown\n%d %d\n255\n",width,height);
fwrite(buffer,1,width*height*3,fd);
fclose(fd);

GIL is just a wrapper around your buffer. No direct serialization
support is provided nor needed.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk