KiteMaskTransfer

The transfer function of a soft mask as a table of 256 levels (ISO 32000-1, 11.6.5.2, Table 144, /TR). The table maps each value of the mask group, its alpha or its luminosity, to the mask value that gates the content. Both run from 0 to 255.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

True when the line of slope and offset stays within one level of the table at every level, so a backend that can only scale and offset gives the right mask.

Link copied to clipboard

The mask value of that line for group value 0, from 0 to 1.

Link copied to clipboard

The slope of the straight line closest to the table, with both axes from 0 to 1. A backend that can only scale and offset a colour, such as a colour matrix, uses slope and offset. The line is exact for a linear function such as an inverter.

Functions

Link copied to clipboard
operator fun get(level: Int): Int

The mask value for the group value level. A level outside 0 to 255 is clamped.

Link copied to clipboard

The table as 256 bytes, for a backend that takes a lookup table.

Link copied to clipboard
fun toMaskAlpha(argb: IntArray, luminosity: Boolean)

Turns the pixels of a drawn mask group into mask values, in place, for a backend that gates by pixels because it has no table colour filter. Each pixel of argb, straight ARGB, becomes black with the alpha of its mask value: its luminosity 0.30 R + 0.59 G