You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This mimics how Amiga OS stores its bitmaps. It's a bit hacky but explainable, and indeed misses some comments in the code.
This comes from assumption that some parts of the code might calculate amount of data in the bitmap rectangle by doing BytesPerRow * Rows. Having BytesPerRow pre-multiplied by depth allows some code paths to work either for non-interleaved and interleaved bitmaps, e.g. in blit.c:
the other explanation is that otherwise you'd have to do BytesPerRow * Rows * Depth, and this gives you 2 multiplications, which are quite slow on an A500, so that gives you a nice speed boost here and there.
Even if you don't have further questions about it, let's keep the issue open so that it can be closed when a PR with some in-code/docs explanation lands.
To get the proper BytesPerRow you might want to use bitmapGetByteWidth().
When we get #9, premultiplied value could be stored separately and that could eliminate the need for bitmapGetByteWidth().
In
bitmap.c
:This line
pBitMap->BytesPerRow *= ubDepth;
bother me.What I understood from interleaved bitmap is 1 bit is color and each bitmap is layer.
So a 32 width pixel image should be 4 bytes (so 32 bits) for one row.
And this on 4 bitplane for a 16 colors images.
According to this code the BytesPerRow become 16, so 16 bytes by row.
Did I completely losted my mind and misunderstanding interleaved or did I put my finger on a mistake in the code ?
(under the hood : I am trying to do a xflip method which drive me crazy)
The text was updated successfully, but these errors were encountered: