generated from spatie/package-skeleton-laravel
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* create snapshots folder, but ignore its contents * script to generate snapshots of easing plots * fix all broken easings * update readme
- Loading branch information
1 parent
0e5a555
commit 733a8ce
Showing
5 changed files
with
64 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ phpunit.xml | |
phpstan.neon | ||
testbench.yaml | ||
vendor | ||
tests/Snapshots/*.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
|
||
require_once __DIR__.'/../vendor/autoload.php'; | ||
|
||
use ProjektGopher\FFMpegTween\Enums\Ease as AvailableEasings; | ||
use ProjektGopher\FFMpegTween\Ease; | ||
|
||
echo 'starting... (fail fast)'.PHP_EOL; | ||
|
||
$time = "X/H"; | ||
|
||
foreach (AvailableEasings::cases() as $ease) { | ||
echo "Generating snapshot for {$ease->value} easing...".PHP_EOL; | ||
$easeMultiplier = Ease::{$ease->value}($time); | ||
|
||
$input = "-f lavfi -i \"color=c=black:s=256x256:d=1\""; | ||
$margin = '28'; | ||
$filter = "-vf \"geq=if(eq(round((H-2*{$margin})*({$easeMultiplier}))\,H-Y-{$margin})\,128\,0):128:128\""; | ||
$out = "-frames:v 1 -update 1 tests/Snapshots/{$ease->value}.png"; | ||
$redirect = '2>&1'; // redirect stderr to stdout | ||
|
||
$cmd = "ffmpeg -y {$input} {$filter} {$out} {$redirect}"; | ||
|
||
(array) $output = []; | ||
(int) $code = 0; | ||
exec($cmd, $output, $code); | ||
|
||
if ($code !== 0) { | ||
echo PHP_EOL; | ||
echo "Failed to generate snapshot for {$ease->value} easing.".PHP_EOL; | ||
echo "Output: ".PHP_EOL; | ||
echo implode(PHP_EOL, $output).PHP_EOL; | ||
exit(1); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.