as.mask {grid} R Documentation

## Define a Soft Mask

### Description

Define either an alpha mask or a luminance mask, based on a grob.

### Usage

as.mask(x, type=c("alpha", "luminance"))


### Arguments

 x A grob. type The type of mask.

### Details

A mask may be specified for a viewport either directly as a grob or using this function. In the former case, the result is an alpha mask. This function allows the user to define a luminance mask instead.

Not all graphics devices support masks and those that do may only support one type of mask: for example xfig and pictex do not support masks and Cairo-based devices only support alpha masks.

### Value

A "GridMask" object.

### Author(s)

Paul Murrell

viewport

### Examples

## NOTE: on devices without support for masks normal line segments
##       will be drawn
grid.newpage()