Alpha channels / CyberGraphX help
  • Just looking around
    Futaura
    Posts: 8 from 2006/9/21
    From: UK
    I'm currently working on enabling full alpha channel support in IBrowse 2.5 for when it is running on MorphOS (well, using CGX V51 as a test to enable it), without a working MorphOS system, and am wondering if anybody can give clarification on the following as I seem to recall there were some discrepancies in CyberGraphX when it came to 24 vs 32-bit depths?

    1. For 24-bit bitmaps with an alpha channel, what do BMA_DEPTH and CYBRMATTR_DEPTH return - 24 or 32? Presumably, CYBRMATTR_BPPIX returns 4 (or 3 if there is no alpha). I need a way to detect if a bitmap allocated using a friend bitmap is alpha capable.

    2. When using AllocBitMap() to allocated a 24-bit bitmap with alpha, presumably I just need to specify the depth as 32?

    3. For 32-bit datatype images, I will be using PDTM_READPIXELARRAY with PBPAFMT_RGBA and writing it into a bitmap with WritePixelArray() RECTFMT_RGBA. Or do I need to use WritePixelArrayAlpha()?

    4. When rendering a bitmap with alpha, can I still use BltBitMap[RastPort]() or do I need to use the new BltBitMap*Alpha() equivalent functions in CGX?

    I couldn't find any documentation that answered these queries, so hoping somebody more knowledgable can help me :-)

    [ Edited by Futaura 18.09.2019 - 10:36 ]
  • »18.09.19 - 09:36
    Profile Visit Website
  • MorphOS Developer
    jacadcaps
    Posts: 2968 from 2003/3/5
    From: Canada
    1. That'd be 32 bit.

    2. That depends on the purpose of the bitmap I suppose. If you want to be using accelerated system functions to alpha-blit its contents to your window, you will likely want to specify BMF_FRIEND and screen->RPort's BitMap to ensure the bitmap will be in a friendly pixel format.

    3. WPA() should do because you want to retain the alpha channel in the target bitmap.

    4. You do need to use the new BltBitMap Alpha functions.

    By the way, there are instructions on how to run MorphOS in qemu, so you can test your code that way even if you don't have the hardware that could run it natively.
  • »18.09.19 - 10:00
    Profile Visit Website
  • Just looking around
    Futaura
    Posts: 8 from 2006/9/21
    From: UK
    Thanks. I didn't know about qemu and now have MorphOS running in that.
  • »27.09.19 - 20:40
    Profile Visit Website