mr_ped Messages: 802 Registered: November 2005 Location: Czech Republic - Praha
I thought it will be easy to do this, but can't figure it out.
One<StreamRaster> raster = StreamRaster::OpenAny(in);
//... then something like:
const byte * data = raster->GetLine( y ).GetRawData();
this does convert RGBA image into 1bpp bmp, load it back from disk and then it's easy to read raw data trough const byte * data pointer.
Now I'm trying to cut out that unnecessary save/load on disk sequence, and I can't find any simple way.
So far it looks to me like these are only options:
1) create my own RawEncoder : StreamRasterEncoder which would do the 1bpp conversion in same way as BMPEncoder does it
2) use RasterFormat to do the conversion line by line (in such case I would like too see what's the simplest way to initialize it for RGBA (B&W only, no AA) -> 1bpp conversion.
3) use BMPEncoder on some memory stream and read it back from that stream like I'm doing it now from file?
4) give up and simply do my own conversion code (it's trivial as the source image is B&W only anyway, it's not true RGBA pic)
any upp guru to tell me which solution is nice and simple to do?