[Gdal-dev] 1 and 4 bits image

Sylvain Rioux sylvain.rioux at softmaptech.com
Wed Apr 30 10:49:07 EDT 2003


Hi,

I am having trouble with 16-colors bitmaps (4 bits) and i was wondering at
how GDAL manages this format. I get a bitmap where the pixels values seem to
have been slighly shifted and the result is far from what i expected. This
problem does also occur with monochrome bitmaps. So far i successfully read
256 colors bitmaps and, gifs, jpegs, and the other raster formats supported
by GDAL.It seems clear to me that the fact that the pixels are defined on 1
or 4 bits rather than a byte causes this misalignment.

I'm using Windows and my current procedure is to use a BITMAPINFO structure,
and fill the pixel values buffer with GDALDataset::RasterIO(...). This works
for all the raster images i tried. So, to get to the point, i want to know
how RasterIO actually fills the buffer when reading 4 bits bitmap.

Thanks.
Sylvain Rioux

Les technologies SoftMap (2002) inc.
400, boul. Jean-Lesage, bureau 540
Québec (Québec)
Canada G1K 8W1

Tél. : (418) 523-2929, poste 304
Téléc. : (418) 523-7979
sylvain.rioux at softmaptech.com
www.softmaptech.com


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20030430/cf42304c/attachment.html


More information about the Gdal-dev mailing list