edith
Clone
https://git.tahinli.com/Tahinli/edith.git
0 watching0 forksRust18.3 MiBf2bee6bTahinli2 months ago781 commits
| 1 | //! The timeline's re-timing map: one piecewise-affine answer to "this frame |
| 2 | //! is now where?", built by every operation that moves time. |
| 3 | //! |
| 4 | //! THE ARCHITECTURE LAW: a re-timing op NEVER touches lanes directly. It |
| 5 | //! (1) resolves its [`Members`](crate::project) once via `group_of`, (2) |
| 6 | //! builds a `TimelineMap` from each member's OWN geometry -- one piece per |
| 7 | //! clip or caption, that member's own old span onto its own new one -- (3) |
| 8 | //! applies that member's map to only its own lane, media clips AND |
| 9 | //! captions uniformly, and (4) the caller maps the playhead through the |
| 10 | //! SAME per-member map. The app never re-derives group or time semantics; |
| 11 | //! the engine's gates stay the single questions. |
| 12 | //! |
| 13 | //! The map itself is a sorted list of knots `(old frame, new frame)` with |
| 14 | //! affine interpolation between neighbours and identity outside the ends: a |
| 15 | //! compression is two knots with a shallower slope between them, a removal |
| 16 | //! is a knot pair that collapses a span onto a point, an insertion the same |
| 17 | //! run backwards, and a piece whose new span starts earlier than its old |
| 18 | //! one (a slow-down pulling a member's head earlier than its own old frame) |
| 19 | //! carries an extra knot that folds the run between the two los into that |
| 20 | //! same kind of collapse, so the piece never doubles back on the identity |
| 21 | //! run before it. Old frames strictly increase knot to knot; new frames |
| 22 | //! only need to not decrease -- a collapse ties two of them together on |
| 23 | //! purpose -- which is what keeps [`TimelineMap::invert`]'s walk a single |
| 24 | //! pass, never a step backward. |
| 25 | |
| 26 | /// A piecewise-affine old→new frame map, identity outside its knots. Built |
| 27 | /// once per edit and read many times; `Clone` for the tests that pin its |
| 28 | /// laws, `Debug` for the messages those tests print when they fail. |
| 29 | |
| 30 | pub |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 | |
| 117 | |
| 118 | |
| 119 | |
| 120 | |
| 121 | |
| 122 | |
| 123 | |
| 124 | |
| 125 | |
| 126 | |
| 127 | |
| 128 | |
| 129 | |
| 130 | |
| 131 | |
| 132 | |
| 133 | |
| 134 | |
| 135 | |
| 136 | |
| 137 | |
| 138 | |
| 139 | |
| 140 | |
| 141 | |
| 142 | |
| 143 | |
| 144 | |
| 145 | |
| 146 | |
| 147 | |
| 148 | |
| 149 | |
| 150 | |
| 151 | |
| 152 | |
| 153 | |
| 154 | /// The one interpolation this module is: `frame`'s place between two knots, |
| 155 | /// carried across to the other axis. Independent of the axes' order, which |
| 156 | /// is what [`TimelineMap::invert`] reuses it for. |
| 157 | |
| 158 | |
| 159 | |
| 160 | |
| 161 | |
| 162 | |
| 163 | |
| 164 | |
| 165 | |
| 166 | |
| 167 | |
| 168 | |
| 169 | |
| 170 | |
| 171 | |
| 172 | |
| 173 | |
| 174 | |
| 175 | |
| 176 | |
| 177 | |
| 178 | |
| 179 | |
| 180 | |
| 181 | |
| 182 | |
| 183 | |
| 184 | |
| 185 | |
| 186 | |
| 187 | |
| 188 | |
| 189 | |
| 190 | |
| 191 | |
| 192 | |
| 193 | |
| 194 | |
| 195 | |
| 196 | |
| 197 | |
| 198 | |
| 199 | |
| 200 | |
| 201 | |
| 202 | |
| 203 | |
| 204 | |
| 205 | |
| 206 | |
| 207 | |
| 208 | |
| 209 | |
| 210 | |
| 211 | |
| 212 | |
| 213 | |
| 214 | |
| 215 | |
| 216 | |
| 217 | |
| 218 | |
| 219 | |
| 220 | |
| 221 | |
| 222 | |
| 223 | |
| 224 | |
| 225 | |
| 226 | |
| 227 | |
| 228 | |
| 229 | |
| 230 | |
| 231 | |
| 232 | |
| 233 | |
| 234 | |
| 235 | |
| 236 | |
| 237 | |
| 238 | |
| 239 | |
| 240 | |
| 241 | |
| 242 | |
| 243 | |
| 244 | |
| 245 | |
| 246 | |
| 247 | |
| 248 | |
| 249 | |
| 250 | |
| 251 | |
| 252 | |
| 253 | |
| 254 | |
| 255 | |
| 256 | |
| 257 | |
| 258 | |
| 259 | |
| 260 | |
| 261 | |
| 262 | |
| 263 | |
| 264 | |
| 265 | |
| 266 | |
| 267 | |
| 268 | |
| 269 | |
| 270 | |
| 271 | |
| 272 | |
| 273 | |
| 274 | |
| 275 | |
| 276 | |
| 277 | |
| 278 | |
| 279 | |
| 280 | |
| 281 | |
| 282 | |
| 283 | |
| 284 |