I have a small demo program that I wrote for AROS years ago. I've rewritten it for OS4 and it runs fine, but it uses a cybergraphics.library call that I want to convert into a Picasso96API.library.
I'm copying from an 8bit chunky array to the destination rastport that is inside a window on the wb (24bit).
Any idea how to do this with the p96API? I've tried using p96WritePixelArray but I can't get the results I'm after. And you can't specify the ColorTab pen conversion array.
Is there any particular reason you want to change it to P96 API? The CGX call will map to a P96 function anyway so there won't be any noticable speed increase.
I'm at work now so I can't access to the P96 SDK files to check it... but you might want to have a look at the RenderInfo structure to see if it has anything in there to specify a colour palette.
If you can't specify a palette then it of course can't perform the conversion based on the palette. I don't remember how you can specify a palette for that function (if it's possible at all). Another thing you could do is allocate a struct BitMap, and initialize it with a pointer to your chunky data and palette. And then you can simply do a BltBitMapRastPort() to your screen/window and P96 will automatically convert.
BltBitMapTags() doesn't seem to be in the latest available SDK though. So it seems I would have to write the conversion code myself. So I'll wait for the next SDK.
No, you simply use graphics.library BltBitMapRastPort() with a source bitmap being a chunky 8-bit bitmap with some palette, and P96 will perform the conversion transparently.
I have a small demo program that I wrote for AROS years ago. I've rewritten it for OS4 and it runs fine, but it uses a cybergraphics.library call that I want to convert into a Picasso96API.library.
I'm copying from an 8bit chunky array to the destination rastport that is inside a window on the wb (24bit).
Any idea how to do this with the p96API? I've tried using p96WritePixelArray but I can't get the results I'm after. And you can't specify the ColorTab pen conversion array.
From memory, Picasso96 doesn't expose this function in its own API, even though it's there in the Cybergraphics emulation. My biggest complaint about Cybergraphics functions is that you have to create a rastport for the bitmap, even though there's nothing in the rastport that is needed for truecolour blitting operations.
@COBRA
Nice to know that BltBitmapTags() has all the functionality required. It would be great if we didn't even have to open the Picasso96 library at all.
BOOL BltBitMapRastPort(CONST struct BitMap *, WORD, WORD, struct RastPort *, WORD, WORD, WORD, WORD, UBYTE);
srcbm - a pointer to the source bitmap srcx - x offset into source bitmap srcy - y offset into source bitmap destrp - a pointer to the destination rastport destX - x offset into dest rastport destY - y offset into dest rastport sizeX - width of blit in pixels sizeY - height of blit in rows minterm - minterm to use for this blit
Since it seems Amiga BitMaps cannot have a unique palette, then the screen's palette will be used for the remapping if you use BltBitMapRastPort(). I recommend that you ask on UtilityBase because I never tried to do what you're wantig to do. But if it works with the cgx API, then I see no reason to go through the hassle of doing it differently...
OK, I talked to a few people and the conclusion was, that P96 only supports this functionality through the Cybergraphics API, with the call you mentioned yourself. So you should use that cgx function.
@orgin The point is "...P96 only supports this functionality through the Cybergraphics API..." which I think may be false. I think we do have a function that can do it without using the ancient interfaces.
ssolie wrote: @orgin The point is "...P96 only supports this functionality through the Cybergraphics API..." which I think may be false. I think we do have a function that can do it without using the ancient interfaces.
If there is a P96 function that does the same thing, it's not in the autodocs, or the header files.
Its not in P96. picasso96api.library is provided for legacy reasons. Once the new SDK is out, the updated functionality is all in graphics.library, right where it should be and where it would have always been if commodore hadn't gone tits up.
graphics.library provides new functions for blitting and composition.
Also, cairo provides a whole new API for graphics as standard as well.