On this page:
Pict
Static  Pict
nothing
Nothing  Pict
Pict.width
Pict.height
Pict.descent
Pict.ascent
Pict.duration
Pict.epoch_  extent
Pict.children
Pict.snapshot
Pict.launder
Pict.ghost
Pict.refocus
Pict.pad
Pict.translate
Pict.lift
Pict.drop
Pict.time_  pad
Pict.sustain
Pict.nonsustaining
Pict.scale
Pict.rotate
Pict.shear
Pict.alpha
Pict.hflip
Pict.vflip
Pict.clip
Pict.freeze
Pict.time_  clip
Pict.colorize
Pict.line_  width
Pict.epoch_  set_  extent
Pict.metadata
Pict.set_  metadata
Pict.epoch_  metadata
Pict.epoch_  set_  metadata
Time  Order
Time  Order.before
Time  Order.after
8.12

2 Pict Objects🔗ℹ

annotation

Pict

 

annotation

StaticPict

An annotation representing a pict value or a pict value that is specifically a static pict.

value

def nothing :: NothingPict

 

annotation

NothingPict

The nothing pict is a special static pict that acts as if it is not supplied at all. The NothingPict annotation is satisfied by only nothing.

property

property (pict :: Pict).width :: Real

 

property

property (pict :: Pict).height :: Real

 

property

property (pict :: Pict).descent :: Real

 

property

property (pict :: Pict).ascent :: Real

Properties for a pict’s geometry.

property

property (pict :: Pict).duration :: Int

 

method

method (pict :: Pict).epoch_extent(i :: Int) :: Real

Properties for a pict’s animation.

property

property (pict :: Pict).children :: List.of(Pict)

A list of component picts that were combined to construct pict. Those picts can be located within pict using a finder.

method

method (pict :: Pict).snapshot() :: StaticPict

 

method

method (pict :: Pict).snapshot(epoch :: Int, n :: Real.in(0, 1))

  :: StaticPict

Converts an animated pict to a static pict. The 0-argument variant is a shorthand for providing 0 and 0.

method

method (pict :: Pict).launder() :: Pict

Returns a pict that is the same as pict, but with a fresh identity and hiding the identity of any component inside pict from a finder or the result of the Pict.children property.

method

method (pict :: Pict).ghost(do_ghost = #true) :: Pict

Returns a pict that is the same as pict, including the same bounding box and time box, but whose drawing is empty if do_ghost is true. If do_ghost is #false, then pict itself is returned.

The do_ghost argument is intended to help avoid if wrappers, enabling pict.ghost(rhombus(test, ~var)) instead of if rhombus(test, ~var) | pict.ghost() | pict, where the former works even without having to bind an intermediate variable if pict is replaced with a more complex expression.

method

method (pict :: Pict).refocus(subpict :: Pict) :: Pict

Returns a pict that is the same as pict, but with a shifted bounding box to match subpict within pict.

method

method (pict :: Pict).pad(

  around :: Real = 0,

  ~horiz: horiz :: Real = around,

  ~vert: vert :: Real = around,

  ~left: left :: Real = horiz,

  ~top: top :: Real = vert,

  ~right: right :: Real = horiz,

  ~bottom: bottom :: Real = vert

) :: Pict

 

method

method (pict :: Pict).translate(dx :: Real, dy :: Real) :: Pict

 

method

method (pict :: Pict).lift(amt :: Real) :: Pict

 

method

method (pict :: Pict).drop(amt :: Real) :: Pict

Returns a pict that is the same as pict, but with its bounding box adjusted.

method

method (pict :: Pict).time_pad(

  ~all: all :: Int = 0,

  ~before: before :: Int = all,

  ~after: after :: Int = all

) :: Pict

Returns a pict that is the same as pict, but with its time box adjusted.

method

method (pict :: Pict).sustain(n :: Int = 1) :: Pict

Similar to Pict.time_pad with ~after, but sustains instead of merely padding.

method

method (pict :: Pict).nonsustaining() :: Pict

Returns a pict that is the same as pict, but where a sustain operation is treated the same as padding via Pict.time_pad.

method

method (pict :: Pict).scale(n :: Real) :: Pict

 

method

method (pict :: Pict).scale(horiz :: Real, vert :: Real) :: Pict

Returns a pict that is like pict, but its drawing and bounding box is scaled.

method

method (pict :: Pict).rotate(radians :: Real) :: Pict

Returns a pict that is like pict, but its drawing is rotated, and its bounding box is extended as needed to enclose the rotated bounding box.

method

method (pict :: Pict).shear(x_factor :: Real,

                            y_factor :: Real) :: Pict

Returns a pict that is like pict, but its drawing is sheared. The bounding box is inflated to contain the result. The result pict’s ascent and descent are the same as pict’s.

method

method (pict :: Pict).alpha(n :: Real.in(0, 1)) :: Pict

Returns a pict that is like pict, but whose drawing is changed by reducing the global alpha adjustment.

method

method (pict :: Pict).hflip() :: Pict

 

method

method (pict :: Pict).vflip() :: Pict

Flips a pict horizontally or vertically.

method

method (pict :: Pict).clip() :: Pict

Returns a pict that is like pict, but whose drawing is confined to its bounding box.

method

method (pict :: Pict).freeze(~scale: scale :: Real = 2.0) :: Pict

Returns a pict that is like pict, but whose drawing is rendered at the time of the Pict.freeze call to a bitmap, and then the new pict draws by drawing the bitmap. The scale argument determines the scale factor of the bitmap (i.e., the number of pixels per drawing unit).

method

method (pict :: Pict).time_clip(

  ~keep: keep :: maybe(TimeOrder) = #false,

  ~nonsustaining: nonsustaining = keep != #'after

) :: Pict

Returns a pict that is like pict, but whose drawing is confined to its time box in the sense that it is represented by nothing outside of its time box. If keep is #'before or #'after, then the pict is not clipped in that time direction. The resulting pict is nonsustaining (in the sense of Pict.nonsustaining) if nonsustaining is true.

method

method (pict :: Pict).colorize(c :: Color || String) :: Pict

 

method

method (pict :: Pict).line_width(w :: NonnegReal) :: Pict

Returns a pict that is like pict, but wherever it uses #'inherit for a color or line width, the given color or line width is used, and the resulting pict no longer uses #'inherit or colors or line widths.

method

method (pict :: Pict).epoch_set_extent(i :: Int,

                                       extent :: NonnegReal) :: Pict

Returns a pict that is like pict, but with the extent of one of its epochs adjusted.

method

method (pict :: Pict).metadata() :: Map

 

method

method (pict :: Pict).set_metadata(metadata :: Map) :: Pict

Gets metadata registered for an immediate pict, or returns a pict that is like pict but with the given metadata.

Unlike epoch-specific metadata added with Pict.epoch_set_metadata, metadata added by Pict.metadata is not propagated to new picts that are derived from the returned pict. The Pict.children property of a pict can be used to search the metadata of its component picts.

method

method (pict :: Pict).epoch_metadata(i :: Int) :: Map

 

method

method (pict :: Pict).epoch_set_metadata(i :: Int,

                                         metadata :: Map) :: Pict

Gets metadata registered for an epoch within a pict, or returns a pict that is like pict but with the given metadata for the given epoch.

When picts are combined through operations like beside or overlay, the combination’s metadata is formed by merging metadata maps from the combined picts, and later picts in the combination take precedence.

enumeration

enum TimeOrder:

  before

  after

Options for time directions.