Function | Package: cg | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 9.0 Unrevised from 8.2 to 9.0. 8.2 version

## generate-mask

Arguments: pixmap transparent-pixel-value

Automatically creates a mask for pixmap that causes the pixmap to be transparent wherever transparent-pixel-value occurred in the pixmap's contents. The created mask texture is returned, and is set to be the mask property of the pixmap.

pixmap should be the pixmap to be given a mask. See cg-pixmaps.htm for an overview of pixmap functionality.

transparent-pixel-value should be a non-negative integer or `nil`. Any pixel in the contents of the pixmap that has this value will become transparent. This is done by setting the mask's pixel value to one and the main image's pixel value to zero, just as you would need to do if you constructed the pixmap's mask-contents yourself.

If transparent-pixel-value is not zero, this means that the existing main texture of the pixmap will be modified by this function. In any case, the pixmap will be given a new mask, and any mask that the pixmap had will be removed from the pixmap.

If the transparent-pixel-value argument is `nil`, the value of the upper-left pixel of the pixmap is taken as the value to make transparent.

Copyright (c) 1998-2019, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 8.2 page.
Created 2012.5.30.

|  | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 9.0 Unrevised from 8.2 to 9.0. 8.2 version