[interfacekit] Provisional BBitmap, libstorage.so Integration
- From: "Ingo Weinhold" <bonefish@xxxxxxxxxxxxxxx>
- To: "Interface Kit" <interfacekit@xxxxxxxxxxxxx>
- Date: Tue, 03 Sep 2002 03:19:45 CEST (+0200)
Hi folks,
I finished my implementation of a provisional BBitmap and incorporated
libstorage.so into libopenbeos.so. So far everything still seems to
work (or in some cases still doesn't ;-).
Regarding BBitmap, I realized, that BBitmap::SetBits() does not only
have a weird specification, but the R5 implementation is also pretty
much broken. For those who aren't familar with it: SetBits() imports
data from a supplied buffer into the bitmap's data, doing color space
conversion, if necessary. Unfortunately the guy spec'ing this methods
must have considered it to be a good idea, that when specifying B_RGB32
as the color space for the supplied data, actually B_RGB24_BIG
formatted data without row padding are expected. Whereas for other
color spaces the respectively formatted (+padded) data are required.
Even more unfortunate is the fact, that the function doesn't implement
this behavior very closely, e.g. if B_CMAP8 is given, padding must be
omitted, but only if the bitmap itself doesn't use B_CMAP8, otherwise
it is needed. Support for B_GRAY1 seems to be completely broken.
To deal with these problems I implemented two new, more powerful
methods, namely BBitmap::ImportBits(), which work as expected, and
mapped SetBits() to them, mimicing the original behavior as closely as
reasonable. I would tend to declare SetBits() deprecated, as it is
quite some source of confusion. E.g. the original implementors of
BNodeInfo and BAppFileInfo didn't seem to know, that SetBits() behaves
as it does, for they use it to convert bitmaps from and to B_CMAP8 (for
icons), which doesn't work, for the reasons mentioned above. BTW, I was
ignorant myself and used SetBits() when implementing these classes, but
I will fix that tomorrow. I guess the icon methods of BMimeType need to
be reviewed as well.
Well, it looks like we're drawing near milestone 2. Only some bits of
BMimeType functionality are missing and the BRoster::FindApp()
methods...
CU, Ingo
Other related posts: