Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
142 user(s) are online (131 user(s) are browsing Forums)

Members: 1
Guests: 141

Skateman, more...

Support us!

Headlines

 
  Register To Post  

(1) 2 »
CyberGFX to P96 conversion
Supreme Council
Supreme Council


See User information
Hello.

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.

This is the cbgfx call:

ICyberGfx->WriteLUTPixelArray(srcRect,srcX,SrcY,ScrMod,rastport,
ColorTab,destX,destY.SizeX,SizeY,CTFormat)

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.

Vacca foeda. Sum, ergo edo

Mr Bobo Cornwater
Go to top
Re: CyberGFX to P96 conversion
Not too shy to talk
Not too shy to talk


See User information
@orgin

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.

Go to top
Re: CyberGFX to P96 conversion
Supreme Council
Supreme Council


See User information
@COBRA

Because I want to learn how to.

Vacca foeda. Sum, ergo edo

Mr Bobo Cornwater
Go to top
Re: CyberGFX to P96 conversion
Not too shy to talk
Not too shy to talk


See User information
@orgin

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.

Go to top
Re: CyberGFX to P96 conversion
Supreme Council
Supreme Council


See User information
@COBRA

struct RenderInfo {
APTR Memory;
WORD BytesPerRow;
WORD pad;
RGBFTYPE RGBFormat;
};

tried using these values:

rinfo.Memory = mychunkybuffer;
rinfo.BytesPerRow = 800;
rinfo.pad = 0;
rinfo.RGBFormat = RGBFF_CLUT;

But all I get is a gray rendering in a third of its intended width.

p96 call:

IP96->p96WritePixelArray(&rinfo, (UWORD)0, (UWORD)0, rp, win->BorderLeft, win->BorderTop, 800, 600);

The Picasso96.h file mentions that I could use IGraphics->SetRGB32() for the palette table, but that just mess up the whole palette for the WB.

Vacca foeda. Sum, ergo edo

Mr Bobo Cornwater
Go to top
Re: CyberGFX to P96 conversion
Not too shy to talk
Not too shy to talk


See User information
@orgin

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.

Go to top
Re: CyberGFX to P96 conversion
Supreme Council
Supreme Council


See User information
@COBRA

Hmm, it requires 8 planepointers. How do I handle that when it's chunky and not planar?

Vacca foeda. Sum, ergo edo

Mr Bobo Cornwater
Go to top
Re: CyberGFX to P96 conversion
Not too shy to talk
Not too shy to talk


See User information
@orgin

I don't know from the top of my head, but you might find some useful information here:
http://utilitybase.com/forum/index.ph ... um=2&topic=1031&page=0#13

Go to top
Re: CyberGFX to P96 conversion
Supreme Council
Supreme Council


See User information
@COBRA

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.

Vacca foeda. Sum, ergo edo

Mr Bobo Cornwater
Go to top
Re: CyberGFX to P96 conversion
Not too shy to talk
Not too shy to talk


See User information
@orgin

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.

Go to top
Re: CyberGFX to P96 conversion
Home away from home
Home away from home


See User information
@orgin

Quote:

orgin wrote:
Hello.

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.

This is the cbgfx call:

ICyberGfx->WriteLUTPixelArray(srcRect,srcX,SrcY,ScrMod,rastport,
ColorTab,destX,destY.SizeX,SizeY,CTFormat)

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.

Hans

Join Kea Campus' Amiga Corner and support Amiga content creation
https://keasigmadelta.com/ - see more of my work
Go to top
Re: CyberGFX to P96 conversion
Supreme Council
Supreme Council


See User information
@COBRA

BOOL BltBitMapRastPort(CONST struct BitMap *, WORDWORD,
struct RastPort *, WORD,
WORDWORDWORDUBYTE);

       
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

struct BitMap
{
    
UWORD    BytesPerRow;
    
UWORD    Rows;
    
UBYTE    Flags;
    
UBYTE    Depth;
    
UWORD    pad;
    
PLANEPTR Planes[8];
};


No palette. Only planar bitmaps.

What am I missing?

Vacca foeda. Sum, ergo edo

Mr Bobo Cornwater
Go to top
Re: CyberGFX to P96 conversion
Not too shy to talk
Not too shy to talk


See User information
@orgin

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...

Go to top
Re: CyberGFX to P96 conversion
Not too shy to talk
Not too shy to talk


See User information
@orgin

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.

Go to top
Re: CyberGFX to P96 conversion
Supreme Council
Supreme Council


See User information
@COBRA

oki :/

Thanks for taking time to check it out.

Vacca foeda. Sum, ergo edo

Mr Bobo Cornwater
Go to top
Re: CyberGFX to P96 conversion
Amigans Defender
Amigans Defender


See User information
@COBRA
What about BlitBitMapTags() with the BLITA_CLUT tag?

ExecSG Team Lead
Go to top
Re: CyberGFX to P96 conversion
Supreme Council
Supreme Council


See User information
@ssolie

Not available in the latest public SDK.

Vacca foeda. Sum, ergo edo

Mr Bobo Cornwater
Go to top
Re: CyberGFX to P96 conversion
Amigans Defender
Amigans Defender


See User information
@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.

ExecSG Team Lead
Go to top
Re: CyberGFX to P96 conversion
Home away from home
Home away from home


See User information
@ssolie

Quote:

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.

Hans

Join Kea Campus' Amiga Corner and support Amiga content creation
https://keasigmadelta.com/ - see more of my work
Go to top
Re: CyberGFX to P96 conversion
Not too shy to talk
Not too shy to talk


See User information
@Hans

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.

Go to top

  Register To Post
(1) 2 »

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project