Function | Package: cg | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 10.1 Unrevised from 10.0 to 10.1. 10.0 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-2022, Franz Inc. Lafayette, CA., USA. All rights reserved.
This page was not revised from the 10.0 page.
Created 2019.8.20.

|  | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 10.1 Unrevised from 10.0 to 10.1. 10.0 version