Skip to content

Commit

Permalink
tests: add a 3D animated text test
Browse files Browse the repository at this point in the history
  • Loading branch information
ubitux committed Mar 6, 2024
1 parent 7b6b04a commit 7937a1b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ foreach backend : backends
'vertical_rl',
'vertical_lr',
'fixed',
'animated',
]
if has_text_libraries
tests_text += [
Expand Down
5 changes: 5 additions & 0 deletions tests/refs/text_animated.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
21555E007555775782032A0C22284455 21555E007555775782032A0C22284455 21555E007555775782032A0C22284455 00000000000000000000000000000000
00C503350DE03F60CF003F0CEC70A000 00C503350DE03F60CF003F0CEC70A000 00C503350DE03F60CF003F0CEC70A000 00000000000000000000000000000000
3940884488608A700E1022112219228C 3940884488608A700E1022112219228C 3940884488608A700E1022112219228C 00000000000000000000000000000000
01401C10B5C4A1713A1D8A8000700200 01401C10B5C4A1713A1D8A8000700200 01401C10B5C4A1713A1D8A8000700200 00000000000000000000000000000000
301085C47D70E155AA1538C08E03211C 301085C47D70E155AA1538C08E03211C 301085C47D70E155AA1538C08E03211C 00000000000000000000000000000000
12 changes: 12 additions & 0 deletions tests/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,15 @@ def text_fixed(cfg: ngl.SceneCfg):
scale_mode="fixed",
font_scale=4.5,
)


@test_fingerprint(width=640, height=480, tolerance=1, keyframes=5)
@ngl.scene()
def text_animated(cfg: ngl.SceneCfg):
cfg.aspect_ratio = (4, 3)
cfg.duration = 2
animkf = [
ngl.AnimKeyFrameFloat(0, 0),
ngl.AnimKeyFrameFloat(cfg.duration, 360),
]
return ngl.Rotate(ngl.Text("Hey"), angle=ngl.AnimatedFloat(animkf), axis=(1, 1, 1))

0 comments on commit 7937a1b

Please sign in to comment.