@vfrey/vfrey 0.0.1 → 1.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +33 -0
- package/README.md +78 -3
- package/accounts.example.json +61 -0
- package/accounts.first-run.json +41 -0
- package/bin/vfrey.mjs +36 -0
- package/integration-tools/README.md +43 -0
- package/integration-tools/image/pillow.md +32 -0
- package/integration-tools/image/playwright.md +33 -0
- package/integration-tools/image/resvg.md +36 -0
- package/integration-tools/image/satori.md +36 -0
- package/integration-tools/image/sharp.md +38 -0
- package/integration-tools/video/blender.md +34 -0
- package/integration-tools/video/ffmpeg.md +41 -0
- package/integration-tools/video/manim.md +37 -0
- package/integration-tools/video/motion-canvas.md +37 -0
- package/integration-tools/video/remotion.md +50 -0
- package/integration-tools/video/revideo.md +32 -0
- package/package.json +74 -6
- package/skills/vfrey-orchestrator/SKILL.md +15 -0
- package/skills/vfrey-orchestrator/channel-video/SKILL.md +41 -0
- package/skills/vfrey-product/SKILL.md +63 -0
- package/skills/vfrey-product/examples/concurrency-vs-parallelism/framey/cook-one.svg +14 -0
- package/skills/vfrey-product/examples/concurrency-vs-parallelism/framey/cook-two.svg +22 -0
- package/skills/vfrey-product/examples/concurrency-vs-parallelism/framey/index.html +70 -0
- package/skills/vfrey-product/examples/concurrency-vs-parallelism/remotion/cook-one.svg +14 -0
- package/skills/vfrey-product/examples/concurrency-vs-parallelism/remotion/cook-two.svg +22 -0
- package/skills/vfrey-product/examples/concurrency-vs-parallelism/remotion/index.tsx +49 -0
- package/skills/vfrey-product/examples/concurrency-vs-parallelism/script.json +15 -0
- package/skills/vfrey-product/examples/octopus-facts/index.html +60 -0
- package/skills/vfrey-product/examples/octopus-facts/octopus.svg +8 -0
- package/skills/vfrey-product/examples/octopus-facts/script.json +14 -0
- package/skills/vfrey-product/push/SKILL.md +15 -0
- package/skills/vfrey-product/scenes/NOTICE +5 -0
- package/skills/vfrey-product/scenes/blocks.md +57 -0
- package/skills/vfrey-product/scenes/craft.md +118 -0
- package/skills/vfrey-product/scenes/motion.md +88 -0
- package/src/analytics/dashboard.ts +109 -0
- package/src/analytics/index.ts +260 -0
- package/src/api/client.ts +282 -0
- package/src/api/commands.ts +330 -0
- package/src/api/config.ts +34 -0
- package/src/api/creators.ts +463 -0
- package/src/api/credentials.ts +152 -0
- package/src/api/mail.ts +333 -0
- package/src/api/topics.ts +207 -0
- package/src/api/types.ts +205 -0
- package/src/cli.ts +467 -0
- package/src/cloud/executor.ts +281 -0
- package/src/cloud/job.ts +106 -0
- package/src/cloud/render-job.ts +187 -0
- package/src/config.ts +309 -0
- package/src/dashboard-link.ts +180 -0
- package/src/dashboard-start.ts +103 -0
- package/src/desk/channel.ts +64 -0
- package/src/desk/cli.ts +216 -0
- package/src/desk/creators-route.ts +129 -0
- package/src/desk/fonts/JetBrainsMono-OFL.txt +93 -0
- package/src/desk/fonts/google-sans-flex-latin.woff2 +0 -0
- package/src/desk/fonts/jetbrains-mono-medium.woff2 +0 -0
- package/src/desk/http.ts +460 -0
- package/src/desk/mail-route.ts +103 -0
- package/src/desk/overlay.ts +112 -0
- package/src/desk/preview.ts +422 -0
- package/src/desk/screens.ts +149 -0
- package/src/desk/secrets.ts +143 -0
- package/src/desk/series.ts +127 -0
- package/src/desk/state.ts +77 -0
- package/src/desk/studio-route.ts +119 -0
- package/src/desk/tick-runner.ts +66 -0
- package/src/desk/tick.ts +56 -0
- package/src/desk/topics-route.ts +41 -0
- package/src/desk/ui/app.css +505 -0
- package/src/desk/ui/app.js +185 -0
- package/src/desk/ui/apple-icon.png +0 -0
- package/src/desk/ui/components.js +79 -0
- package/src/desk/ui/core.js +156 -0
- package/src/desk/ui/favicon.ico +0 -0
- package/src/desk/ui/icon.svg +1 -0
- package/src/desk/ui/icons.js +49 -0
- package/src/desk/ui/index.html +41 -0
- package/src/desk/ui/metrics-math.d.ts +22 -0
- package/src/desk/ui/metrics-math.js +135 -0
- package/src/desk/ui/theme.js +5 -0
- package/src/desk/ui/views-creators.js +209 -0
- package/src/desk/ui/views-keys.js +114 -0
- package/src/desk/ui/views-mail.js +188 -0
- package/src/desk/ui/views-misc.js +123 -0
- package/src/desk/ui/views-review.js +119 -0
- package/src/desk/ui/views-runs.js +350 -0
- package/src/desk/ui/views-screens.js +163 -0
- package/src/desk/ui/views-series.js +318 -0
- package/src/desk/ui/views-topics.js +87 -0
- package/src/desk/verbs.ts +361 -0
- package/src/doctor.ts +212 -0
- package/src/drain.ts +14 -0
- package/src/engage/index.ts +217 -0
- package/src/generate/index.ts +110 -0
- package/src/generate/script.ts +152 -0
- package/src/generate/title.ts +78 -0
- package/src/help.ts +233 -0
- package/src/home.ts +45 -0
- package/src/llm/client.ts +177 -0
- package/src/log.ts +7 -0
- package/src/oauth/tokens.ts +189 -0
- package/src/oauth/vault.ts +72 -0
- package/src/pipeline/review.ts +642 -0
- package/src/pipeline/run.ts +443 -0
- package/src/pipeline/series-guard.ts +26 -0
- package/src/pipeline/source-fetch.ts +69 -0
- package/src/pipeline/stages.ts +728 -0
- package/src/pipeline/topics-source.ts +90 -0
- package/src/product/commands.ts +296 -0
- package/src/product/config-file.ts +38 -0
- package/src/product/engine-choice.ts +89 -0
- package/src/product/engines.ts +103 -0
- package/src/product/insights.ts +50 -0
- package/src/product/keys.ts +67 -0
- package/src/product/paths.ts +18 -0
- package/src/product/probes.ts +88 -0
- package/src/product/push-flow.ts +90 -0
- package/src/product/render-video.ts +21 -0
- package/src/product/short.ts +62 -0
- package/src/product/update.ts +32 -0
- package/src/project/canonical.ts +14 -0
- package/src/project/commands.ts +177 -0
- package/src/project/dashboard-status.ts +28 -0
- package/src/project/discover.ts +19 -0
- package/src/project/index-file.ts +73 -0
- package/src/project/marker.ts +87 -0
- package/src/project/migrate.ts +201 -0
- package/src/project/names.ts +27 -0
- package/src/project/notice.ts +16 -0
- package/src/project/open.ts +88 -0
- package/src/project/scaffold.ts +112 -0
- package/src/project/templates.ts +42 -0
- package/src/project/videos.ts +64 -0
- package/src/publish/facebook.ts +91 -0
- package/src/publish/index.ts +12 -0
- package/src/publish/instagram.ts +97 -0
- package/src/publish/rate.ts +62 -0
- package/src/publish/session.ts +242 -0
- package/src/publish/tiktok.ts +202 -0
- package/src/publish/youtube.ts +177 -0
- package/src/queue/desk-ops.ts +1170 -0
- package/src/queue/seal.ts +3 -0
- package/src/queue/store.ts +1006 -0
- package/src/remotion/AiLabel.tsx +26 -0
- package/src/remotion/Root.tsx +73 -0
- package/src/remotion/defaults.ts +26 -0
- package/src/remotion/films/claude/ClaudeFilm.tsx +1014 -0
- package/src/remotion/films/engine/EngineMark.tsx +17 -0
- package/src/remotion/films/rea/ReaShort.tsx +552 -0
- package/src/remotion/films/rea/drawings.tsx +907 -0
- package/src/remotion/films/rea/timing.ts +144 -0
- package/src/remotion/index.ts +4 -0
- package/src/remotion/templates/EditorialSplit.tsx +39 -0
- package/src/remotion/templates/KineticType.tsx +39 -0
- package/src/remotion/templates/SignalBoard.tsx +50 -0
- package/src/remotion/timing.ts +22 -0
- package/src/render/chrome.ts +78 -0
- package/src/render/engine-mark.ts +29 -0
- package/src/render/framey-template.ts +130 -0
- package/src/render/html-engine.ts +149 -0
- package/src/render/node-crypto-stub.ts +11 -0
- package/src/render/probe.ts +29 -0
- package/src/render/props.ts +17 -0
- package/src/render/vertical-short.ts +35 -0
- package/src/render/webpack.ts +33 -0
- package/src/render/worker.ts +65 -0
- package/src/scene/assets/fonts/TitanOne-OFL.txt +94 -0
- package/src/scene/assets/fonts/titan-one.woff2 +0 -0
- package/src/scene/assets/gsap/LICENSE.txt +8 -0
- package/src/scene/assets/gsap/gsap.min.js +11 -0
- package/src/scene/audio.ts +54 -0
- package/src/scene/blocks/LICENSE +190 -0
- package/src/scene/blocks/NOTICE +5 -0
- package/src/scene/blocks/bar-chart-race/bar-chart-race.html +585 -0
- package/src/scene/blocks/beat-freeze-cut/beat-freeze-cut.html +874 -0
- package/src/scene/blocks/camcorder-hud/camcorder-hud.html +164 -0
- package/src/scene/blocks/camera-dolly-zoom/camera-dolly-zoom.html +355 -0
- package/src/scene/blocks/code-diff/code-diff.html +817 -0
- package/src/scene/blocks/code-snippet-apple-terminal-pro/code-snippet-apple-terminal-pro.html +248 -0
- package/src/scene/blocks/code-typing/code-typing.html +764 -0
- package/src/scene/blocks/data-chart/data-chart.html +452 -0
- package/src/scene/blocks/flowchart-vertical/flowchart-vertical.html +454 -0
- package/src/scene/blocks/hw-scribble-transition/hw-scribble-transition.html +153 -0
- package/src/scene/blocks/index.json +824 -0
- package/src/scene/blocks/lt-accent-underline/lt-accent-underline.html +107 -0
- package/src/scene/blocks/lt-bold-block/lt-bold-block.html +109 -0
- package/src/scene/blocks/lt-clean-bar/lt-clean-bar.html +112 -0
- package/src/scene/blocks/lt-dark-card/lt-dark-card.html +111 -0
- package/src/scene/blocks/lt-kicker-name/lt-kicker-name.html +114 -0
- package/src/scene/blocks/lt-mask-reveal/lt-mask-reveal.html +120 -0
- package/src/scene/blocks/lt-neon-border/lt-neon-border.html +391 -0
- package/src/scene/blocks/lt-stack-bars/lt-stack-bars.html +109 -0
- package/src/scene/blocks/macos-notification/macos-notification.html +194 -0
- package/src/scene/blocks/mk-background/mk-background.html +236 -0
- package/src/scene/blocks/mk-callout-highlight/mk-callout-highlight.html +183 -0
- package/src/scene/blocks/mk-clone-wall-transition/mk-clone-wall-transition.html +226 -0
- package/src/scene/blocks/mk-line-graph/mk-line-graph.html +293 -0
- package/src/scene/blocks/mk-progress-stat/mk-progress-stat.html +186 -0
- package/src/scene/blocks/mk-specs-list/mk-specs-list.html +223 -0
- package/src/scene/blocks/news-ticker/news-ticker.html +409 -0
- package/src/scene/blocks/organic-light-leak-overlay/organic-light-leak-overlay.html +126 -0
- package/src/scene/blocks/oscilloscope-trace/oscilloscope-trace.html +519 -0
- package/src/scene/blocks/snow/snow.html +205 -0
- package/src/scene/blocks/split-flap-board/split-flap-board.html +347 -0
- package/src/scene/blocks/spotify-card/spotify-card.html +294 -0
- package/src/scene/blocks/starfield/starfield.html +188 -0
- package/src/scene/blocks/thread-message-stack/thread-message-stack.html +239 -0
- package/src/scene/blocks/week-in-merges/week-in-merges.html +470 -0
- package/src/scene/blocks/x-post/x-post.html +437 -0
- package/src/scene/blocks/yt-comment-card/yt-comment-card.html +319 -0
- package/src/scene/blocks/yt-lcd-background/yt-lcd-background.html +307 -0
- package/src/scene/blocks/yt-prism-title/yt-prism-title.html +205 -0
- package/src/scene/blocks.ts +229 -0
- package/src/scene/command.ts +272 -0
- package/src/scene/figure.ts +181 -0
- package/src/scene/glyphs.ts +107 -0
- package/src/scene/init.ts +86 -0
- package/src/scene/inspect/css-tree.d.ts +6 -0
- package/src/scene/inspect/page-scripts.ts +272 -0
- package/src/scene/inspect/report.ts +405 -0
- package/src/scene/inspect/run.ts +200 -0
- package/src/scene/inspect/source.ts +236 -0
- package/src/scene/label.ts +131 -0
- package/src/scene/net-guard.ts +74 -0
- package/src/scene/render.ts +292 -0
- package/src/scene/runtime/browser.ts +199 -0
- package/src/scene/runtime/core.ts +181 -0
- package/src/scene/runtime/react.tsx +115 -0
- package/src/scene/runtime/transitions.ts +133 -0
- package/src/scene/sanitize.ts +181 -0
- package/src/scene/scene.ts +152 -0
- package/src/scene/studio-command.ts +48 -0
- package/src/scene/studio-skin.ts +59 -0
- package/src/scene/studio.ts +337 -0
- package/src/scene/supply.ts +111 -0
- package/src/scene/timing.ts +288 -0
- package/src/scene/transitions/LICENSE +190 -0
- package/src/scene/transitions/NOTICE +5 -0
- package/src/scene/transitions/SOURCE.json +24 -0
- package/src/scene/transitions/transitions.global.js +38 -0
- package/src/scene/transitions.ts +26 -0
- package/src/service/all-projects.ts +153 -0
- package/src/service/commands.ts +256 -0
- package/src/service/due.ts +82 -0
- package/src/service/lock.ts +101 -0
- package/src/service/log-file.ts +56 -0
- package/src/service/state.ts +41 -0
- package/src/service/units.ts +90 -0
- package/src/service/worker.ts +51 -0
- package/src/skill-agents.ts +74 -0
- package/src/skill-install.ts +334 -0
- package/src/sync-write.ts +21 -0
- package/src/tick-report.ts +205 -0
- package/src/tts.ts +124 -0
- package/vendor/@vfrey/contracts/dist/account.d.ts +97 -0
- package/vendor/@vfrey/contracts/dist/account.js +27 -0
- package/vendor/@vfrey/contracts/dist/checks.d.ts +8 -0
- package/vendor/@vfrey/contracts/dist/checks.js +1 -0
- package/vendor/@vfrey/contracts/dist/credentials/crypto.d.ts +4 -0
- package/vendor/@vfrey/contracts/dist/credentials/crypto.js +38 -0
- package/vendor/@vfrey/contracts/dist/domain/advice-persona.d.ts +10 -0
- package/vendor/@vfrey/contracts/dist/domain/advice-persona.js +24 -0
- package/vendor/@vfrey/contracts/dist/domain/backoff.d.ts +13 -0
- package/vendor/@vfrey/contracts/dist/domain/backoff.js +27 -0
- package/vendor/@vfrey/contracts/dist/domain/cadence.d.ts +29 -0
- package/vendor/@vfrey/contracts/dist/domain/cadence.js +95 -0
- package/vendor/@vfrey/contracts/dist/domain/creators.d.ts +146 -0
- package/vendor/@vfrey/contracts/dist/domain/creators.js +2 -0
- package/vendor/@vfrey/contracts/dist/domain/disclosure.d.ts +127 -0
- package/vendor/@vfrey/contracts/dist/domain/disclosure.js +250 -0
- package/vendor/@vfrey/contracts/dist/domain/errors.d.ts +34 -0
- package/vendor/@vfrey/contracts/dist/domain/errors.js +68 -0
- package/vendor/@vfrey/contracts/dist/domain/redact.d.ts +1 -0
- package/vendor/@vfrey/contracts/dist/domain/redact.js +21 -0
- package/vendor/@vfrey/contracts/dist/domain/revenue.d.ts +13 -0
- package/vendor/@vfrey/contracts/dist/domain/revenue.js +16 -0
- package/vendor/@vfrey/contracts/dist/domain/safety.d.ts +20 -0
- package/vendor/@vfrey/contracts/dist/domain/safety.js +61 -0
- package/vendor/@vfrey/contracts/dist/domain/similarity.d.ts +13 -0
- package/vendor/@vfrey/contracts/dist/domain/similarity.js +100 -0
- package/vendor/@vfrey/contracts/dist/domain/templates.d.ts +18 -0
- package/vendor/@vfrey/contracts/dist/domain/templates.js +67 -0
- package/vendor/@vfrey/contracts/dist/domain/tiktok-chunks.d.ts +19 -0
- package/vendor/@vfrey/contracts/dist/domain/tiktok-chunks.js +52 -0
- package/vendor/@vfrey/contracts/dist/domain/topics.d.ts +78 -0
- package/vendor/@vfrey/contracts/dist/domain/topics.js +4 -0
- package/vendor/@vfrey/contracts/dist/domain/types.d.ts +216 -0
- package/vendor/@vfrey/contracts/dist/domain/types.js +1 -0
- package/vendor/@vfrey/contracts/dist/domain/variation.d.ts +57 -0
- package/vendor/@vfrey/contracts/dist/domain/variation.js +278 -0
- package/vendor/@vfrey/contracts/dist/events.d.ts +20 -0
- package/vendor/@vfrey/contracts/dist/events.js +1 -0
- package/vendor/@vfrey/contracts/dist/http.d.ts +11 -0
- package/vendor/@vfrey/contracts/dist/http.js +37 -0
- package/vendor/@vfrey/contracts/dist/index.d.ts +22 -0
- package/vendor/@vfrey/contracts/dist/index.js +22 -0
- package/vendor/@vfrey/contracts/dist/log.d.ts +2 -0
- package/vendor/@vfrey/contracts/dist/log.js +10 -0
- package/vendor/@vfrey/contracts/dist/mail.d.ts +55 -0
- package/vendor/@vfrey/contracts/dist/mail.js +1 -0
- package/vendor/@vfrey/contracts/package.json +18 -0
- package/vendor/@vfrey/ingest/dist/index.d.ts +41 -0
- package/vendor/@vfrey/ingest/dist/index.js +221 -0
- package/vendor/@vfrey/ingest/dist/parse.d.ts +5 -0
- package/vendor/@vfrey/ingest/dist/parse.js +165 -0
- package/vendor/@vfrey/ingest/package.json +21 -0
- package/vendor/framey/LICENSE +190 -0
- package/vendor/framey/NOTICE +15 -0
- package/vendor/framey/SOURCE.json +24 -0
- package/vendor/framey/STUDIO-SOURCE.json +9 -0
- package/vendor/framey/bin/framey-localize-fonts.mjs +12 -0
- package/vendor/framey/bin/framey.mjs +16 -0
- package/vendor/framey/dist/add-VMJD5KBS.js +75 -0
- package/vendor/framey/dist/animatedGifPrep-QPKGJ6PM.js +43 -0
- package/vendor/framey/dist/api.d.ts +211 -0
- package/vendor/framey/dist/api.js +76 -0
- package/vendor/framey/dist/appHistory-WW56FZTT.js +31 -0
- package/vendor/framey/dist/asset-WQKGOELE.js +26 -0
- package/vendor/framey/dist/audio-RSJWVWRA.js +1936 -0
- package/vendor/framey/dist/batchRender-3HPICDCT.js +366 -0
- package/vendor/framey/dist/beats-HL2BDUZI.js +273 -0
- package/vendor/framey/dist/benchmark-RWCWHI5Z.js +230 -0
- package/vendor/framey/dist/browser-ECYET3Q2.js +206 -0
- package/vendor/framey/dist/bundleWithLocalizedFonts-ALYBQEQT.js +52 -0
- package/vendor/framey/dist/captureCompositionFrame-4DA6SEH2.js +94 -0
- package/vendor/framey/dist/catalog-5JVDEUWK.js +979 -0
- package/vendor/framey/dist/catch-up-NEBCL5NO.js +106 -0
- package/vendor/framey/dist/check-F5N544ML.js +111 -0
- package/vendor/framey/dist/checkBrowser-LZ66CMJG.js +110 -0
- package/vendor/framey/dist/chunk-2K7Z2HVP.js +372 -0
- package/vendor/framey/dist/chunk-2UZQHDM7.js +323 -0
- package/vendor/framey/dist/chunk-2X4PQEYM.js +34 -0
- package/vendor/framey/dist/chunk-3422KMTD.js +168 -0
- package/vendor/framey/dist/chunk-3FYD4YEK.js +72 -0
- package/vendor/framey/dist/chunk-3GXQPCJC.js +682 -0
- package/vendor/framey/dist/chunk-3LM6YPBR.js +179 -0
- package/vendor/framey/dist/chunk-442JNXRM.js +20 -0
- package/vendor/framey/dist/chunk-4BNN5FGX.js +182 -0
- package/vendor/framey/dist/chunk-4P7NX5BM.js +11532 -0
- package/vendor/framey/dist/chunk-4UMPIPCQ.js +88 -0
- package/vendor/framey/dist/chunk-4YYJOFKS.js +28 -0
- package/vendor/framey/dist/chunk-54HJ63Q2.js +29 -0
- package/vendor/framey/dist/chunk-5ETJX6WM.js +89 -0
- package/vendor/framey/dist/chunk-5SG54JRS.js +68 -0
- package/vendor/framey/dist/chunk-634HSJ3J.js +58 -0
- package/vendor/framey/dist/chunk-66LREXGS.js +48 -0
- package/vendor/framey/dist/chunk-6BEFEWFB.js +25 -0
- package/vendor/framey/dist/chunk-6BNTGNGD.js +286 -0
- package/vendor/framey/dist/chunk-6DDPOHMK.js +140 -0
- package/vendor/framey/dist/chunk-6GV5XSOR.js +214 -0
- package/vendor/framey/dist/chunk-6JR2XUEE.js +127 -0
- package/vendor/framey/dist/chunk-73QVATIM.js +362 -0
- package/vendor/framey/dist/chunk-7FMUTGOH.js +279 -0
- package/vendor/framey/dist/chunk-7JQFJ6JJ.js +291 -0
- package/vendor/framey/dist/chunk-AHPGAESX.js +113 -0
- package/vendor/framey/dist/chunk-AHX34EFP.js +15 -0
- package/vendor/framey/dist/chunk-AJ5CSAEZ.js +487 -0
- package/vendor/framey/dist/chunk-B7RJV74O.js +5047 -0
- package/vendor/framey/dist/chunk-BL4U6U52.js +254 -0
- package/vendor/framey/dist/chunk-BSQ7XANM.js +210 -0
- package/vendor/framey/dist/chunk-BZ56MTDX.js +6 -0
- package/vendor/framey/dist/chunk-C5BO7PMT.js +282 -0
- package/vendor/framey/dist/chunk-CFUCHO4T.js +358 -0
- package/vendor/framey/dist/chunk-CZGHFATT.js +31 -0
- package/vendor/framey/dist/chunk-DLA44CMS.js +5649 -0
- package/vendor/framey/dist/chunk-DPVXBVLL.js +31292 -0
- package/vendor/framey/dist/chunk-DQBY7FRR.js +397 -0
- package/vendor/framey/dist/chunk-EAMLBAHA.js +154 -0
- package/vendor/framey/dist/chunk-EOVYQ3IG.js +143 -0
- package/vendor/framey/dist/chunk-EVMY7IPL.js +612 -0
- package/vendor/framey/dist/chunk-FG4BBFZI.js +122 -0
- package/vendor/framey/dist/chunk-FI4I7CME.js +56 -0
- package/vendor/framey/dist/chunk-FLREUEHW.js +2081 -0
- package/vendor/framey/dist/chunk-FUFP7A7S.js +1126 -0
- package/vendor/framey/dist/chunk-FV3PIKGH.js +56 -0
- package/vendor/framey/dist/chunk-FXMKHHPO.js +123 -0
- package/vendor/framey/dist/chunk-GGZAM5VH.js +1187 -0
- package/vendor/framey/dist/chunk-GKZEVJIB.js +39 -0
- package/vendor/framey/dist/chunk-GMECXFAN.js +57 -0
- package/vendor/framey/dist/chunk-GNEFDLFB.js +621 -0
- package/vendor/framey/dist/chunk-GPMLSOEG.js +19274 -0
- package/vendor/framey/dist/chunk-GPYVT5EE.js +59 -0
- package/vendor/framey/dist/chunk-H6IEMZEV.js +40 -0
- package/vendor/framey/dist/chunk-HEFQCIXR.js +170 -0
- package/vendor/framey/dist/chunk-HFQ4CWHA.js +118 -0
- package/vendor/framey/dist/chunk-HPDTCOKE.js +304 -0
- package/vendor/framey/dist/chunk-HTUHQKDB.js +548 -0
- package/vendor/framey/dist/chunk-HU2SPFNG.js +103 -0
- package/vendor/framey/dist/chunk-HVW7ABXD.js +19 -0
- package/vendor/framey/dist/chunk-IG7NDKXO.js +26 -0
- package/vendor/framey/dist/chunk-II3J3WXK.js +246 -0
- package/vendor/framey/dist/chunk-IR35BCLK.js +13 -0
- package/vendor/framey/dist/chunk-ISN5GRYI.js +20 -0
- package/vendor/framey/dist/chunk-IUONB55J.js +669 -0
- package/vendor/framey/dist/chunk-IVSUQR2B.js +161 -0
- package/vendor/framey/dist/chunk-IXU6PQSW.js +259 -0
- package/vendor/framey/dist/chunk-IZCW2NKT.js +29 -0
- package/vendor/framey/dist/chunk-JGXJU5PF.js +68 -0
- package/vendor/framey/dist/chunk-JHOCK3DG.js +27 -0
- package/vendor/framey/dist/chunk-JVBRJMOP.js +121 -0
- package/vendor/framey/dist/chunk-K4MJX7SR.js +17 -0
- package/vendor/framey/dist/chunk-K4WKGXRC.js +18 -0
- package/vendor/framey/dist/chunk-KGPLIH7B.js +127 -0
- package/vendor/framey/dist/chunk-KLIKCX6Q.js +63 -0
- package/vendor/framey/dist/chunk-KXTKKBOC.js +61 -0
- package/vendor/framey/dist/chunk-KZI44OPA.js +185 -0
- package/vendor/framey/dist/chunk-LEKZNRKI.js +45 -0
- package/vendor/framey/dist/chunk-LFGJWOVA.js +61 -0
- package/vendor/framey/dist/chunk-LLMSX6V6.js +17 -0
- package/vendor/framey/dist/chunk-LTGTN2TH.js +195 -0
- package/vendor/framey/dist/chunk-M2WBOQ2Q.js +54 -0
- package/vendor/framey/dist/chunk-MI5FTLYK.js +399 -0
- package/vendor/framey/dist/chunk-MLQP2QUF.js +1809 -0
- package/vendor/framey/dist/chunk-MMQ52NIZ.js +956 -0
- package/vendor/framey/dist/chunk-ND46XKK3.js +742 -0
- package/vendor/framey/dist/chunk-NYEXNSHM.js +504 -0
- package/vendor/framey/dist/chunk-O4YRB27L.js +57 -0
- package/vendor/framey/dist/chunk-O7BGSQ5F.js +92 -0
- package/vendor/framey/dist/chunk-OFQWTKPW.js +117 -0
- package/vendor/framey/dist/chunk-P5ZBLXJ6.js +91 -0
- package/vendor/framey/dist/chunk-P6LJ4Y32.js +4662 -0
- package/vendor/framey/dist/chunk-PKZ7RK5N.js +281 -0
- package/vendor/framey/dist/chunk-PURHAXFL.js +15 -0
- package/vendor/framey/dist/chunk-Q5X2B5WT.js +29 -0
- package/vendor/framey/dist/chunk-QAMKOG67.js +248 -0
- package/vendor/framey/dist/chunk-R6YBK4XX.js +514 -0
- package/vendor/framey/dist/chunk-RGLQURIX.js +2997 -0
- package/vendor/framey/dist/chunk-RNV3DM4S.js +3573 -0
- package/vendor/framey/dist/chunk-ROEW726S.js +4638 -0
- package/vendor/framey/dist/chunk-RQVDTPGD.js +6 -0
- package/vendor/framey/dist/chunk-RVZHGOGR.js +26 -0
- package/vendor/framey/dist/chunk-RXATE6FZ.js +385 -0
- package/vendor/framey/dist/chunk-S3S4TGEH.js +424 -0
- package/vendor/framey/dist/chunk-SDYDNHEE.js +11202 -0
- package/vendor/framey/dist/chunk-SSWBU67I.js +173 -0
- package/vendor/framey/dist/chunk-ST35C4K6.js +28 -0
- package/vendor/framey/dist/chunk-SZNTYTIV.js +990 -0
- package/vendor/framey/dist/chunk-T2EUWCJE.js +29 -0
- package/vendor/framey/dist/chunk-T6AGUTZJ.js +444 -0
- package/vendor/framey/dist/chunk-THJALHFJ.js +11131 -0
- package/vendor/framey/dist/chunk-TIQB63MX.js +18128 -0
- package/vendor/framey/dist/chunk-U242RTCT.js +134 -0
- package/vendor/framey/dist/chunk-UJZREAV6.js +3901 -0
- package/vendor/framey/dist/chunk-UMD3V7CU.js +264 -0
- package/vendor/framey/dist/chunk-UOFAE5RF.js +42 -0
- package/vendor/framey/dist/chunk-UTEIUGAZ.js +29 -0
- package/vendor/framey/dist/chunk-VAS6HQX3.js +138 -0
- package/vendor/framey/dist/chunk-VC76R6W2.js +27 -0
- package/vendor/framey/dist/chunk-VFZ7W5W7.js +226 -0
- package/vendor/framey/dist/chunk-VHNLZAE2.js +348 -0
- package/vendor/framey/dist/chunk-VMC4WSH5.js +278 -0
- package/vendor/framey/dist/chunk-VORQIH64.js +108 -0
- package/vendor/framey/dist/chunk-VTXFRIHO.js +186 -0
- package/vendor/framey/dist/chunk-W2LGJSEN.js +182 -0
- package/vendor/framey/dist/chunk-WKBM7NDG.js +32 -0
- package/vendor/framey/dist/chunk-WMQNIQDJ.js +2057 -0
- package/vendor/framey/dist/chunk-WN4XZC5F.js +504 -0
- package/vendor/framey/dist/chunk-WQ6ZXHFQ.js +133 -0
- package/vendor/framey/dist/chunk-X7HBSTCZ.js +53 -0
- package/vendor/framey/dist/chunk-X7MTZ4T2.js +6 -0
- package/vendor/framey/dist/chunk-XPTOJZJF.js +308 -0
- package/vendor/framey/dist/chunk-XT6MXC7A.js +6 -0
- package/vendor/framey/dist/chunk-XT7X6QCP.js +6 -0
- package/vendor/framey/dist/chunk-XTMDWNEC.js +2820 -0
- package/vendor/framey/dist/chunk-XUHOIDKG.js +6 -0
- package/vendor/framey/dist/chunk-XX7LTW5Y.js +138 -0
- package/vendor/framey/dist/chunk-Y3YGTZEG.js +382 -0
- package/vendor/framey/dist/chunk-Y5SBSGN7.js +346 -0
- package/vendor/framey/dist/chunk-YCMVI4MZ.js +625 -0
- package/vendor/framey/dist/chunk-YOR4CTCE.js +261 -0
- package/vendor/framey/dist/chunk-YPRBGITP.js +2748 -0
- package/vendor/framey/dist/chunk-ZKDMAOFU.js +32 -0
- package/vendor/framey/dist/chunk-ZW6DURPF.js +1318 -0
- package/vendor/framey/dist/clean-ZJOGDKDM.js +336 -0
- package/vendor/framey/dist/cli.js +439 -0
- package/vendor/framey/dist/cloudrun-HGJ3B6ZV.js +767 -0
- package/vendor/framey/dist/commands/contrast-audit.browser.js +643 -0
- package/vendor/framey/dist/commands/layout-audit.browser.js +2914 -0
- package/vendor/framey/dist/commands/motion-sample.browser.js +74 -0
- package/vendor/framey/dist/commands/motion-signature.browser.js +475 -0
- package/vendor/framey/dist/compare-W7UY3BAZ.js +463 -0
- package/vendor/framey/dist/compiler-TM3W6GYF.js +136 -0
- package/vendor/framey/dist/component-QF5VGYMU.js +176 -0
- package/vendor/framey/dist/compositions-XT3PMNDF.js +238 -0
- package/vendor/framey/dist/contactSheet-7W6GYHBQ.js +24 -0
- package/vendor/framey/dist/deploy-6FJPWKF2.js +299 -0
- package/vendor/framey/dist/destroy-HE2RIPKZ.js +57 -0
- package/vendor/framey/dist/deterministicFonts-RADD3BSX.js +50 -0
- package/vendor/framey/dist/dist-4S2FGGVY.js +422 -0
- package/vendor/framey/dist/dist-BE4B2EZE.js +32 -0
- package/vendor/framey/dist/dist-EWXJGN63.js +129 -0
- package/vendor/framey/dist/docs-VKIRFEEX.js +131 -0
- package/vendor/framey/dist/doctor-2UNJ2G7U.js +74 -0
- package/vendor/framey/dist/dom-37K6YOH4.js +14 -0
- package/vendor/framey/dist/dotEnv-7PZQTVIM.js +54 -0
- package/vendor/framey/dist/events-ACY3P2PA.js +76 -0
- package/vendor/framey/dist/events-IHB3B2MK.js +69 -0
- package/vendor/framey/dist/ffmpeg-DR5LGGSK.js +63 -0
- package/vendor/framey/dist/figma-BODVUPHB.js +63 -0
- package/vendor/framey/dist/fontData.generated-NXAOI4GH.js +13 -0
- package/vendor/framey/dist/fontLocalizeCli.js +142 -0
- package/vendor/framey/dist/gpuPolicy-XLEXORZY.js +49 -0
- package/vendor/framey/dist/grade-compare-GAXFQ74C.js +661 -0
- package/vendor/framey/dist/gsapParser-IEUSLYDJ.js +2885 -0
- package/vendor/framey/dist/gsapParserAcorn-LZJKCFQI.js +30 -0
- package/vendor/framey/dist/help-VCB5X2HS.js +184 -0
- package/vendor/framey/dist/history-ENGZEVFT.js +471 -0
- package/vendor/framey/dist/hyperframe.manifest.json +22 -0
- package/vendor/framey/dist/hyperframe.runtime.iife.js +1132 -0
- package/vendor/framey/dist/hyperframes-player.global.js +478 -0
- package/vendor/framey/dist/hyperframes-slideshow.global.js +148 -0
- package/vendor/framey/dist/info-WPCJHBMU.js +182 -0
- package/vendor/framey/dist/init-G4WGLYGD.js +1176 -0
- package/vendor/framey/dist/inspect-5IQ6CNEQ.js +106 -0
- package/vendor/framey/dist/installer-ML4HWUV7.js +40 -0
- package/vendor/framey/dist/keyframes-Q6XJO7VW.js +2755 -0
- package/vendor/framey/dist/lambda-A7JC74JF.js +468 -0
- package/vendor/framey/dist/layout-YET6XNXA.js +95 -0
- package/vendor/framey/dist/lint-I7FZN2VJ.js +162 -0
- package/vendor/framey/dist/lintProject-PDB3UN72.js +30 -0
- package/vendor/framey/dist/manager-CD6LJ7ZN.js +45 -0
- package/vendor/framey/dist/manager-WA4F2GST.js +67 -0
- package/vendor/framey/dist/media-treatment-BXYS4WVA.js +1030 -0
- package/vendor/framey/dist/media-use-LWH3MANK.js +113 -0
- package/vendor/framey/dist/models-K363FYM4.js +195 -0
- package/vendor/framey/dist/motionShot-GPAVWXLH.js +640 -0
- package/vendor/framey/dist/normalize-FASIPBUM.js +24 -0
- package/vendor/framey/dist/normalize-audio-VDWYRHN6.js +268 -0
- package/vendor/framey/dist/open-E3TB6P6J.js +128 -0
- package/vendor/framey/dist/parakeetRunner-UP34UOI2.js +58 -0
- package/vendor/framey/dist/pipeline-VXIUYEBU.js +64 -0
- package/vendor/framey/dist/play-BUTDQ4DV.js +353 -0
- package/vendor/framey/dist/policies-OLDYGFK5.js +309 -0
- package/vendor/framey/dist/preflight-2KZ2GWAZ.js +55 -0
- package/vendor/framey/dist/present-GXYSM7NX.js +353 -0
- package/vendor/framey/dist/preview-EKZ33JOJ.js +1910 -0
- package/vendor/framey/dist/producer-SKU5EV3J.js +13 -0
- package/vendor/framey/dist/progress-ZWB4Z4ET.js +76 -0
- package/vendor/framey/dist/projectConfig-3MZAYVTS.js +60 -0
- package/vendor/framey/dist/publication-DTKWNF74.js +33 -0
- package/vendor/framey/dist/remove-background-OY5L7XN2.js +265 -0
- package/vendor/framey/dist/render-CDV4GDFX.js +187 -0
- package/vendor/framey/dist/render-YE5YAMOD.js +2620 -0
- package/vendor/framey/dist/render-batch-ZAMFPCLL.js +274 -0
- package/vendor/framey/dist/renderSetupWorker.js +120 -0
- package/vendor/framey/dist/resolver-D5BIPSEW.js +42 -0
- package/vendor/framey/dist/runtimeVersion.js +18 -0
- package/vendor/framey/dist/sam-WFZXI4F7.js +23 -0
- package/vendor/framey/dist/shaderTransitionWorker.js +44 -0
- package/vendor/framey/dist/sherpa-RQWLV7I3.js +79 -0
- package/vendor/framey/dist/sherpaWorker.js +84 -0
- package/vendor/framey/dist/sites-AMOVABTK.js +54 -0
- package/vendor/framey/dist/skill-ZHVLH7KX.js +15 -0
- package/vendor/framey/dist/slideshow-SJGK4RQS.js +24 -0
- package/vendor/framey/dist/snapshot-TUXL6LBQ.js +1515 -0
- package/vendor/framey/dist/src-JHQGB2S6.js +215 -0
- package/vendor/framey/dist/src-Z5PGEMXB.js +532 -0
- package/vendor/framey/dist/state-B6H3WHCF.js +28 -0
- package/vendor/framey/dist/staticProjectServer-DFVZOUGI.js +63 -0
- package/vendor/framey/dist/studio/assets/hyperframes-player-DLaKjw0L.js +478 -0
- package/vendor/framey/dist/studio/assets/index-BX3KHhGX.js +71 -0
- package/vendor/framey/dist/studio/assets/index-CYbvOVp-.css +1 -0
- package/vendor/framey/dist/studio/assets/index-Dp3QEUGL.js +402 -0
- package/vendor/framey/dist/studio/assets/index-qrTAXbqc.js +531 -0
- package/vendor/framey/dist/studio/favicon.svg +14 -0
- package/vendor/framey/dist/studio/icons/timeline/audio.svg +7 -0
- package/vendor/framey/dist/studio/icons/timeline/captions.svg +5 -0
- package/vendor/framey/dist/studio/icons/timeline/composition.svg +12 -0
- package/vendor/framey/dist/studio/icons/timeline/image.svg +18 -0
- package/vendor/framey/dist/studio/icons/timeline/music.svg +10 -0
- package/vendor/framey/dist/studio/icons/timeline/text.svg +3 -0
- package/vendor/framey/dist/studio/index.html +23 -0
- package/vendor/framey/dist/studio-api-2NECGRMB.js +179 -0
- package/vendor/framey/dist/studioSelectionClient-IUUPKUHZ.js +25 -0
- package/vendor/framey/dist/studioServer-N2OPUMOQ.js +1569 -0
- package/vendor/framey/dist/synthesize-PKTB5ATG.js +183 -0
- package/vendor/framey/dist/system-7F3UEHQT.js +27 -0
- package/vendor/framey/dist/telemetry-DQGPEKM6.js +145 -0
- package/vendor/framey/dist/telemetry-UN55N6U6.js +77 -0
- package/vendor/framey/dist/timeline-LHUUMK63.js +1295 -0
- package/vendor/framey/dist/tokens-OLECWDFK.js +92 -0
- package/vendor/framey/dist/transcribe-O7HQKMIV.js +331 -0
- package/vendor/framey/dist/transcribe-UJESPBT5.js +76 -0
- package/vendor/framey/dist/tts-YCCQHZD4.js +234 -0
- package/vendor/framey/dist/urlDownloader-H2LXLG4U.js +48 -0
- package/vendor/framey/dist/usage-HG4WMM7A.js +2167 -0
- package/vendor/framey/dist/validate-F2XMN6EV.js +87 -0
- package/vendor/framey/dist/vendor/npm/gsap@3.15.0/GSAP-LICENSE.txt +8 -0
- package/vendor/framey/dist/vendor/npm/gsap@3.15.0/dist/CustomEase.min.js +11 -0
- package/vendor/framey/dist/vendor/npm/gsap@3.15.0/dist/MotionPathPlugin.min.js +11 -0
- package/vendor/framey/dist/vendor/npm/gsap@3.15.0/dist/gsap.min.js +11 -0
- package/vendor/framey/dist/warmCheck.js +220 -0
- package/vendor/framey/dist/warmCheckClient.js +139 -0
- package/vendor/framey/dist/workspaceBuildCheck-XYD2YTFW.js +133 -0
- package/vendor/framey-player/LICENSE +190 -0
- package/vendor/framey-player/NOTICE +16 -0
- package/vendor/framey-player/SOURCE.json +6 -0
- package/vendor/framey-player/hyperframes-player.global.js +478 -0
- package/vendor/framey.pin +1 -0
- package/bin/index.js +0 -3
|
@@ -0,0 +1,682 @@
|
|
|
1
|
+
import { createRequire as __hf_createRequire } from "node:module";
|
|
2
|
+
import { fileURLToPath as __hf_fileURLToPath } from "node:url";
|
|
3
|
+
import { dirname as __hf_dirname } from "node:path";
|
|
4
|
+
var require = __hf_createRequire(import.meta.url);
|
|
5
|
+
var __filename = __hf_fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = __hf_dirname(__filename);
|
|
7
|
+
|
|
8
|
+
// ../engine/src/utils/shaderTransitions.ts
|
|
9
|
+
var PQ_M1 = 0.1593017578125;
|
|
10
|
+
var PQ_M2 = 78.84375;
|
|
11
|
+
var PQ_C1 = 0.8359375;
|
|
12
|
+
var PQ_C2 = 18.8515625;
|
|
13
|
+
var PQ_C3 = 18.6875;
|
|
14
|
+
function pqEotf(signal) {
|
|
15
|
+
const sp = Math.pow(Math.max(0, signal), 1 / PQ_M2);
|
|
16
|
+
const num = Math.max(sp - PQ_C1, 0);
|
|
17
|
+
const den = PQ_C2 - PQ_C3 * sp;
|
|
18
|
+
return den > 0 ? Math.pow(num / den, 1 / PQ_M1) : 0;
|
|
19
|
+
}
|
|
20
|
+
function pqOetf(linear) {
|
|
21
|
+
const lp = Math.pow(Math.max(0, linear), PQ_M1);
|
|
22
|
+
return Math.pow((PQ_C1 + PQ_C2 * lp) / (1 + PQ_C3 * lp), PQ_M2);
|
|
23
|
+
}
|
|
24
|
+
function hlgEotf(signal) {
|
|
25
|
+
const a = 0.17883277;
|
|
26
|
+
const b = 1 - 4 * a;
|
|
27
|
+
const c = 0.5 - a * Math.log(4 * a);
|
|
28
|
+
if (signal <= 0.5) {
|
|
29
|
+
return signal * signal / 3;
|
|
30
|
+
}
|
|
31
|
+
return (Math.exp((signal - c) / a) + b) / 12;
|
|
32
|
+
}
|
|
33
|
+
function hlgOetf(linear) {
|
|
34
|
+
const a = 0.17883277;
|
|
35
|
+
const b = 1 - 4 * a;
|
|
36
|
+
const c = 0.5 - a * Math.log(4 * a);
|
|
37
|
+
if (linear <= 1 / 12) {
|
|
38
|
+
return Math.sqrt(3 * linear);
|
|
39
|
+
}
|
|
40
|
+
return a * Math.log(12 * linear - b) + c;
|
|
41
|
+
}
|
|
42
|
+
function buildLut(fn) {
|
|
43
|
+
const lut = new Uint16Array(65536);
|
|
44
|
+
for (let i = 0; i < 65536; i++) {
|
|
45
|
+
lut[i] = Math.round(fn(i / 65535) * 65535);
|
|
46
|
+
}
|
|
47
|
+
return lut;
|
|
48
|
+
}
|
|
49
|
+
var pqToLinearLut = null;
|
|
50
|
+
var linearToPqLut = null;
|
|
51
|
+
var hlgToLinearLut = null;
|
|
52
|
+
var linearToHlgLut = null;
|
|
53
|
+
function getPqToLinearLut() {
|
|
54
|
+
if (!pqToLinearLut) pqToLinearLut = buildLut(pqEotf);
|
|
55
|
+
return pqToLinearLut;
|
|
56
|
+
}
|
|
57
|
+
function getLinearToPqLut() {
|
|
58
|
+
if (!linearToPqLut) linearToPqLut = buildLut(pqOetf);
|
|
59
|
+
return linearToPqLut;
|
|
60
|
+
}
|
|
61
|
+
function getHlgToLinearLut() {
|
|
62
|
+
if (!hlgToLinearLut) hlgToLinearLut = buildLut(hlgEotf);
|
|
63
|
+
return hlgToLinearLut;
|
|
64
|
+
}
|
|
65
|
+
function getLinearToHlgLut() {
|
|
66
|
+
if (!linearToHlgLut) linearToHlgLut = buildLut(hlgOetf);
|
|
67
|
+
return linearToHlgLut;
|
|
68
|
+
}
|
|
69
|
+
function hdrToLinear(buf, transfer) {
|
|
70
|
+
const lut = transfer === "pq" ? getPqToLinearLut() : getHlgToLinearLut();
|
|
71
|
+
const len = buf.length / 2;
|
|
72
|
+
for (let i = 0; i < len; i++) {
|
|
73
|
+
const off = i * 2;
|
|
74
|
+
buf.writeUInt16LE(lut[buf.readUInt16LE(off)] ?? 0, off);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function linearToHdr(buf, transfer) {
|
|
78
|
+
const lut = transfer === "pq" ? getLinearToPqLut() : getLinearToHlgLut();
|
|
79
|
+
const len = buf.length / 2;
|
|
80
|
+
for (let i = 0; i < len; i++) {
|
|
81
|
+
const off = i * 2;
|
|
82
|
+
buf.writeUInt16LE(lut[buf.readUInt16LE(off)] ?? 0, off);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
var HLG_OOTF_LW = 1e3;
|
|
86
|
+
var HLG_OOTF_GAMMA = 1.2 * Math.pow(1.111, Math.log2(HLG_OOTF_LW / 1e3));
|
|
87
|
+
function hlgSceneToPqDisplay(sceneLinear) {
|
|
88
|
+
const displayNits = HLG_OOTF_LW * Math.pow(Math.max(0, sceneLinear), HLG_OOTF_GAMMA);
|
|
89
|
+
return displayNits / 1e4;
|
|
90
|
+
}
|
|
91
|
+
function pqDisplayToHlgScene(displayNormalized) {
|
|
92
|
+
const displayNits = displayNormalized * 1e4;
|
|
93
|
+
return Math.pow(Math.max(0, displayNits / HLG_OOTF_LW), 1 / HLG_OOTF_GAMMA);
|
|
94
|
+
}
|
|
95
|
+
var hlgToPqLut = null;
|
|
96
|
+
var pqToHlgLut = null;
|
|
97
|
+
function getHlgToPqLut() {
|
|
98
|
+
if (!hlgToPqLut) hlgToPqLut = buildLut((v) => pqOetf(hlgSceneToPqDisplay(hlgEotf(v))));
|
|
99
|
+
return hlgToPqLut;
|
|
100
|
+
}
|
|
101
|
+
function getPqToHlgLut() {
|
|
102
|
+
if (!pqToHlgLut) pqToHlgLut = buildLut((v) => hlgOetf(pqDisplayToHlgScene(pqEotf(v))));
|
|
103
|
+
return pqToHlgLut;
|
|
104
|
+
}
|
|
105
|
+
function convertTransfer(buf, from, to) {
|
|
106
|
+
if (from === to) return;
|
|
107
|
+
const lut = from === "hlg" ? getHlgToPqLut() : getPqToHlgLut();
|
|
108
|
+
const len = buf.length / 2;
|
|
109
|
+
for (let i = 0; i < len; i++) {
|
|
110
|
+
const off = i * 2;
|
|
111
|
+
buf.writeUInt16LE(lut[buf.readUInt16LE(off)] ?? 0, off);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
function sampleRgb48le(buf, u, v, w, h) {
|
|
115
|
+
const uc = Math.max(0, Math.min(1, u));
|
|
116
|
+
const vc = Math.max(0, Math.min(1, v));
|
|
117
|
+
const sx = uc * (w - 1);
|
|
118
|
+
const sy = vc * (h - 1);
|
|
119
|
+
const x0 = Math.floor(sx);
|
|
120
|
+
const y0 = Math.floor(sy);
|
|
121
|
+
const x1 = Math.min(x0 + 1, w - 1);
|
|
122
|
+
const y1 = Math.min(y0 + 1, h - 1);
|
|
123
|
+
const fx = sx - x0;
|
|
124
|
+
const fy = sy - y0;
|
|
125
|
+
const w00 = (1 - fx) * (1 - fy);
|
|
126
|
+
const w10 = fx * (1 - fy);
|
|
127
|
+
const w01 = (1 - fx) * fy;
|
|
128
|
+
const w11 = fx * fy;
|
|
129
|
+
const off00 = (y0 * w + x0) * 6;
|
|
130
|
+
const off10 = (y0 * w + x1) * 6;
|
|
131
|
+
const off01 = (y1 * w + x0) * 6;
|
|
132
|
+
const off11 = (y1 * w + x1) * 6;
|
|
133
|
+
const r = Math.round(
|
|
134
|
+
buf.readUInt16LE(off00) * w00 + buf.readUInt16LE(off10) * w10 + buf.readUInt16LE(off01) * w01 + buf.readUInt16LE(off11) * w11
|
|
135
|
+
);
|
|
136
|
+
const g = Math.round(
|
|
137
|
+
buf.readUInt16LE(off00 + 2) * w00 + buf.readUInt16LE(off10 + 2) * w10 + buf.readUInt16LE(off01 + 2) * w01 + buf.readUInt16LE(off11 + 2) * w11
|
|
138
|
+
);
|
|
139
|
+
const b = Math.round(
|
|
140
|
+
buf.readUInt16LE(off00 + 4) * w00 + buf.readUInt16LE(off10 + 4) * w10 + buf.readUInt16LE(off01 + 4) * w01 + buf.readUInt16LE(off11 + 4) * w11
|
|
141
|
+
);
|
|
142
|
+
return [r, g, b];
|
|
143
|
+
}
|
|
144
|
+
function mix16(a, b, t) {
|
|
145
|
+
return Math.round(a * (1 - t) + b * t);
|
|
146
|
+
}
|
|
147
|
+
function clamp16(v) {
|
|
148
|
+
return Math.max(0, Math.min(65535, v));
|
|
149
|
+
}
|
|
150
|
+
function smoothstep(edge0, edge1, x) {
|
|
151
|
+
const t = Math.max(0, Math.min(1, (x - edge0) / (edge1 - edge0)));
|
|
152
|
+
return t * t * (3 - 2 * t);
|
|
153
|
+
}
|
|
154
|
+
function hash(x, y) {
|
|
155
|
+
return (Math.sin(x * 127.1 + y * 311.7) * 43758.5453 % 1 + 1) % 1;
|
|
156
|
+
}
|
|
157
|
+
function vnoise(px, py) {
|
|
158
|
+
const ix = Math.floor(px);
|
|
159
|
+
const iy = Math.floor(py);
|
|
160
|
+
let fx = px - ix;
|
|
161
|
+
let fy = py - iy;
|
|
162
|
+
fx = fx * fx * fx * (fx * (fx * 6 - 15) + 10);
|
|
163
|
+
fy = fy * fy * fy * (fy * (fy * 6 - 15) + 10);
|
|
164
|
+
const h00 = hash(ix, iy);
|
|
165
|
+
const h10 = hash(ix + 1, iy);
|
|
166
|
+
const h01 = hash(ix, iy + 1);
|
|
167
|
+
const h11 = hash(ix + 1, iy + 1);
|
|
168
|
+
return h00 * (1 - fx) * (1 - fy) + h10 * fx * (1 - fy) + h01 * (1 - fx) * fy + h11 * fx * fy;
|
|
169
|
+
}
|
|
170
|
+
var ROT_A = 0.8;
|
|
171
|
+
var ROT_B = 0.6;
|
|
172
|
+
function fbm(px, py) {
|
|
173
|
+
let value = 0;
|
|
174
|
+
let amplitude = 0.5;
|
|
175
|
+
let x = px;
|
|
176
|
+
let y = py;
|
|
177
|
+
for (let i = 0; i < 5; i++) {
|
|
178
|
+
value += amplitude * vnoise(x, y);
|
|
179
|
+
const nx = ROT_A * x - ROT_B * y;
|
|
180
|
+
const ny = ROT_B * x + ROT_A * y;
|
|
181
|
+
x = nx * 2.02;
|
|
182
|
+
y = ny * 2.02;
|
|
183
|
+
amplitude *= 0.5;
|
|
184
|
+
}
|
|
185
|
+
return value;
|
|
186
|
+
}
|
|
187
|
+
var TRANSITIONS = {};
|
|
188
|
+
var crossfade = (from, to, out, w, h, p) => {
|
|
189
|
+
const inv = 1 - p;
|
|
190
|
+
for (let i = 0; i < w * h; i++) {
|
|
191
|
+
const o = i * 6;
|
|
192
|
+
out.writeUInt16LE(Math.round(from.readUInt16LE(o) * inv + to.readUInt16LE(o) * p), o);
|
|
193
|
+
out.writeUInt16LE(
|
|
194
|
+
Math.round(from.readUInt16LE(o + 2) * inv + to.readUInt16LE(o + 2) * p),
|
|
195
|
+
o + 2
|
|
196
|
+
);
|
|
197
|
+
out.writeUInt16LE(
|
|
198
|
+
Math.round(from.readUInt16LE(o + 4) * inv + to.readUInt16LE(o + 4) * p),
|
|
199
|
+
o + 4
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
TRANSITIONS["crossfade"] = crossfade;
|
|
204
|
+
var flashThroughWhite = (from, to, out, w, h, p) => {
|
|
205
|
+
const toWhite = smoothstep(0, 0.45, p);
|
|
206
|
+
const fromWhite = 1 - smoothstep(0.5, 1, p);
|
|
207
|
+
const blend = smoothstep(0.35, 0.65, p);
|
|
208
|
+
for (let i = 0; i < w * h; i++) {
|
|
209
|
+
const o = i * 6;
|
|
210
|
+
const fromR = mix16(from.readUInt16LE(o), 65535, toWhite);
|
|
211
|
+
const fromG = mix16(from.readUInt16LE(o + 2), 65535, toWhite);
|
|
212
|
+
const fromB = mix16(from.readUInt16LE(o + 4), 65535, toWhite);
|
|
213
|
+
const toR = mix16(to.readUInt16LE(o), 65535, fromWhite);
|
|
214
|
+
const toG = mix16(to.readUInt16LE(o + 2), 65535, fromWhite);
|
|
215
|
+
const toB = mix16(to.readUInt16LE(o + 4), 65535, fromWhite);
|
|
216
|
+
out.writeUInt16LE(mix16(fromR, toR, blend), o);
|
|
217
|
+
out.writeUInt16LE(mix16(fromG, toG, blend), o + 2);
|
|
218
|
+
out.writeUInt16LE(mix16(fromB, toB, blend), o + 4);
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
TRANSITIONS["flash-through-white"] = flashThroughWhite;
|
|
222
|
+
var chromaticSplit = (from, to, out, w, h, p) => {
|
|
223
|
+
for (let i = 0; i < w * h; i++) {
|
|
224
|
+
const ux = i % w / w;
|
|
225
|
+
const uy = Math.floor(i / w) / h;
|
|
226
|
+
const o = i * 6;
|
|
227
|
+
const cx = ux - 0.5;
|
|
228
|
+
const cy = uy - 0.5;
|
|
229
|
+
const fromShift = p * 0.06;
|
|
230
|
+
const fr = sampleRgb48le(from, ux + cx * fromShift, uy + cy * fromShift, w, h)[0];
|
|
231
|
+
const fg = sampleRgb48le(from, ux, uy, w, h)[1];
|
|
232
|
+
const fb = sampleRgb48le(from, ux - cx * fromShift, uy - cy * fromShift, w, h)[2];
|
|
233
|
+
const toShift = (1 - p) * 0.06;
|
|
234
|
+
const tr = sampleRgb48le(to, ux - cx * toShift, uy - cy * toShift, w, h)[0];
|
|
235
|
+
const tg = sampleRgb48le(to, ux, uy, w, h)[1];
|
|
236
|
+
const tb = sampleRgb48le(to, ux + cx * toShift, uy + cy * toShift, w, h)[2];
|
|
237
|
+
out.writeUInt16LE(clamp16(mix16(fr, tr, p)), o);
|
|
238
|
+
out.writeUInt16LE(clamp16(mix16(fg, tg, p)), o + 2);
|
|
239
|
+
out.writeUInt16LE(clamp16(mix16(fb, tb, p)), o + 4);
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
TRANSITIONS["chromatic-split"] = chromaticSplit;
|
|
243
|
+
var sdfIris = (from, to, out, w, h, p) => {
|
|
244
|
+
const accentBright = [65535, 55e3, 35e3];
|
|
245
|
+
for (let i = 0; i < w * h; i++) {
|
|
246
|
+
const ux = i % w / w;
|
|
247
|
+
const uy = Math.floor(i / w) / h;
|
|
248
|
+
const o = i * 6;
|
|
249
|
+
const ax = (ux - 0.5) * (w / h);
|
|
250
|
+
const ay = uy - 0.5;
|
|
251
|
+
const d = Math.sqrt(ax * ax + ay * ay);
|
|
252
|
+
const radius = p * 1.2;
|
|
253
|
+
const fw = 3e-3;
|
|
254
|
+
const edge = smoothstep(radius + fw, radius - fw, d);
|
|
255
|
+
const ring1 = Math.exp(-Math.abs(d - radius) * 25);
|
|
256
|
+
const ring2 = Math.exp(-Math.abs(d - radius + 0.04) * 20) * 0.5;
|
|
257
|
+
const ring3 = Math.exp(-Math.abs(d - radius + 0.08) * 15) * 0.25;
|
|
258
|
+
const glow = (ring1 + ring2 + ring3) * p * (1 - p) * 4;
|
|
259
|
+
const [fromR, fromG, fromB] = sampleRgb48le(from, ux, uy, w, h);
|
|
260
|
+
const [toR, toG, toB] = sampleRgb48le(to, ux, uy, w, h);
|
|
261
|
+
out.writeUInt16LE(clamp16(mix16(fromR, toR, edge) + accentBright[0] * glow * 0.6), o);
|
|
262
|
+
out.writeUInt16LE(clamp16(mix16(fromG, toG, edge) + accentBright[1] * glow * 0.6), o + 2);
|
|
263
|
+
out.writeUInt16LE(clamp16(mix16(fromB, toB, edge) + accentBright[2] * glow * 0.6), o + 4);
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
TRANSITIONS["sdf-iris"] = sdfIris;
|
|
267
|
+
function glitchRand(x, y) {
|
|
268
|
+
return (Math.sin(x * 12.9898 + y * 78.233) * 43758.5453 % 1 + 1) % 1;
|
|
269
|
+
}
|
|
270
|
+
var glitch = (from, to, out, w, h, p) => {
|
|
271
|
+
const intensity = p * (1 - p) * 4;
|
|
272
|
+
for (let i = 0; i < w * h; i++) {
|
|
273
|
+
const ux = i % w / w;
|
|
274
|
+
const uy = Math.floor(i / w) / h;
|
|
275
|
+
const o = i * 6;
|
|
276
|
+
const lineY = Math.floor(uy * 60) / 60;
|
|
277
|
+
const lineDisp = (glitchRand(lineY, Math.floor(p * 17)) - 0.5) * 0.18 * intensity;
|
|
278
|
+
const blockX = Math.floor(ux * 12);
|
|
279
|
+
const blockY = Math.floor(uy * 8);
|
|
280
|
+
const progressStep = Math.floor(p * 11);
|
|
281
|
+
const br = glitchRand(blockX + progressStep, blockY + progressStep);
|
|
282
|
+
const ba = (br >= 0.83 ? 1 : 0) * intensity;
|
|
283
|
+
const bdx = (glitchRand(blockX * 2.1, blockY * 2.1) - 0.5) * 0.35 * ba;
|
|
284
|
+
const bdy = (glitchRand(blockX * 3.7, blockY * 3.7) - 0.5) * 0.35 * ba;
|
|
285
|
+
const uvx = Math.max(0, Math.min(1, ux + lineDisp + bdx));
|
|
286
|
+
const uvy = Math.max(0, Math.min(1, uy + bdy));
|
|
287
|
+
const shift = intensity * 0.035;
|
|
288
|
+
const r = sampleRgb48le(from, uvx + shift, uvy, w, h)[0];
|
|
289
|
+
const g = sampleRgb48le(from, uvx, uvy, w, h)[1];
|
|
290
|
+
const b = sampleRgb48le(from, uvx - shift, uvy, w, h)[2];
|
|
291
|
+
let cr = r / 65535;
|
|
292
|
+
let cg = g / 65535;
|
|
293
|
+
let cb = b / 65535;
|
|
294
|
+
const scanline = (uy * h * 0.5 % 1 + 1) % 1 >= 0.5 ? 0.05 * intensity : 0;
|
|
295
|
+
cr -= scanline;
|
|
296
|
+
cg -= scanline;
|
|
297
|
+
cb -= scanline;
|
|
298
|
+
const flicker = 1 + (glitchRand(Math.floor(p * 23), 0) - 0.5) * 0.3 * intensity;
|
|
299
|
+
cr *= flicker;
|
|
300
|
+
cg *= flicker;
|
|
301
|
+
cb *= flicker;
|
|
302
|
+
const levels = 256 - (256 - 8) * (intensity * 0.5);
|
|
303
|
+
cr = Math.floor(cr * levels) / levels;
|
|
304
|
+
cg = Math.floor(cg * levels) / levels;
|
|
305
|
+
cb = Math.floor(cb * levels) / levels;
|
|
306
|
+
const [toR, toG, toB] = sampleRgb48le(to, ux, uy, w, h);
|
|
307
|
+
out.writeUInt16LE(clamp16(mix16(Math.round(cr * 65535), toR, p)), o);
|
|
308
|
+
out.writeUInt16LE(clamp16(mix16(Math.round(cg * 65535), toG, p)), o + 2);
|
|
309
|
+
out.writeUInt16LE(clamp16(mix16(Math.round(cb * 65535), toB, p)), o + 4);
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
TRANSITIONS["glitch"] = glitch;
|
|
313
|
+
function aces(x) {
|
|
314
|
+
return Math.max(0, Math.min(1, x * (2.51 * x + 0.03) / (x * (2.43 * x + 0.59) + 0.14)));
|
|
315
|
+
}
|
|
316
|
+
var lightLeak = (from, to, out, w, h, p) => {
|
|
317
|
+
const accent = [5e4 / 65535, 25e3 / 65535, 5e3 / 65535];
|
|
318
|
+
const accentBright = [65535 / 65535, 55e3 / 65535, 35e3 / 65535];
|
|
319
|
+
const lpx = 1.3;
|
|
320
|
+
const lpy = -0.2;
|
|
321
|
+
for (let i = 0; i < w * h; i++) {
|
|
322
|
+
const ux = i % w / w;
|
|
323
|
+
const uy = Math.floor(i / w) / h;
|
|
324
|
+
const o = i * 6;
|
|
325
|
+
const dx = ux - lpx;
|
|
326
|
+
const dy = uy - lpy;
|
|
327
|
+
const dist = Math.sqrt(dx * dx + dy * dy);
|
|
328
|
+
const leak = Math.max(0, Math.min(1, Math.exp(-dist * 1.8) * p * 4));
|
|
329
|
+
const warmR = accent[0] + (accentBright[0] - accent[0]) * dist * 0.7;
|
|
330
|
+
const warmG = accent[1] + (accentBright[1] - accent[1]) * dist * 0.7;
|
|
331
|
+
const warmB = accent[2] + (accentBright[2] - accent[2]) * dist * 0.7;
|
|
332
|
+
const flare = Math.exp(-Math.abs(uy - (-0.2 + ux * 0.3)) * 15) * leak * 0.3;
|
|
333
|
+
const [fr, fg, fb] = sampleRgb48le(from, ux, uy, w, h);
|
|
334
|
+
const fromR = fr / 65535;
|
|
335
|
+
const fromG = fg / 65535;
|
|
336
|
+
const fromB = fb / 65535;
|
|
337
|
+
const overR = aces(fromR + warmR * leak * 3 + accentBright[0] * flare);
|
|
338
|
+
const overG = aces(fromG + warmG * leak * 3 + accentBright[1] * flare);
|
|
339
|
+
const overB = aces(fromB + warmB * leak * 3 + accentBright[2] * flare);
|
|
340
|
+
const [toR, toG, toB] = sampleRgb48le(to, ux, uy, w, h);
|
|
341
|
+
const blend = smoothstep(0.15, 0.85, p);
|
|
342
|
+
out.writeUInt16LE(clamp16(mix16(Math.round(overR * 65535), toR, blend)), o);
|
|
343
|
+
out.writeUInt16LE(clamp16(mix16(Math.round(overG * 65535), toG, blend)), o + 2);
|
|
344
|
+
out.writeUInt16LE(clamp16(mix16(Math.round(overB * 65535), toB, blend)), o + 4);
|
|
345
|
+
}
|
|
346
|
+
};
|
|
347
|
+
TRANSITIONS["light-leak"] = lightLeak;
|
|
348
|
+
var crossWarpMorph = (from, to, out, w, h, p) => {
|
|
349
|
+
for (let i = 0; i < w * h; i++) {
|
|
350
|
+
const ux = i % w / w;
|
|
351
|
+
const uy = Math.floor(i / w) / h;
|
|
352
|
+
const o = i * 6;
|
|
353
|
+
const dispX = fbm(ux * 3, uy * 3) - 0.5;
|
|
354
|
+
const dispY = fbm(ux * 3 + 7.3, uy * 3 + 3.7) - 0.5;
|
|
355
|
+
const fromUx = Math.max(0, Math.min(1, ux + dispX * p * 0.5));
|
|
356
|
+
const fromUy = Math.max(0, Math.min(1, uy + dispY * p * 0.5));
|
|
357
|
+
const toUx = Math.max(0, Math.min(1, ux - dispX * (1 - p) * 0.5));
|
|
358
|
+
const toUy = Math.max(0, Math.min(1, uy - dispY * (1 - p) * 0.5));
|
|
359
|
+
const [fromR, fromG, fromB] = sampleRgb48le(from, fromUx, fromUy, w, h);
|
|
360
|
+
const [toR, toG, toB] = sampleRgb48le(to, toUx, toUy, w, h);
|
|
361
|
+
const n = fbm(ux * 4 + 3.1, uy * 4 + 1.7);
|
|
362
|
+
const blend = smoothstep(0.4, 0.6, n + p * 1.2 - 0.6);
|
|
363
|
+
out.writeUInt16LE(clamp16(mix16(fromR, toR, blend)), o);
|
|
364
|
+
out.writeUInt16LE(clamp16(mix16(fromG, toG, blend)), o + 2);
|
|
365
|
+
out.writeUInt16LE(clamp16(mix16(fromB, toB, blend)), o + 4);
|
|
366
|
+
}
|
|
367
|
+
};
|
|
368
|
+
TRANSITIONS["cross-warp-morph"] = crossWarpMorph;
|
|
369
|
+
var whipPan = (from, to, out, w, h, p) => {
|
|
370
|
+
const fromOff = p * 1.5;
|
|
371
|
+
const toOff = (1 - p) * 1.5;
|
|
372
|
+
for (let i = 0; i < w * h; i++) {
|
|
373
|
+
const ux = i % w / w;
|
|
374
|
+
const uy = Math.floor(i / w) / h;
|
|
375
|
+
const o = i * 6;
|
|
376
|
+
let fromR = 0, fromG = 0, fromB = 0;
|
|
377
|
+
for (let s = 0; s < 10; s++) {
|
|
378
|
+
const f = s / 10;
|
|
379
|
+
const fuv = Math.max(0, Math.min(1, ux + fromOff + p * 0.08 * f));
|
|
380
|
+
const [r, g, b] = sampleRgb48le(from, fuv, uy, w, h);
|
|
381
|
+
fromR += r;
|
|
382
|
+
fromG += g;
|
|
383
|
+
fromB += b;
|
|
384
|
+
}
|
|
385
|
+
fromR /= 10;
|
|
386
|
+
fromG /= 10;
|
|
387
|
+
fromB /= 10;
|
|
388
|
+
let toR = 0, toG = 0, toB = 0;
|
|
389
|
+
for (let s = 0; s < 10; s++) {
|
|
390
|
+
const f = s / 10;
|
|
391
|
+
const tuv = Math.max(0, Math.min(1, ux - toOff - (1 - p) * 0.08 * f));
|
|
392
|
+
const [r, g, b] = sampleRgb48le(to, tuv, uy, w, h);
|
|
393
|
+
toR += r;
|
|
394
|
+
toG += g;
|
|
395
|
+
toB += b;
|
|
396
|
+
}
|
|
397
|
+
toR /= 10;
|
|
398
|
+
toG /= 10;
|
|
399
|
+
toB /= 10;
|
|
400
|
+
out.writeUInt16LE(clamp16(mix16(Math.round(fromR), Math.round(toR), p)), o);
|
|
401
|
+
out.writeUInt16LE(clamp16(mix16(Math.round(fromG), Math.round(toG), p)), o + 2);
|
|
402
|
+
out.writeUInt16LE(clamp16(mix16(Math.round(fromB), Math.round(toB), p)), o + 4);
|
|
403
|
+
}
|
|
404
|
+
};
|
|
405
|
+
TRANSITIONS["whip-pan"] = whipPan;
|
|
406
|
+
var cinematicZoom = (from, to, out, w, h, p) => {
|
|
407
|
+
const fromS = p * 0.08;
|
|
408
|
+
const toS = (1 - p) * 0.06;
|
|
409
|
+
for (let i = 0; i < w * h; i++) {
|
|
410
|
+
const ux = i % w / w;
|
|
411
|
+
const uy = Math.floor(i / w) / h;
|
|
412
|
+
const o = i * 6;
|
|
413
|
+
const dx = ux - 0.5;
|
|
414
|
+
const dy = uy - 0.5;
|
|
415
|
+
let fr = 0, fg = 0, fb = 0;
|
|
416
|
+
for (let s = 0; s < 12; s++) {
|
|
417
|
+
const f = s / 12;
|
|
418
|
+
const rr = sampleRgb48le(
|
|
419
|
+
from,
|
|
420
|
+
ux - dx * fromS * 1.06 * f,
|
|
421
|
+
uy - dy * fromS * 1.06 * f,
|
|
422
|
+
w,
|
|
423
|
+
h
|
|
424
|
+
)[0];
|
|
425
|
+
const gg = sampleRgb48le(from, ux - dx * fromS * f, uy - dy * fromS * f, w, h)[1];
|
|
426
|
+
const bb = sampleRgb48le(
|
|
427
|
+
from,
|
|
428
|
+
ux - dx * fromS * 0.94 * f,
|
|
429
|
+
uy - dy * fromS * 0.94 * f,
|
|
430
|
+
w,
|
|
431
|
+
h
|
|
432
|
+
)[2];
|
|
433
|
+
fr += rr;
|
|
434
|
+
fg += gg;
|
|
435
|
+
fb += bb;
|
|
436
|
+
}
|
|
437
|
+
fr /= 12;
|
|
438
|
+
fg /= 12;
|
|
439
|
+
fb /= 12;
|
|
440
|
+
let tr = 0, tg = 0, tb = 0;
|
|
441
|
+
for (let s = 0; s < 12; s++) {
|
|
442
|
+
const f = s / 12;
|
|
443
|
+
const rr = sampleRgb48le(to, ux + dx * toS * 1.06 * f, uy + dy * toS * 1.06 * f, w, h)[0];
|
|
444
|
+
const gg = sampleRgb48le(to, ux + dx * toS * f, uy + dy * toS * f, w, h)[1];
|
|
445
|
+
const bb = sampleRgb48le(to, ux + dx * toS * 0.94 * f, uy + dy * toS * 0.94 * f, w, h)[2];
|
|
446
|
+
tr += rr;
|
|
447
|
+
tg += gg;
|
|
448
|
+
tb += bb;
|
|
449
|
+
}
|
|
450
|
+
tr /= 12;
|
|
451
|
+
tg /= 12;
|
|
452
|
+
tb /= 12;
|
|
453
|
+
out.writeUInt16LE(clamp16(mix16(Math.round(fr), Math.round(tr), p)), o);
|
|
454
|
+
out.writeUInt16LE(clamp16(mix16(Math.round(fg), Math.round(tg), p)), o + 2);
|
|
455
|
+
out.writeUInt16LE(clamp16(mix16(Math.round(fb), Math.round(tb), p)), o + 4);
|
|
456
|
+
}
|
|
457
|
+
};
|
|
458
|
+
TRANSITIONS["cinematic-zoom"] = cinematicZoom;
|
|
459
|
+
var gravitationalLens = (from, to, out, w, h, p) => {
|
|
460
|
+
for (let i = 0; i < w * h; i++) {
|
|
461
|
+
const ux = i % w / w;
|
|
462
|
+
const uy = Math.floor(i / w) / h;
|
|
463
|
+
const o = i * 6;
|
|
464
|
+
const uvx = ux - 0.5;
|
|
465
|
+
const uvy = uy - 0.5;
|
|
466
|
+
const dist = Math.sqrt(uvx * uvx + uvy * uvy);
|
|
467
|
+
const pull = p * 2;
|
|
468
|
+
const warpStr = pull * 0.3 / (dist + 0.1);
|
|
469
|
+
const warpedX = Math.max(0, Math.min(1, ux - uvx * warpStr));
|
|
470
|
+
const warpedY = Math.max(0, Math.min(1, uy - uvy * warpStr));
|
|
471
|
+
const [, ag] = sampleRgb48le(from, warpedX, warpedY, w, h);
|
|
472
|
+
const horizon = smoothstep(0, 0.3, dist / (1 - p * 0.85 + 1e-3));
|
|
473
|
+
const shift = pull * 0.02 / (dist + 0.2);
|
|
474
|
+
const rSampX = Math.max(0, Math.min(1, ux - uvx * (warpStr + shift)));
|
|
475
|
+
const rSampY = Math.max(0, Math.min(1, uy - uvy * (warpStr + shift)));
|
|
476
|
+
const bSampX = Math.max(0, Math.min(1, ux - uvx * (warpStr - shift)));
|
|
477
|
+
const bSampY = Math.max(0, Math.min(1, uy - uvy * (warpStr - shift)));
|
|
478
|
+
const ar = sampleRgb48le(from, rSampX, rSampY, w, h)[0];
|
|
479
|
+
const ab = sampleRgb48le(from, bSampX, bSampY, w, h)[2];
|
|
480
|
+
const lensedR = Math.round(ar * horizon);
|
|
481
|
+
const lensedG = Math.round(ag * horizon);
|
|
482
|
+
const lensedB = Math.round(ab * horizon);
|
|
483
|
+
const [toR, toG, toB] = sampleRgb48le(to, ux, uy, w, h);
|
|
484
|
+
const blend = smoothstep(0.3, 0.9, p);
|
|
485
|
+
out.writeUInt16LE(clamp16(mix16(lensedR, toR, blend)), o);
|
|
486
|
+
out.writeUInt16LE(clamp16(mix16(lensedG, toG, blend)), o + 2);
|
|
487
|
+
out.writeUInt16LE(clamp16(mix16(lensedB, toB, blend)), o + 4);
|
|
488
|
+
}
|
|
489
|
+
};
|
|
490
|
+
TRANSITIONS["gravitational-lens"] = gravitationalLens;
|
|
491
|
+
var rippleWaves = (from, to, out, w, h, p) => {
|
|
492
|
+
const accentBright = [65535, 55e3, 35e3];
|
|
493
|
+
for (let i = 0; i < w * h; i++) {
|
|
494
|
+
const ux = i % w / w;
|
|
495
|
+
const uy = Math.floor(i / w) / h;
|
|
496
|
+
const o = i * 6;
|
|
497
|
+
const uvx = ux - 0.5;
|
|
498
|
+
const uvy = uy - 0.5;
|
|
499
|
+
const dist = Math.sqrt(uvx * uvx + uvy * uvy);
|
|
500
|
+
const nux = uvx + 1e-3;
|
|
501
|
+
const nuy = uvy + 1e-3;
|
|
502
|
+
const nlen = Math.sqrt(nux * nux + nuy * nuy);
|
|
503
|
+
const dirx = nux / nlen;
|
|
504
|
+
const diry = nuy / nlen;
|
|
505
|
+
const fromAmp = p * 0.04;
|
|
506
|
+
const fw1 = Math.exp(Math.sin(dist * 25 - p * 12) - 1);
|
|
507
|
+
const fw2 = Math.exp(Math.sin(dist * 50 - p * 18) - 1) * 0.5;
|
|
508
|
+
const fromUx = Math.max(0, Math.min(1, ux + dirx * (fw1 + fw2) * fromAmp));
|
|
509
|
+
const fromUy = Math.max(0, Math.min(1, uy + diry * (fw1 + fw2) * fromAmp));
|
|
510
|
+
const toAmp = (1 - p) * 0.04;
|
|
511
|
+
const tw1 = Math.exp(Math.sin(dist * 25 + p * 12) - 1);
|
|
512
|
+
const tw2 = Math.exp(Math.sin(dist * 50 + p * 18) - 1) * 0.5;
|
|
513
|
+
const toUx = Math.max(0, Math.min(1, ux - dirx * (tw1 + tw2) * toAmp));
|
|
514
|
+
const toUy = Math.max(0, Math.min(1, uy - diry * (tw1 + tw2) * toAmp));
|
|
515
|
+
const [fromR, fromG, fromB] = sampleRgb48le(from, fromUx, fromUy, w, h);
|
|
516
|
+
const [toR, toG, toB] = sampleRgb48le(to, toUx, toUy, w, h);
|
|
517
|
+
const peak = fw1 * p;
|
|
518
|
+
const tintR = accentBright[0] * peak * 0.1;
|
|
519
|
+
const tintG = accentBright[1] * peak * 0.1;
|
|
520
|
+
const tintB = accentBright[2] * peak * 0.1;
|
|
521
|
+
out.writeUInt16LE(clamp16(mix16(Math.round(fromR + tintR), toR, p)), o);
|
|
522
|
+
out.writeUInt16LE(clamp16(mix16(Math.round(fromG + tintG), toG, p)), o + 2);
|
|
523
|
+
out.writeUInt16LE(clamp16(mix16(Math.round(fromB + tintB), toB, p)), o + 4);
|
|
524
|
+
}
|
|
525
|
+
};
|
|
526
|
+
TRANSITIONS["ripple-waves"] = rippleWaves;
|
|
527
|
+
var swirlVortex = (from, to, out, w, h, p) => {
|
|
528
|
+
for (let i = 0; i < w * h; i++) {
|
|
529
|
+
const ux = i % w / w;
|
|
530
|
+
const uy = Math.floor(i / w) / h;
|
|
531
|
+
const o = i * 6;
|
|
532
|
+
const uvx = ux - 0.5;
|
|
533
|
+
const uvy = uy - 0.5;
|
|
534
|
+
const dist = Math.sqrt(uvx * uvx + uvy * uvy);
|
|
535
|
+
const warp = fbm(ux * 4, uy * 4) * 0.5;
|
|
536
|
+
const fromAng = p * (1 - dist) * 10 + warp * p * 3;
|
|
537
|
+
const fs = Math.sin(fromAng);
|
|
538
|
+
const fc = Math.cos(fromAng);
|
|
539
|
+
const fromUx = Math.max(0, Math.min(1, uvx * fc - uvy * fs + 0.5));
|
|
540
|
+
const fromUy = Math.max(0, Math.min(1, uvx * fs + uvy * fc + 0.5));
|
|
541
|
+
const toAng = -(1 - p) * (1 - dist) * 10 - warp * (1 - p) * 3;
|
|
542
|
+
const ts = Math.sin(toAng);
|
|
543
|
+
const tc = Math.cos(toAng);
|
|
544
|
+
const toUx = Math.max(0, Math.min(1, uvx * tc - uvy * ts + 0.5));
|
|
545
|
+
const toUy = Math.max(0, Math.min(1, uvx * ts + uvy * tc + 0.5));
|
|
546
|
+
const [fromR, fromG, fromB] = sampleRgb48le(from, fromUx, fromUy, w, h);
|
|
547
|
+
const [toR, toG, toB] = sampleRgb48le(to, toUx, toUy, w, h);
|
|
548
|
+
out.writeUInt16LE(clamp16(mix16(fromR, toR, p)), o);
|
|
549
|
+
out.writeUInt16LE(clamp16(mix16(fromG, toG, p)), o + 2);
|
|
550
|
+
out.writeUInt16LE(clamp16(mix16(fromB, toB, p)), o + 4);
|
|
551
|
+
}
|
|
552
|
+
};
|
|
553
|
+
TRANSITIONS["swirl-vortex"] = swirlVortex;
|
|
554
|
+
var thermalDistortion = (from, to, out, w, h, p) => {
|
|
555
|
+
const accentBright = [65535, 55e3, 35e3];
|
|
556
|
+
for (let i = 0; i < w * h; i++) {
|
|
557
|
+
const ux = i % w / w;
|
|
558
|
+
const uy = Math.floor(i / w) / h;
|
|
559
|
+
const o = i * 6;
|
|
560
|
+
const heat = p * 1.5;
|
|
561
|
+
const yFade = smoothstep(1, 0, uy);
|
|
562
|
+
const shimmer = Math.sin(uy * 40 + fbm(ux * 6, uy * 6) * 8) * fbm(ux * 3 + 0, uy * 3 + p * 2);
|
|
563
|
+
const dispX = shimmer * heat * 0.03 * yFade;
|
|
564
|
+
const fromUx = Math.max(0, Math.min(1, ux + dispX));
|
|
565
|
+
const [fromR, fromG, fromB] = sampleRgb48le(from, fromUx, uy, w, h);
|
|
566
|
+
const invShimmer = Math.sin(uy * 40 + fbm(ux * 6 + 3, uy * 6 + 3) * 8) * fbm(ux * 3 + 3, uy * 3 + p * 2);
|
|
567
|
+
const dispX2 = invShimmer * (1 - p) * 0.03 * yFade;
|
|
568
|
+
const toUx = Math.max(0, Math.min(1, ux + dispX2));
|
|
569
|
+
const [toR, toG, toB] = sampleRgb48le(to, toUx, uy, w, h);
|
|
570
|
+
const haze = heat * yFade * 0.15 * (1 - p);
|
|
571
|
+
out.writeUInt16LE(clamp16(mix16(fromR, toR, p) + Math.round(accentBright[0] * haze)), o);
|
|
572
|
+
out.writeUInt16LE(clamp16(mix16(fromG, toG, p) + Math.round(accentBright[1] * haze)), o + 2);
|
|
573
|
+
out.writeUInt16LE(clamp16(mix16(fromB, toB, p) + Math.round(accentBright[2] * haze)), o + 4);
|
|
574
|
+
}
|
|
575
|
+
};
|
|
576
|
+
TRANSITIONS["thermal-distortion"] = thermalDistortion;
|
|
577
|
+
var domainWarp = (from, to, out, w, h, p) => {
|
|
578
|
+
const accentDark = [25e3, 8e3, 2e3];
|
|
579
|
+
const accentBright = [65535, 55e3, 35e3];
|
|
580
|
+
for (let i = 0; i < w * h; i++) {
|
|
581
|
+
const ux = i % w / w;
|
|
582
|
+
const uy = Math.floor(i / w) / h;
|
|
583
|
+
const o = i * 6;
|
|
584
|
+
const qx = fbm(ux * 3, uy * 3);
|
|
585
|
+
const qy = fbm(ux * 3 + 5.2, uy * 3 + 1.3);
|
|
586
|
+
const rx = fbm(ux * 3 + qx * 4 + 1.7, uy * 3 + qy * 4 + 9.2);
|
|
587
|
+
const ry = fbm(ux * 3 + qx * 4 + 8.3, uy * 3 + qy * 4 + 2.8);
|
|
588
|
+
const n = fbm(ux * 3 + rx * 2, uy * 3 + ry * 2);
|
|
589
|
+
const warpDirX = (qx - 0.5) * 0.4;
|
|
590
|
+
const warpDirY = (qy - 0.5) * 0.4;
|
|
591
|
+
const aUx = Math.max(0, Math.min(1, ux + warpDirX * p));
|
|
592
|
+
const aUy = Math.max(0, Math.min(1, uy + warpDirY * p));
|
|
593
|
+
const bUx = Math.max(0, Math.min(1, ux - warpDirX * (1 - p)));
|
|
594
|
+
const bUy = Math.max(0, Math.min(1, uy - warpDirY * (1 - p)));
|
|
595
|
+
const [aR, aG, aB] = sampleRgb48le(from, aUx, aUy, w, h);
|
|
596
|
+
const [bR, bG, bB] = sampleRgb48le(to, bUx, bUy, w, h);
|
|
597
|
+
const e = smoothstep(p - 0.08, p + 0.08, n);
|
|
598
|
+
const ed = Math.abs(n - p);
|
|
599
|
+
const pStep = p >= 1 ? 1 : 0;
|
|
600
|
+
const em = smoothstep(0.1, 0, ed) * (1 - pStep);
|
|
601
|
+
const ecBlend = smoothstep(0, 0.1, ed);
|
|
602
|
+
const ecR = accentDark[0] + (accentBright[0] - accentDark[0]) * (1 - ecBlend);
|
|
603
|
+
const ecG = accentDark[1] + (accentBright[1] - accentDark[1]) * (1 - ecBlend);
|
|
604
|
+
const ecB = accentDark[2] + (accentBright[2] - accentDark[2]) * (1 - ecBlend);
|
|
605
|
+
out.writeUInt16LE(clamp16(mix16(bR, aR, e) + Math.round(ecR * em * 2)), o);
|
|
606
|
+
out.writeUInt16LE(clamp16(mix16(bG, aG, e) + Math.round(ecG * em * 2)), o + 2);
|
|
607
|
+
out.writeUInt16LE(clamp16(mix16(bB, aB, e) + Math.round(ecB * em * 2)), o + 4);
|
|
608
|
+
}
|
|
609
|
+
};
|
|
610
|
+
TRANSITIONS["domain-warp"] = domainWarp;
|
|
611
|
+
function ridged(px, py) {
|
|
612
|
+
let value = 0;
|
|
613
|
+
let amplitude = 0.5;
|
|
614
|
+
let x = px;
|
|
615
|
+
let y = py;
|
|
616
|
+
for (let i = 0; i < 5; i++) {
|
|
617
|
+
value += amplitude * Math.abs(vnoise(x, y) * 2 - 1);
|
|
618
|
+
const nx = ROT_A * x - ROT_B * y;
|
|
619
|
+
const ny = ROT_B * x + ROT_A * y;
|
|
620
|
+
x = nx * 2.02;
|
|
621
|
+
y = ny * 2.02;
|
|
622
|
+
amplitude *= 0.5;
|
|
623
|
+
}
|
|
624
|
+
return value;
|
|
625
|
+
}
|
|
626
|
+
var ridgedBurn = (from, to, out, w, h, p) => {
|
|
627
|
+
const accent = [5e4, 25e3, 5e3];
|
|
628
|
+
const accentDark = [25e3, 8e3, 2e3];
|
|
629
|
+
const accentBright = [65535, 55e3, 35e3];
|
|
630
|
+
for (let i = 0; i < w * h; i++) {
|
|
631
|
+
const ux = i % w / w;
|
|
632
|
+
const uy = Math.floor(i / w) / h;
|
|
633
|
+
const o = i * 6;
|
|
634
|
+
const [aR, aG, aB] = sampleRgb48le(from, ux, uy, w, h);
|
|
635
|
+
const [bR, bG, bB] = sampleRgb48le(to, ux, uy, w, h);
|
|
636
|
+
const n = ridged(ux * 4, uy * 4);
|
|
637
|
+
const e = smoothstep(p - 0.04, p + 0.04, n);
|
|
638
|
+
const heat = smoothstep(0.12, 0, Math.abs(n - p));
|
|
639
|
+
const pStep = p >= 1 ? 1 : 0;
|
|
640
|
+
const heatMasked = heat * (1 - pStep);
|
|
641
|
+
let burnR = accentDark[0] + (accent[0] - accentDark[0]) * smoothstep(0, 0.25, heatMasked);
|
|
642
|
+
let burnG = accentDark[1] + (accent[1] - accentDark[1]) * smoothstep(0, 0.25, heatMasked);
|
|
643
|
+
let burnB = accentDark[2] + (accent[2] - accentDark[2]) * smoothstep(0, 0.25, heatMasked);
|
|
644
|
+
const blend2 = smoothstep(0.25, 0.5, heatMasked);
|
|
645
|
+
burnR = burnR + (accentBright[0] - burnR) * blend2;
|
|
646
|
+
burnG = burnG + (accentBright[1] - burnG) * blend2;
|
|
647
|
+
burnB = burnB + (accentBright[2] - burnB) * blend2;
|
|
648
|
+
const blend3 = smoothstep(0.5, 1, heatMasked);
|
|
649
|
+
burnR = burnR + (65535 - burnR) * blend3;
|
|
650
|
+
burnG = burnG + (65535 - burnG) * blend3;
|
|
651
|
+
burnB = burnB + (65535 - burnB) * blend3;
|
|
652
|
+
const sparks = (vnoise(ux * 80, uy * 80) >= 0.92 ? 1 : 0) * heatMasked * 3;
|
|
653
|
+
out.writeUInt16LE(
|
|
654
|
+
clamp16(
|
|
655
|
+
mix16(bR, aR, e) + Math.round(burnR * heatMasked * 3.5) + Math.round(accentBright[0] * sparks)
|
|
656
|
+
),
|
|
657
|
+
o
|
|
658
|
+
);
|
|
659
|
+
out.writeUInt16LE(
|
|
660
|
+
clamp16(
|
|
661
|
+
mix16(bG, aG, e) + Math.round(burnG * heatMasked * 3.5) + Math.round(accentBright[1] * sparks)
|
|
662
|
+
),
|
|
663
|
+
o + 2
|
|
664
|
+
);
|
|
665
|
+
out.writeUInt16LE(
|
|
666
|
+
clamp16(
|
|
667
|
+
mix16(bB, aB, e) + Math.round(burnB * heatMasked * 3.5) + Math.round(accentBright[2] * sparks)
|
|
668
|
+
),
|
|
669
|
+
o + 4
|
|
670
|
+
);
|
|
671
|
+
}
|
|
672
|
+
};
|
|
673
|
+
TRANSITIONS["ridged-burn"] = ridgedBurn;
|
|
674
|
+
|
|
675
|
+
export {
|
|
676
|
+
hdrToLinear,
|
|
677
|
+
linearToHdr,
|
|
678
|
+
convertTransfer,
|
|
679
|
+
sampleRgb48le,
|
|
680
|
+
TRANSITIONS,
|
|
681
|
+
crossfade
|
|
682
|
+
};
|