GetCelDataBufferSize

Returns a cel's data buffer size.

Synopsis

int32 GetCelDataBufferSize(CCB *cel)

Description

Calculates the size needed for a cel data buffer based on the values found in the cel's preamble words.The calculations take into account the cel's bits per pixel and source width values, and padding for the cel engine's alignment, and look ahead requirements.

The return value is the size needed for the buffer, and not necessarily the size of the buffer currently attached to the cel. For example, using this function on a SubRect cel would return the size needed for the sub-rectangle, not the size currently used by the full-size source data attached to the cel.

This function can be called when the cel has no buffer yet, providing that the CCB_CCBPRE flag is set. In this sense, it can be useful for calculating how big a data buffer to allocate.

This function exists primarily to support library internals, but may be useful for applications as well.

Arguments

cel
Pointer to a cel.

Return Value

Bytes needed for the buffer.

Implementation

Library call implemented in lib3do.lib.

Associated Files

lib3do.lib, celutils.h