MCPcopy Create free account
hub / github.com/Lightricks/ComfyUI-LTXVideo / _catmull_rom

Function _catmull_rom

sparse_tracks.py:13–31  ·  view source on GitHub ↗
(p0: dict, p1: dict, p2: dict, p3: dict, t: float)

Source from the content-addressed store, hash-verified

11
12
13def _catmull_rom(p0: dict, p1: dict, p2: dict, p3: dict, t: float) -> dict[str, float]:
14 t2 = t * t
15 t3 = t2 * t
16 return {
17 "x": 0.5
18 * (
19 2 * p1["x"]
20 + (-p0["x"] + p2["x"]) * t
21 + (2 * p0["x"] - 5 * p1["x"] + 4 * p2["x"] - p3["x"]) * t2
22 + (-p0["x"] + 3 * p1["x"] - 3 * p2["x"] + p3["x"]) * t3
23 ),
24 "y": 0.5
25 * (
26 2 * p1["y"]
27 + (-p0["y"] + p2["y"]) * t
28 + (2 * p0["y"] - 5 * p1["y"] + 4 * p2["y"] - p3["y"]) * t2
29 + (-p0["y"] + 3 * p1["y"] - 3 * p2["y"] + p3["y"]) * t3
30 ),
31 }
32
33
34def _interpolate_spline(

Callers 1

_interpolate_splineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected