Name
hw_RawRectFill -- draw filled rectangle to pixel buffer (V6.0)
Synopsis
void hw_RawRectFill(APTR dst, int x, int y, int width, int height,
         ULONG color, ULONG flags, struct hwTagList *tags);
Function
This function can be used to draw a filled rectangle to a raw pixel buffer. Note that this function does not draw to a Hollywood bitmap, but to a raw pixel buffer only. This makes it possible to use hw_RawRectFill() in lots of different contexts. If you want to use hw_RawRectFill() on a Hollywood bitmap, you need to lock the bitmap first using hw_LockBitMap() and then pass the raw pixel buffer pointer obtained by hw_LockBitMap() to hw_RawRectFill().

The following tags are recognized by hw_RawRectFill():

HWRRFTAG_PIXFMT:
This tag can be used to set the pixel format hw_RawRectFill() should use when drawing into the pixel buffer. You have to pass a pixel format constant in the iData member of this tag. See Pixel format information for details. This tag defaults to HWOS_PIXFMT_ARGB32.

HWRRFTAG_DSTWIDTH:
This tag must be specified. You have to pass the number of pixels per row in the destination buffer in the iData member of this tag. If you don't pass this tag, hw_RawRectFill() won't work.

HWRRFTAG_CLIPRECT:
This tag can be used to make hw_RawRectFill() clip its output to the specified clipping rectangle. If you pass this tag, you must set the pData member of the tag to a struct hwRect containing the desired clipping rectangle. Note that by default there is no clipping at all, so you must make sure that the destination raw pixel buffer is large enough. (V8.0)

Additionally, hw_RawRectFill() supports the following flags:

HWRRFFLAGS_BLEND:
If this flag is set, then hw_RawRectFill() will draw a rectangle with alpha-blending to the destination pixel buffer. The blend intensity is taken from the upper 8 bits in the color parameter that you've passed to hw_RawRectFill(). If this flag is not set, then hw_RawRectFill() will just draw with a static color.

Note that by default this function does not do any clipping. You must make sure that the destination raw pixel buffer is large enough or use the HWRRFTAG_CLIPRECT tag to set a clipping rectangle.

Designer compatibility
Unsupported

Inputs
dst
pointer to destination raw pixel buffer
x
start x-offset of rectangle
y
start y-offset of rectangle
width
number of columns to draw
height
number of rows to draw
color
ARGB color to use; the A component is only used if HWRRFFLAGS_BLEND has been set
flags
additional drawing flags (see above)
tags
additional drawing tags (see above)

Show TOC