Re: [Plib-devel] Texture loading problems (bmp/rgb)
Brought to you by:
sjbaker
From: Jan R. <slo...@gm...> - 2006-11-21 16:48:52
|
Am Sat, 18 Nov 2006 09:08:35 -0600 schrieb steve <sjb...@ai...>: > Yes - that's it exactly. There is an 'upside down' flag. This > is a typically stupid Microsoftian coding stupidity. It makes > it very fractionally easier for some programs to write out images > if they store them that way up internally - at the price of > belabouring every single image reading program with the additional > code to conditionally flip them back the right way around. > Worse still, the BMP file format is a horrible mess with > multiple headers inside other headers - each of which can have > duplicates of that flag bit. Some programs set all of the > flag bits - others set only one of them - some seem to treat > the bit as applying consecutively so two 'invert' flags are > supposed to flip it back the right way up. Steve, I found some more detailed information on the .bmp (DIB) format on MSDN: http://msdn2.microsoft.com/en-us/library/ms532290.aspx But I didn't find any information about nested headers with duplicate "upside down" flags. I only found this: "biHeight Specifies the height of the bitmap, in pixels. If biHeight is positive, the bitmap is a bottom-up DIB and its origin is the lower-left corner. If biHeight is negative, the bitmap is a top-down DIB and its origin is the upper-left corner." The biHeight field can only appear once in a bmp file, so it shouldn't be a problem to get the orientation right. I think I'll prepare a patch, but I guess this will breakt 3ds loading until we also remove the forced bmp texture flipping there... Kind regards, Jan R. -- Jan Reucker email: jan dot reucker at web dot de web: http://www.reucker-online.de |