Compose.circle
— Function.circle(xs, ys, rs)
Arguments can be passed in arrays in order to perform multiple drawing operations.
Compose.circle
— Function.circle(x, y, r)
Define a circle with its center at (x
,y
) and a radius of r
.
Compose.circle
— Method.circle()
Define a circle in the center of the current context with a diameter equal to the width of the context.
Compose.polygon
— Function.polygon(points)
Define a polygon. points
is an array of (x,y)
tuples that specify the corners of the polygon.
Compose.rectangle
— Function.rectangle(x0, y0, width, height)
Define a rectangle of size width
xheight
with its top left corner at the point (x
, y
).
Compose.rectangle
— Function.rectangle(x0s, y0s, widths, heights)
Arguments can be passed in arrays in order to perform multiple drawing operations at once.
Compose.rectangle
— Method.rectangle()
Define a rectangle that fills the current context completely.
Compose.text
— Function.text(x, y, value [,halign::HAlignment [,valign::VAlignment [,rot::Rotation]]])
Draw the text value
at the position (x
,y
) relative to the current context.
The default alignment of the text is hleft
vbottom
. The vertical and horizontal alignment is specified by passing hleft
, hcenter
or hright
and vtop
, vcenter
or vbottom
as values for halgin
and valgin
respectively.
Compose.text
— Function.text(xs, ys, values [,haligns::HAlignment [,valigns::VAlignment [,rots::Rotation]]])
Arguments can be passed in arrays in order to perform multiple drawing operations at once.
Compose.FormBatch
— Type.A form batch is a vectorized form with n primitives transformed into a simpler representation: one primitive repositioned n times.
On certain backends this leads to more efficient drawing. For example, SVG can be shortened by using <def> and <use> tags, and raster graphics can render the form primitive to a back buffer and blit it into place for faster drawing.
Batching is an optimization transform that happens at draw time. There's currently no mechanism to manually batch. E.g. contexts cannot have FormBatch children.
Compose.batch
— Method.Attempt to batch a form. Return a Nullable{FormBatch} which is null if the Form could not be batched, and non-null if the original form can be replaced with teh resulting FormBatch.
Compose.canbatch
— Method.Some backends can more efficiently draw forms by batching. If so, they shuld define a similar method that returns true.
Compose.count_unique_primitives
— Method.Count the number of unique primitives in a property, stopping when max_count is exceeded.
Compose.excise_vector_children!
— Method.Remove and return vector forms and vector properties from the Context.
Compose.filter_redundant_offsets!
— Method.Produce a new array of offsets in which near duplicate values have been removed.
Compose.optimize_batching
— Method.Attempt to transform a tree into an equivalent tree that can more easily be batched.
What this does is look for patterns in which a long vector form is accompanied by a large vector property that has a relatively small number of unique values. If there are n unique values, we can split it into n contexts, each with a shorter vector form and only scalar properties.