From d43538b1300a090f3fa4eaf7bb3969ca68f454ed Mon Sep 17 00:00:00 2001 From: Steve Block Date: Wed, 11 Dec 2013 11:04:27 +1100 Subject: [PATCH 1/3] Add a note about relaxing the requirement that timing function position lists start at 0 and end at 1 --- index.html | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/index.html b/index.html index d878ad6..1da59cb 100644 --- a/index.html +++ b/index.html @@ -2913,6 +2913,22 @@

Normalizing a timing function position list

to allow timing function offsets outside that range too for consistency.

+
+

+ We could consider relaxing the constraint that the + first and last values are zero and 1, and simply + require that all values are in the range [0, 1]. We + would then prepend and append linear timing + functions as required. +

+

+ This makes more sense if or when we allow timing + functions to cover input times outside the range [0, + 1]. Assuming that this applied to timing function + chains, the first and last values in the position + list would no longer be restricted to 0 and 1. +

+
  • The normalized timing function position list is simply input positions. From 102887c71b18e9339522c2e8707b74a367ee116c Mon Sep 17 00:00:00 2001 From: Steve Block Date: Tue, 10 Dec 2013 17:15:14 +1100 Subject: [PATCH 2/3] Allow output time to be specified in the timing function position list --- ...independent-input-and-output-positions.png | Bin 0 -> 3616 bytes index.html | 167 +++++++++++------- 2 files changed, 101 insertions(+), 66 deletions(-) create mode 100644 img/timing-function-chain-with-independent-input-and-output-positions.png diff --git a/img/timing-function-chain-with-independent-input-and-output-positions.png b/img/timing-function-chain-with-independent-input-and-output-positions.png new file mode 100644 index 0000000000000000000000000000000000000000..d00c9457a681103ab61a4ef1aa085d77225a13c4 GIT binary patch literal 3616 zcmZ`+c|26>8$V}EOkB*QB*ZZal`O4eKen=#(#;lG!c`PeCI&OI45Cq2X+v(y?M9Pi zsjOv8BB?;pSUe4fwDdEe)Kp6~O0mh(=6-JadzqOzh81c_T( znC*ukn1u;J7_89CcQk@8IC%eV6X-#c{3v)>9%$hd3_)U2n8480>oQav>vwx2<#W;Y^A_DS|Dq0Z?C<5`>Ls_ zseSBDy}k`szf_%Hj0!9L!<59GgvNDTFI@cnU=ioRW2sxKh`yUv2I17kBERTtM)Ja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xcS!;7Iuo`^Nz-?XV_ z(pKEvo0&2&FyL5p-1Qep$=cD@yF(xch1DC*-Rk7asydt~`{wg5$_Fq4_-fEBr=n`R zQ0zMXxhp?tqOX)X`_-f8S*T`HhJl=rkWe8dHg!7eu-DOv599Y^V`G`jwq}xX|JZ## z3>|rTpaacP*L9jWc4~gH?VdeG+eGThe timing function position list repeated meaning that the above example can be achieved by simply specifying “step-end” once.

    +

    + It is also possible to control the extent of each link in output + time independently of its length in input time. In particular, + while the start input time must be less than the end input time, + this constraint does not apply to the start and end output + times. This provides greater control and allows complex timing + function chains to be constructed from the primitive timing + functions definded in this spec. +

    +

    + For example, in the following example, the ease-in-out timing + function occupies three-quarters of the input time range and + extends to an output time of 1.5. The ease-in timing function + which follows it therefore occupies the remaining quarter of the + input time and runs from 1.5 to 1.0 in output time. +

    + + A timing function chain with independent input and output positions specified +
    +

    + The length of each link in input time can be controlled + independently of its extent in output time. +

    The mapping of the input range of a timing function chain's @@ -2802,13 +2827,18 @@

    The timing function position list

    The timing function position list is:

      -
    • a sequence of floating-point values +
    • a sequence of pairs of floating-point numbers
    • of length equal to the number of functions in the timing function chain plus 1
    • whose values are in the range [0, 1], -
    • whose first and last values are 0 and 1 respectively, and -
    • whose values are sorted in ascending order. +
    • whose first and last values are (0, 0) and (1, 1) respectively, and +
    • whose values are ordered such that the first numbers in each + pair form an acending sequence
    +

    + Each pair in the list specifies the input and output time of the + transition point between two adjacent links in a timing + function chain.

    Normalizing a timing function position list

    @@ -2824,7 +2854,9 @@

    Normalizing a timing function position list

    • a spacing mode of “distribute” or “align”; or -
    • a list of positions, input positions. +
    • a list of items, input positions, where each + item is either a single floating-point value or a pair of + floating-point values.

    @@ -2841,10 +2873,11 @@

    Normalizing a timing function position list

  • Let length be the number of items in chain plus 1.
  • The normalized timing function position list is a list - of floating point numbers of length length such + of pairs of floating point numbers of length length such that the value of the element at index n, with - indices beginning at zero, is equal to n - × 1 ÷ (length - 1). + indices beginning at zero, is equal to (n + × 1 ÷ (length - 1), n + × 1 ÷ (length - 1)).

    The procedure when spacing mode is “align” depends on the timed item to which @@ -2856,11 +2889,13 @@

    Normalizing a timing function position list

    animation effect,

    - The normalized timing function position list is a list - of numbers corresponding to the keyframe offsets - of the keyframe animation effect's list of - keyframes. + The normalized timing function position list is a + list of pairs, with length equal to the number of + keyframes in the keyframe animation effect. + Within each pair, the two values are equal to each other and + equal to the + keyframe offsets + of the corresponding keyframe.

    Note that this refers to the keyframe offset values @@ -2876,10 +2911,11 @@

    Normalizing a timing function position list

    The normalized timing function position list is a list - of numbers where each value is the result of traversing the - path elements in the path animation effect in - order and calculating the ratio of the path length at the end - of the path element and the total path length. + of pairs, with length equal to the number of + path elements in the path animation effect. + Within each pair, the two values are equal to each other and + equal to the ratio of the path length at the end of the + corresponding path element and the total path length.

    Path elements that correspond to moveto elements @@ -2898,35 +2934,38 @@

    Normalizing a timing function position list

    provided is as follows:

      -
    1. If any of the following conditions are true, use +
    2. If any of the following conditions are false, use distribute spacing and terminate these steps:
        -
      • input positions is empty. -
      • input positions is not sorted in ascending - order. +
      • input positions is not empty. +
      • input positions is sorted such that the + sequence formed by taking the value of each single-value + entry and the first value of each pair entry, is in + ascending order.
      • The first and last values of input positions - are not 0 and 1 respectively. + are (0, 0) and (1, 1) respectively.

        - An implication of the above two conditions is that no - values outside the range [0, 1] are allowed. - If we allow keyframe offsets outside [0, 1] we will need - to allow timing function offsets outside that range too - for consistency. + An implication of the above two conditions is that all + input times must be in the range [0, 1]. If we allow + keyframe offsets outside [0, 1] we will need to allow + timing function offsets outside that range too for + consistency.

        We could consider relaxing the constraint that the - first and last values are zero and 1, and simply - require that all values are in the range [0, 1]. We - would then prepend and append linear timing - functions as required. + first and last values are (0, 0) and (1, 1), and + simply require that all input values are in the + range [0, 1]. We would then prepend and append + linear timing functions as required.

        This makes more sense if or when we allow timing functions to cover input times outside the range [0, 1]. Assuming that this applied to timing function chains, the first and last values in the position - list would no longer be restricted to 0 and 1. + list would no longer be restricted to input times of + 0 and 1.

      @@ -2934,9 +2973,10 @@

      Normalizing a timing function position list

      input positions.

    - Note that even applying the above procedures, the normalized - timing function position list may not be suitable since it - may not be of the required length (as defined in timing function position list may not be + suitable since it may not be of the required length (as defined + in ). Any difference in lengths is accommodated for by adjusting the @@ -3021,21 +3061,23 @@

    Evaluating a timing function chain

    1. - Let start index be the index of the last value in the - timing function position list that is less than or equal to - x when iterating from the start of timing function - position list to the end. + Let start index be the index of the last entry in the + timing function position list where the first value in + the pair is less than or equal to x when iterating + from the start of timing function position list to the + end.
    2. - If the value at start index in timing function - position list is equal to one, decrement start - index by one. + If the first value in the pair at start index in + timing function position list is equal to one, decrement + start index by one.
    3. - Let xstart be the value in the timing - function position list at start index. + Let xstart be the first value in the pair + in timing function position list at start + index.
    4. - Let xend be the value in the timing - function position list at start index - + 1. + Let xend be the first value in the pair in + timing function position list at start + index + 1.
    5. Let f be the timing function in the timing function chain at start index. @@ -3048,11 +3090,19 @@

      Evaluating a timing function chain

      Calculate the local output time fraction ylocal = f(xlocal) +
    6. + Let ystart be the second value in the pair + in timing function position list at start + index. +
    7. + Let yend be the second value in the pair in + timing function position list at start + index + 1.
    8. The result of evaluating the timing function chain is then - xstart + ylocal - × (xend - - xstart). + ystart + ylocal + × (yend + - ystart).
  • @@ -7121,31 +7171,16 @@

    The PlaybackDirection enumeration

    The EasingTimesInput typedef

    + title="typedef (SpacingMode or sequence<double> or sequence<DOMPoint>) EasingTimesInput">

    For simplicity, throughout this specification EasingTimesInput is used to represent either a list of - values corresponding to a timing function position list or + values or points corresponding to a timing function position list or a SpacingMode from which a timing function position list may be synthesized according to the procedure in .

    -
    -

    - If we later extend easing times to allow controlling the output - ranges (i.e. a y value as well), we could achieve - that by making the type (SpacingMode or - sequence<double> or sequence<DOMPoint>) or - something of that sort. -

    -

    - That would be backwards-compatible but would make it hard to - write code that falls back gracefully. - An alternative would be to simply add - getEasingPoints etc. -

    -
    From eff915cf316fa469d1b351738e733887609e304d Mon Sep 17 00:00:00 2001 From: Steve Block Date: Tue, 10 Dec 2013 17:20:28 +1100 Subject: [PATCH 3/3] Add concept of smoothed timing function chains --- index.html | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index f490412..9222411 100644 --- a/index.html +++ b/index.html @@ -2421,6 +2421,11 @@

    Timing in discrete steps

    the time after applying the increase (i.e. the top of the step).

    +

    + Note that to avoid ambiguity when using smoothed with a + step timing function, we define the gradient of a step + timing function to be zero at input values of zero and 1. +

    A step timing function may be specified as a string using the following syntax: @@ -3106,6 +3111,43 @@

    Evaluating a timing function chain

    +
    +

    Smoothing of timing functions

    +

    + Individual cubic Bézier timing functions within a timing + function chain may be marked as smoothed. + This means that an attempt is made to modify the cubic Bézier curve + to ensure that it is C1-continuous with the previous timing + function in the timing function chain. +

    +

    + Cubic Bézier curves are defined by anchor points and control points. + The first anchor point and control point define a vector which is + tangential to the Bézier at the first anchor point. +

    +

    + When a cubic Bézier curve is smoothed, the first control + point is adjusted such that the vector defined by the first anchor + point and this control point remains unchanged in length, but + changes in direction to match the positive tangent of the curve + defined by the previous timing function in the timing + function chain at local time fraction 1. +

    +

    + If the cubic Bézier curve in question is the first timing + function in a timing function chain, then the first + control point is adjusted such that the vector defined by the first + anchor point and this control point has a gradient of zero. +

    +

    + The above procedure for smoothing is only effective if the first + control point of the cubic Bézier curve is not (0, 0). +

    +

    + If smoothed is applied to any other type of timing + function, it is ignored. +

    +

    Calculating the transformed time

    @@ -4600,7 +4642,7 @@

    Calculating the translation value of a path animation effect

    The length of a path element is determined, where possible, via - closed-form solutions. For some path elements (e.g. beziers) a + closed-form solutions. For some path elements (e.g. Béziers) a closed-form solution is not generally possible, and approximations should be used.