Name
AllocBitMap -- allocate a new software bitmap (V6.0, optional)
Synopsis
APTR handle = AllocBitMap(int type, int width, int height, ULONG flags,
                  struct hwTagList *tags);
Function
This function has to allocate a software bitmap of the specified type in the requested dimensions. The type parameter can be one of the following constants:

HWBMTYPE_RGB:
Hollywood wants you to allocate a color bitmap.

HWBMTYPE_ALPHA:
Hollywood wants you to allocate an 8-bit alpha channel bitmap. Alpha channel bitmaps contain transparency information ranging from 0 (pixel is transparent) to 255 (pixel is fully opaque) for every pixel. Hollywood's software bitmaps always store alpha channel information for color bitmaps in separate bitmaps to be compatible with 15-bit and 16-bit screenmodes which don't have enough room to store an 8-bit alpha channel in a bitmap.

HWBMTYPE_MASK:
Hollywood wants you to allocate a monochrome 1-bit mask bitmap. Mask bitmaps are used to store information about pixel transparency settings. In contrast to alpha channel bitmaps only two different states are supported: Visible pixels (1) or invisible pixels (0).

HWBMTYPE_CLUT:
Hollywood wants you to allocate a CLUT bitmap. This can only ever happen if you have set HWSDAFLAGS_CLUTBITMAPADAPTER in hw_SetDisplayAdapter(). In that case, you must allocate a bitmap that can store 1 byte per pixel. Note that CLUT bitmaps in Hollywood always use 1 byte per pixel, no matter if the bit depth is 8 or less than that. (V9.0)

The flags parameter can be a combination of the following flags:

HWABMFLAGS_CLEAR:
If this flag is set, Hollywood wants you to clear the bitmap after allocating. Clearing a bitmap means that all bits should be set to 0.

Hollywood also passes a taglist to this function. Your implementation has to handle the following tags:

HWABMTAG_FRIENDBITMAP:
If type is HWBMTYPE_MASK, the pData element of this tag item can contain a pointer to a color bitmap that Hollywood wants to use this mask for. The mask can then be allocated in a way that allows efficient blitting.

HWABMTAG_DATA:
If this tag is given, your AllocBitMap() implementation must initialize the bitmap it has just allocated with the bits provided in the pData member of this tag. If this tag is set, Hollywood will also always pass the HWABMTAG_DATABYTESPERROW to inform your implementation about the byte length of a single row of the pixel array that has been passed to this function in the pData member. HWABMTAG_DATA is only used for types HWBMTYPE_MASK or HWBMTYPE_ALPHA.

HWABMTAG_DATABYTESPERROW:
If HWABMTAG_DATA is set, this tag contains the byte width of a single row in its iData member. To find out the total size of the array passed to you in HWABMTAG_DATA, multiply this value with the height of the bitmap.

See Bitmap information for more information on Hollywood bitmaps.

AllocBitMap() is an optional API and must only be implemented if HWSDAFLAGS_BITMAPADAPTER has been passed to hw_SetDisplayAdapter(). See hw_SetDisplayAdapter for details.

Inputs
type
desired bitmap type (see above)
width
width of the bitmap in pixels
height
height of the bitmap in pixels
flags
allocation flags (see above)
tags
taglist for additional options (see above)
Results
handle
handle to the bitmap or NULL in case of an error

Show TOC