English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   Coders. System (https://eab.abime.net/forumdisplay.php?f=113)
-   -   Covert BitMap to ImageData for Bobs (https://eab.abime.net/showthread.php?t=98016)

thyslo 07 July 2019 13:52

Covert BitMap to ImageData for Bobs
 
I'm just trying to display a Bob using the GELs system.

RKRM Libraries page 637 contains a description of the image format needed to display a Bob properly.

However I loaded the image already using datatypes. Now I've a pointer to the struct BitMap of the image data.

I just don't know how to convert it.

Is there any known way to convert the BitMap->Planes to the Bob format?

Thomas Richter 07 July 2019 16:37

Quote:

Originally Posted by thyslo (Post 1331109)
Is there any known way to convert the BitMap->Planes to the Bob format?

It's really quite simple. The bob "ImageData" field is the concatenation of all image planes, bob->Depth of them. Each plane is an array that is (bob->Width + 15) & -16 bytes wide and bob->Height lines high. Or to put it in simple words, if you have a "struct Bitmap", and this bitmap is non-interleaved, planar, then "bob->ImageData" is simply the concatenation of all the data which is found in the Bitmap->PlanePtrs. For example:
Code:

NEWOB myNewBob = {      /* Data for the new ob structure defined in animtools.h */        bob_data2,NULL, /* Image,ColorSet */        32,4,2,2,      /* Width,Heigth,Depth,RasterDepth      */        160,100,        /* x,y                  */        SAVEBACK | OVERLAY,ISBOB,      /* Flags,ExtraFlags    */        3,0,            /* PlanePick,PlaneOnOff        */        0,0            /* meMask,hitMask */ };
is a bob of 32 pixels wide and 4 pixels high, two bitplanes. A potential image data array then reads as follows:
Code:

UWORD __chip bob_data2[2*2*GEL_SIZE]={        /*plane 1*/        0xaaaa,0xaaaa,0xaaaa,0xaaaa,0xaaaa,0xaaaa,0xaaaa,0xaaaa,        /*plane 2*/        0x5555,0x5555,0x5555,0x5555,0x5555,0x5555,0x5555,0x5555 };
HTHH, Thomas


All times are GMT +2. The time now is 01:21.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.04139 seconds with 11 queries