# The sweep strips: the ramp is DECODED on the disc, and the GPU agrees.
# 2026-08-31. sylpheed-port asked for "vertex alpha as a function of sweep
# position". It is not a runtime curve to be sampled -- it is four keyframes.
#
# cargo run -p sylpheed-formats --example sweep_leaf_ramp -- GP_TITLE 5
# tools/re-capture/sweep_positions.py <draw logs>

=== GP_TITLE entry 5 — ptloop01.rat (leaf 284 bytes) ===
    declared loop length: 600 units
  pteff03.t32 — 4 keyframes
    kf0  t=0     x=-639   y=270    sx=100  sy=600  rot=30    fade=FFFFFFFF (alpha 255)
    kf1  t=150   x=-39    y=270    sx=100  sy=600  rot=30    fade=80FFFFFF (alpha 128)
    kf2  t=540   x=1521   y=270    sx=100  sy=600  rot=30    fade=FFFFFFFF (alpha 255)
    kf3  t=600   x=1521   y=270    sx=100  sy=600  rot=30    fade=FFFFFFFF (alpha 255)

=== GP_TITLE entry 5 — ptloop02.rat (leaf 283 bytes) ===
    declared loop length: 720 units
  pteff03a.t32 — 4 keyframes
    kf0  t=0     x=1721   y=270    sx=100  sy=800  rot=-45   fade=00FFFFFF (alpha   0)
    kf1  t=150   x=1111   y=270    sx=100  sy=800  rot=-45   fade=80FFFFFF (alpha 128)
    kf2  t=630   x=-839   y=270    sx=100  sy=800  rot=-45   fade=FFFFFFFF (alpha 255)
    kf3  t=720   x=-839   y=270    sx=100  sy=800  rot=-45   fade=FFFFFFFF (alpha 255)

DECLARED SLOPES, from the second segment of each ramp:
  pteff03    x  -39 -> 1521 over t 150..540, alpha 128 -> 255   d(alpha)/dx = +0.0814
  pteff03a   x 1111 -> -839 over t 150..630, alpha 128 -> 255   d(alpha)/dx = -0.0651

MEASURED OFF THE GPU, three independent sessions:

alpha vs position, per tall strip (design px, alpha level):
  h=1134  n=3  x 442..486 px  alpha 239..242  d(alpha)/dx +0.0670
  h=1303  n=3  x -435..-390 px  alpha 157..154  d(alpha)/dx -0.0670

--
alpha vs position, per tall strip (design px, alpha level):
  h=1134  n=3  x -832..-819 px  alpha 135..136  d(alpha)/dx +0.0781
  h=1303  n=3  x 403..416 px  alpha 47..45  d(alpha)/dx -0.1562

--
alpha vs position, per tall strip (design px, alpha level):
  h=1134  n=4  x 237..307 px  alpha 222..227  d(alpha)/dx +0.0710
  h=1303  n=4  x -1229..-1158 px  alpha 209..204  d(alpha)/dx -0.0710


WHAT AGREES
  * sign, both strips, every session: the 1134-tall strip moves +x with alpha
    rising, the 1303-tall one moves -x with alpha rising. That is the declared
    direction for pteff03 and pteff03a respectively.
  * magnitude, within ~15 %: +0.067/+0.078/+0.071 against a declared +0.0814,
    and -0.067/-0.071 against a declared -0.0651.
  * the RANGE is exercised. Across sessions the measured alpha spans 45..242,
    and 45 is below 128. Only pteff03a declares alpha below 128 -- pteff03's
    ramp never leaves [128,255]. The strip measured at 45 is the 1303-tall one,
    which the AABB geometry independently says is pteff03a. Two identifications,
    one from height and one from alpha, agreeing.

WHAT THIS CANNOT DO
  * separate the two declared slopes. They are 25 % apart; NDC prints to two
    decimals so one frame's dx is quantised to 6.4 px and alpha to one level,
    and at 3-4 frames per session the noise is larger than the difference. The
    -0.1562 row is that noise: 13 px of travel and 2 alpha levels.
  * check ABSOLUTE phase. The log gives a rotated quad's AABB, and the mapping
    from AABB-left to the element's declared x under rotation and pivot is not
    established here. Only rates and ranges are compared.
