The mask interface is an interface for leaf nodes which export their appearance as a bitmap. It does not have any interesting public methods.
Every object implementing the mask interface must also implement the object interface and the node interface. No object implementing the mask interface is allowed to implement any of the container or shape interfaces.
void vcl_mask_render (void * obj, const struct geom_transform *t, const struct vcl_rectangle *bbox, const struct geom_rectangle *bbox_local, u8** buff, uns * buff_len, struct vcl_rectangle *retbox)
This method is requested for rendering the appearance of
obj to a
bitmap. The meaning of the bitmap is 1 for an occupied pixel and 0 for an unoccupied
pixel. So there is only information about occupied area, not about color and
so on. The
t argument is the required transformation from the
coordinate system to the pixel coordinate system. Arguments
bbox_local are bounding boxes of the caller's area of interest –
anything out of one of them is not required to be rendered
bbox is in pixel coordinates,
obj's coordinates. Arguments
are for bitmap buffer – if the buffer is small (or
NULL), then the callee is
responsible for reallocating it using
xrealloc and update the value of
*buff_len, which is the buffer size
in bytes. The callee must fill
*retbox to the (pixel)
coordinates of the returned bitmap.