endSoftMasked method
void
endSoftMasked({
- required bool luminosity,
- required PdfRect backdrop,
- required void drawMask(),
- double backdropLuminance = 0,
- double transferScale = 1,
- double transferOffset = 0,
override
Ends the capture opened by beginSoftMasked. drawMask paints the
mask group's content through this same device; for luminosity masks
the device converts the result's luminance to alpha over the
backdrop box, then composites it into the captured content (dstIn).
Areas the mask group doesn't paint take backdropLuminance (the
luminance of the /BC backdrop colour, default black). The mask value
is remapped through the /TR transfer function, linearised here as
value * transferScale + transferOffset (identity by default).
Devices that collect content from drawMask (e.g. image collectors)
should invoke it even if they do no compositing.
Implementation
@override
void endSoftMasked({
required bool luminosity,
required PdfRect backdrop,
required void Function() drawMask,
double backdropLuminance = 0,
double transferScale = 1,
double transferOffset = 0,
}) {
flushPending(); // masked content strips land inside the content layer
if (_groupKnockout.isNotEmpty) _groupKnockout.removeLast();
delegateBeginSoftMaskComposite(
luminosity: luminosity,
backdrop: backdrop,
backdropLuminance: backdropLuminance,
transferScale: transferScale,
transferOffset: transferOffset);
// The mask group's draws happen NOW and route through this device, so
// they bin/flush between the composite halves on every subclass.
drawMask();
flushPending();
delegateFinishSoftMaskComposite();
}