MaskGroup

smile.pictures.MaskGroup
See theMaskGroup companion class
object MaskGroup

Builds masks.

import smile.colors.LinearGradient
import smile.colors.PresetColor.*
import smile.modeling.*

val gradient = LinearGradient(Pos(0, 0), Pos(160, 0), Red, Blue)
val stripe   = Rectangle(160, 80, fillWith(gradient), None)
val circle   = Circle(Pos.Origin, 40, fillWith(Black), None)
val masked   = MaskGroup(circle, stripe)
val pierced  = MaskGroup(circle, stripe, inverted = true)

A circle cut out of a red-to-blue gradient The gradient with a
circular hole in it

Attributes

Companion
class
Source
Element.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
MaskGroup.type

Members list

Value members

Concrete methods

def apply(mask: Element, masked: Element, inverted: Boolean = ...): Element

masked seen through mask, or with mask cut out of it as a hole when inverted.

masked seen through mask, or with mask cut out of it as a hole when inverted.

Nothing to see gives the empty picture. That is the case with empty content, an empty mask that is not inverted, or one that misses the content, so that the group's bounds would have no area. An inverted empty mask cuts nothing out and gives the content itself.

Masking a translated mask group appends a mask to the same group. Repeated masking keeps the group one level deep and applies its masks in order. Rotating the group as a whole can give different bounds from rotating nested groups because the bounding boxes differ. With inverted masks only, the difference is at most 2^-20 pixel.

Attributes

Source
Element.scala