Hey, after some tests it turned out that the Flood() procedure in its current form works only on planar bitmaps.
@thomas
Quote:
What does the destination bitmap/rastport contain?
It contains bitmap allocated via AllocBitMap(), the RastPort is initialized by InitRastPort() and then the bitmap is attached to it.
Quote:
Did you read the desctiption of Flood? It works differently than usual fill functions in paint programs for example.
Yes, I did. When the 2nd argument equals to 1 it should act exactly like it is in paint programs.
Quote:
Edit: your TmpRas ist not initialized correctly. The size should be RASSIZE(256,256), not 256*256. We are talking about a single bitplane, not a chunky bitmap.
Thanks, yes, the RASSIZE(256, 256) gives the correct size of one bitplane. I was a bit confused whether this data should be in chunky or planar.
So it turned out that the Flood() in its current form works properly
only on up-to 8 bit planar bitmaps. Chunky bitmaps aren't supported. I tested it with good results on AmigaOS3.5 and AmigaOS4.1.
Worth noticing is the fact that other areafill functions like AreaEllipse work correctly on any bitmap.
To allocate planar bitmap you need to provide NULL argument in the FriendBitMap field. So with bitmaps allocated with:
IGraphics->AllocBitMap( WIDTH, HEIGHT, DEPTH, BMF_CLEAR, NULL)where 1 <= DEPTH <= 8 the Flood() procedure will work correctly, but with bitmaps allocated via:
IGraphics->AllocBitMap( WIDTH, HEIGHT, DEPTH, BMF_CLEAR, friendbm);the Flood() procedure won't work correctly.
I need to use the Flood() on 24-bit chunky bitmaps so I probably will need to create my own 24-bit Flood() function. It should not be that hard to accomplish I hope.