PeachDrawing

PeachDrawing.RasterCanvas

RasterCanvas.DrawImageAlphaMasked(Image, Image, Rect, bool) Method

Draws image (a tile from CreateTile(double, double)) at destRect with maskImage (another same-adapter tile) attached as an /Alpha-subtype soft mask (ISO 32000-1 §11.6.4.3) - unlike DrawImageMasked(Image, Image, Rect)’s /Luminosity mask, which derives mask values from the mask tile’s rendered COLOR converted to grayscale, this derives them directly from the mask tile’s own computed ALPHA, disregarding whatever color it painted with. The motivating future use case is SVG’s SourceAlpha filter input and feComposite, both of which are defined in terms of a source’s alpha channel specifically, not a luminosity conversion of it. When invert is true, the mask’s /TR is set to 1 - x (a PDF Type 4 function), for a complemented alpha mask without needing a second tile painted with inverted alpha. A no-op if either image wasn’t created via CreateTile(double, double) on this same Canvas.

public override void DrawImageAlphaMasked(PeachDrawing.Core.Image image, PeachDrawing.Core.Image maskImage, PeachDrawing.Core.Rect destRect, bool invert=false);

Parameters

image Image

maskImage Image

destRect Rect

invert System.Boolean