Boost logo

Boost :

Subject: Re: [boost] best way to serialize a GIL image
From: Ross Levine (ross.levine_at_[hidden])
Date: 2009-03-25 19:08:57


An important note: Using \n in a PPM file under windows, if in text
mode, will give you problems because the LF will be interpreted as
pixel data.

2009/3/25 Tom Brinkman <reportbase_at_[hidden]>:
> 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.
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>


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