On this page:
Find
Find
Find.interpolate
Find.abs
Find.animate
Find.in
Find.maybe_  in
Find.start_  in
Find.delay
Find.center
Find.left
Find.right
Find.top
Find.topline
Find.baseline
Find.bottom
Find.left_  top
Find.left_  topline
Find.left_  center
Find.left_  baseline
Find.left_  bottom
Find.center_  top
Find.center_  topline
Find.center_  center
Find.center_  baseline
Find.center_  bottom
Find.right_  top
Find.right_  topline
Find.right_  center
Find.right_  baseline
Find.right_  bottom
Find.top_  left
Find.top_  center
Find.top_  right
Find.topline_  left
Find.topline_  center
Find.center_  left
Find.center_  right
Find.baseline_  left
Find.baseline_  center
Find.baseline_  right
Find.bottom_  left
Find.bottom_  center
Find.bottom_  right
8.15.0.2

5 Pict Finders🔗ℹ

annotation

Find

Satisfied by a finder, which is applied to a pict to obtain two numbers representing an x-offset and y-offset, or to obtain one number representing a time offset in epochs.

function

fun Find(

  pict :: Pict,

  ~horiz: horiz :: HorizAlignment = #'center,

  ~vert: vert :: VertAlignment = #'center,

  ~dx: dx :: Real = 0,

  ~dy: dy :: Real = 0,

  ~dhoriz: dhoriz :: Real = 0,

  ~dvert: dvert :: Real = 0,

  ~dt: dt :: Int = 0

) :: Find

Creates a finder that locates a pict within another pict. The Find.in method takes the pict that contains pict and returns two numbers, the x-offset and y-offset, while the Find.start_in method returns one number of the start of the found pict’s time box relative to a the start of the enclosing pict’s time box as measured in epochs.

The horiz and vert arguments determine the position within pict that is found. For example, the combination #'right and #'bottom find the bottom-right corner of pict’s bounding box within another pict.

The dx and dy offsets are added to an x-offset and y-offset that would be returned otherwise. The dt offset is add to a time-box difference that would be returned otherwise.

The dhoriz and dvert arguments are multiplied by the height and width, respectively, of the pict as located within another pict (which can be different than pict’s immediate dimensions due to scaling). The multiplied values are then added to an x-offset and y-offset that would be returned otherwise, in addition to dx and dy.

function

fun Find.interpolate(from :: Find,

                     to :: Find,

                     ~bend: bender = bend.fast_middle)

  :: Find

Creates a finder that produces the same result as from at the start of epoch 0 and before, the same result as to at the end of epoch 0 and after, and that produces a combination of the two results for points in time within epoch 0. The combination is linear in the result of bender applied to the relative time within the epoch’s extent.

function

fun Find.abs(dx :: Real,

             dy :: Real,

             ~dt :: dt :: Int = 0) :: Find

Creates a finder that always returns dx and dy in space or dt in time without needing to locate any particular component pict.

function

fun Find.animate(xy_func :: Function.of_arity(3),

                 ~time_box: t_func :: Function.of_arity(1) = fun(p): 0)

  :: Find

Creates a finder that uses xy_func for Find.in and t_func for Find.start_in.

method

method (finder :: Find).in(pict :: Pict) :: values(Real, Real)

 

method

method (finder :: Find).in(pict :: Pict,

                           epoch :: Int, n :: RealIn(0, 1))

  :: values(Real, Real)

Applies finder to pict to get an x-offset and y-offset. An exception is thrown is a needed component pict cannot be found in pict. Calling Find.in with one argument is a shorthand for calling it with 0 for the last two arguments.

If pict is an animated picture, then the search corresponds to finding within Pict.snapshot(pict, epoch, n). When a finder for an animated pict is provided to a function like pin, however, pin will produce an animated pict where the finder is used separately for each snapshot generated from the combined animated pict.

method

method (finder :: Find).maybe_in(pict :: Pict)

  :: values(Real || False, Real || False)

 

method

method (finder :: Find).maybe_in(pict :: Pict,

                                 epoch :: Int, n :: RealIn(0, 1))

  :: values(Real || False, Real || False)

Like Find.in, but if a location cannot be found in pict, returns two #falses instead of throwing an exception.

method

method (finder :: Find).start_in(pict :: Pict) :: Int

Applies finder to pict to get a time-box offset. An exception is thrown is a needed component pict cannot be found in pict.

method

method (finder :: Find).delay(dt :: Int) :: Find

Returns a finder that is like finder, but where dt is subtracted from the epoch hat is supplied to Find.in or Find.maybe_in.

function

fun Find.center(pict :: Pict, ....) :: Find

 

function

fun Find.left(pict :: Pict, ....) :: Find

 

function

fun Find.right(pict :: Pict, ....) :: Find

 

function

fun Find.top(pict :: Pict, ....) :: Find

 

function

fun Find.topline(pict :: Pict, ....) :: Find

 

function

fun Find.baseline(pict :: Pict, ....) :: Find

 

function

fun Find.bottom(pict :: Pict, ....) :: Find

 

function

fun Find.left_top(pict :: Pict, ....) :: Find

 

function

fun Find.left_topline(pict :: Pict, ....) :: Find

 

function

fun Find.left_center(pict :: Pict, ....) :: Find

 

function

fun Find.left_baseline(pict :: Pict, ....) :: Find

 

function

fun Find.left_bottom(pict :: Pict, ....) :: Find

 

function

fun Find.center_top(pict :: Pict, ....) :: Find

 

function

fun Find.center_topline(pict :: Pict, ....) :: Find

 

function

fun Find.center_center(pict :: Pict, ....) :: Find

 

function

fun Find.center_baseline(pict :: Pict, ....) :: Find

 

function

fun Find.center_bottom(pict :: Pict, ....) :: Find

 

function

fun Find.right_top(pict :: Pict, ....) :: Find

 

function

fun Find.right_topline(pict :: Pict, ....) :: Find

 

function

fun Find.right_center(pict :: Pict, ....) :: Find

 

function

fun Find.right_baseline(pict :: Pict, ....) :: Find

 

function

fun Find.right_bottom(pict :: Pict, ....) :: Find

 

function

fun Find.top_left(pict :: Pict, ....) :: Find

 

function

fun Find.top_center(pict :: Pict, ....) :: Find

 

function

fun Find.top_right(pict :: Pict, ....) :: Find

 

function

fun Find.topline_left(pict :: Pict, ....) :: Find

 

function

fun Find.topline_center(pict :: Pict, ....) :: Find

 

function

fun Find.center_left(pict :: Pict, ....) :: Find

 

function

fun Find.center_right(pict :: Pict, ....) :: Find

 

function

fun Find.baseline_left(pict :: Pict, ....) :: Find

 

function

fun Find.baseline_center(pict :: Pict, ....) :: Find

 

function

fun Find.baseline_right(pict :: Pict, ....) :: Find

 

function

fun Find.bottom(pict :: Pict, ....) :: Find

 

function

fun Find.bottom_left(pict :: Pict, ....) :: Find

 

function

fun Find.bottom_center(pict :: Pict, ....) :: Find

 

function

fun Find.bottom_right(pict :: Pict, ....) :: Find

Shorthands for Find at all combinations of ~horiz and ~vert arguments in all orders. Each shorthand takes the same arguments as Find, except for the ~horiz and ~vert arguments.