Documentation
¶
Overview ¶
Package flatten draws as pictures what a vector format without transparency cannot draw (PostScript, vector/psbdf): the rectangles of a page where something is drawn with alpha, a blend mode, a group or a soft mask, a shadow or a filter are collected, merged until none overlap, and drawn by the image renderer with all that the page draws there. The rest of the page stays vectors, under a clip that leaves the rectangles out.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Regions ¶
type Regions struct {
// contains filtered or unexported fields
}
Regions collects the rectangles of a page that are drawn as pictures.
func (*Regions) Add ¶
Add adds a box (x0, y0, x1, y1) in the units of the page; boxes that are empty or not numbers are left out.
func (*Regions) Merge ¶
Merge returns the rectangles of a page of w × h: the boxes grown to whole units and by margin (for the edges a renderer smooths), cut to the page, and merged with those they overlap or come within margin of, until none do. Too many of them, or too much of the page, is the whole page.