APTR lock = LockBitMap(APTR handle, ULONG flags, struct hwos_LockBitMapStruct *bmlock, struct hwTagList *tags);
struct hwos_LockBitMapStruct
to
this function. Your implementation must then fill this structure with all necessary
information. struct hwos_LockBitMapStruct
looks like this:
struct hwos_LockBitMapStruct { APTR Data; // [out] int Modulo; // [out] int PixelFormat; // [out] int BytesPerPixel; // [out] int Width; // [out] int Height; // [out] }; |
Your LockBitMap()
implementation has to write the following information to the
individual structure members:
Data:
Modulo:
HWBMTYPE_RGB
this value must be specified in pixels. For
the other bitmap types, this value must be specified in bytes.
PixelFormat:
Data
. See Pixel format information for details.
BytesPerPixel:
Width:
Height:
Hollywood will also pass a combination of flags to this function. The following flags are currently supported:
HWLBMFLAGS_READONLY:
Data
member of the struct hwos_LockBitMapStruct
.
LockBitMap()
has to return a lock handle for this bitmap. This is an opaque datatype
only known by your plugin. It's only used to unlock the bitmap again when Hollywood is
finished with it. Hollywood will call UnLockBitMap() then, passing
the handle which was returned by LockBitMap()
. If this function fails to lock the bitmap,
return NULL
.
This function will usually be called very often by Hollywood so your implementation should be efficient and should not have to copy the pixels to a new memory block first. Instead, it should be designed in a way that allows immediate access to the pixel data.
LockBitMap()
is an optional API and must only be implemented if HWSDAFLAGS_BITMAPADAPTER
has been passed to hw_SetDisplayAdapter(). See hw_SetDisplayAdapter for details.
struct hwos_LockBitMapStruct
to be filled out by this functionNULL
)NULL
in case there was an error