@oh-my-pi/pi-coding-agent 8.0.20 → 8.2.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/CHANGELOG.md +125 -0
- package/docs/session.md +111 -46
- package/examples/custom-tools/hello/index.ts +1 -1
- package/examples/custom-tools/todo/index.ts +3 -4
- package/examples/extensions/api-demo.ts +0 -1
- package/examples/extensions/chalk-logger.ts +2 -3
- package/examples/extensions/hello.ts +0 -1
- package/examples/extensions/pirate.ts +0 -1
- package/examples/extensions/plan-mode.ts +15 -16
- package/examples/extensions/todo.ts +3 -4
- package/examples/extensions/tools.ts +1 -2
- package/examples/extensions/with-deps/index.ts +0 -1
- package/examples/hooks/auto-commit-on-exit.ts +1 -2
- package/examples/hooks/confirm-destructive.ts +0 -1
- package/examples/hooks/custom-compaction.ts +1 -2
- package/examples/hooks/dirty-repo-guard.ts +0 -1
- package/examples/hooks/file-trigger.ts +3 -4
- package/examples/hooks/git-checkpoint.ts +0 -1
- package/examples/hooks/handoff.ts +3 -4
- package/examples/hooks/permission-gate.ts +1 -2
- package/examples/hooks/protected-paths.ts +1 -2
- package/examples/hooks/qna.ts +2 -3
- package/examples/hooks/snake.ts +4 -5
- package/examples/hooks/status-line.ts +0 -1
- package/examples/sdk/01-minimal.ts +2 -3
- package/examples/sdk/02-custom-model.ts +2 -3
- package/examples/sdk/03-custom-prompt.ts +3 -4
- package/examples/sdk/04-skills.ts +2 -3
- package/examples/sdk/06-extensions.ts +1 -2
- package/examples/sdk/06-hooks.ts +6 -7
- package/examples/sdk/07-context-files.ts +0 -1
- package/examples/sdk/08-prompt-templates.ts +0 -1
- package/examples/sdk/08-slash-commands.ts +0 -1
- package/examples/sdk/09-api-keys-and-oauth.ts +0 -1
- package/examples/sdk/10-settings.ts +0 -1
- package/examples/sdk/11-sessions.ts +0 -1
- package/package.json +54 -23
- package/scripts/format-prompts.ts +0 -1
- package/src/capability/context-file.ts +3 -4
- package/src/capability/extension-module.ts +3 -4
- package/src/capability/extension.ts +3 -4
- package/src/capability/fs.ts +20 -21
- package/src/capability/hook.ts +3 -4
- package/src/capability/index.ts +15 -16
- package/src/capability/instruction.ts +3 -4
- package/src/capability/mcp.ts +3 -4
- package/src/capability/prompt.ts +3 -4
- package/src/capability/rule.ts +3 -4
- package/src/capability/settings.ts +2 -3
- package/src/capability/skill.ts +3 -4
- package/src/capability/slash-command.ts +3 -4
- package/src/capability/ssh.ts +3 -4
- package/src/capability/system-prompt.ts +3 -4
- package/src/capability/tool.ts +3 -4
- package/src/cli/args.ts +5 -6
- package/src/cli/config-cli.ts +6 -7
- package/src/cli/file-processor.ts +19 -17
- package/src/cli/jupyter-cli.ts +105 -0
- package/src/cli/list-models.ts +10 -11
- package/src/cli/plugin-cli.ts +20 -25
- package/src/cli/session-picker.ts +2 -3
- package/src/cli/setup-cli.ts +2 -3
- package/src/cli/stats-cli.ts +2 -3
- package/src/cli/update-cli.ts +25 -22
- package/src/commit/agentic/agent.ts +307 -0
- package/src/commit/agentic/fallback.ts +96 -0
- package/src/commit/agentic/index.ts +351 -0
- package/src/commit/agentic/prompts/analyze-file.md +22 -0
- package/src/commit/agentic/prompts/session-user.md +26 -0
- package/src/commit/agentic/prompts/split-confirm.md +1 -0
- package/src/commit/agentic/prompts/system.md +40 -0
- package/src/commit/agentic/state.ts +69 -0
- package/src/commit/agentic/tools/analyze-file.ts +131 -0
- package/src/commit/agentic/tools/git-file-diff.ts +194 -0
- package/src/commit/agentic/tools/git-hunk.ts +50 -0
- package/src/commit/agentic/tools/git-overview.ts +84 -0
- package/src/commit/agentic/tools/index.ts +56 -0
- package/src/commit/agentic/tools/propose-changelog.ts +128 -0
- package/src/commit/agentic/tools/propose-commit.ts +154 -0
- package/src/commit/agentic/tools/recent-commits.ts +81 -0
- package/src/commit/agentic/tools/split-commit.ts +280 -0
- package/src/commit/agentic/topo-sort.ts +44 -0
- package/src/commit/agentic/trivial.ts +51 -0
- package/src/commit/agentic/validation.ts +200 -0
- package/src/commit/analysis/conventional.ts +165 -0
- package/src/commit/analysis/index.ts +4 -0
- package/src/commit/analysis/scope.ts +242 -0
- package/src/commit/analysis/summary.ts +112 -0
- package/src/commit/analysis/validation.ts +66 -0
- package/src/commit/changelog/detect.ts +36 -0
- package/src/commit/changelog/generate.ts +110 -0
- package/src/commit/changelog/index.ts +233 -0
- package/src/commit/changelog/parse.ts +44 -0
- package/src/commit/cli.ts +93 -0
- package/src/commit/git/diff.ts +148 -0
- package/src/commit/git/errors.ts +11 -0
- package/src/commit/git/index.ts +212 -0
- package/src/commit/git/operations.ts +53 -0
- package/src/commit/index.ts +5 -0
- package/src/commit/map-reduce/index.ts +63 -0
- package/src/commit/map-reduce/map-phase.ts +178 -0
- package/src/commit/map-reduce/reduce-phase.ts +145 -0
- package/src/commit/map-reduce/utils.ts +9 -0
- package/src/commit/message.ts +11 -0
- package/src/commit/model-selection.ts +80 -0
- package/src/commit/pipeline.ts +240 -0
- package/src/commit/prompts/analysis-system.md +155 -0
- package/src/commit/prompts/analysis-user.md +41 -0
- package/src/commit/prompts/changelog-system.md +56 -0
- package/src/commit/prompts/changelog-user.md +19 -0
- package/src/commit/prompts/file-observer-system.md +26 -0
- package/src/commit/prompts/file-observer-user.md +9 -0
- package/src/commit/prompts/reduce-system.md +60 -0
- package/src/commit/prompts/reduce-user.md +17 -0
- package/src/commit/prompts/summary-retry.md +4 -0
- package/src/commit/prompts/summary-system.md +52 -0
- package/src/commit/prompts/summary-user.md +13 -0
- package/src/commit/prompts/types-description.md +2 -0
- package/src/commit/types.ts +109 -0
- package/src/commit/utils/exclusions.ts +42 -0
- package/src/config/file-lock.ts +121 -0
- package/src/config/keybindings.ts +6 -8
- package/src/config/model-registry.ts +65 -38
- package/src/config/model-resolver.ts +18 -19
- package/src/config/prompt-templates.ts +11 -11
- package/src/config/settings-manager.ts +141 -50
- package/src/config.ts +64 -66
- package/src/cursor.ts +11 -9
- package/src/discovery/agents-md.ts +11 -12
- package/src/discovery/builtin.ts +68 -73
- package/src/discovery/claude.ts +41 -42
- package/src/discovery/cline.ts +11 -12
- package/src/discovery/codex.ts +52 -53
- package/src/discovery/cursor.ts +9 -10
- package/src/discovery/gemini.ts +17 -22
- package/src/discovery/github.ts +13 -14
- package/src/discovery/helpers.ts +35 -34
- package/src/discovery/index.ts +22 -24
- package/src/discovery/mcp-json.ts +8 -9
- package/src/discovery/ssh.ts +8 -9
- package/src/discovery/vscode.ts +4 -5
- package/src/discovery/windsurf.ts +6 -7
- package/src/exa/company.ts +1 -2
- package/src/exa/index.ts +2 -3
- package/src/exa/linkedin.ts +1 -2
- package/src/exa/mcp-client.ts +14 -16
- package/src/exa/render.ts +10 -11
- package/src/exa/researcher.ts +1 -2
- package/src/exa/search.ts +1 -2
- package/src/exa/types.ts +0 -1
- package/src/exa/websets.ts +1 -2
- package/src/exec/bash-executor.ts +3 -4
- package/src/exec/exec.ts +0 -1
- package/src/export/custom-share.ts +5 -6
- package/src/export/html/index.ts +24 -21
- package/src/export/ttsr.ts +2 -3
- package/src/extensibility/custom-commands/bundled/review/index.ts +7 -8
- package/src/extensibility/custom-commands/loader.ts +18 -15
- package/src/extensibility/custom-commands/types.ts +2 -3
- package/src/extensibility/custom-tools/loader.ts +11 -12
- package/src/extensibility/custom-tools/types.ts +7 -8
- package/src/extensibility/custom-tools/wrapper.ts +2 -3
- package/src/extensibility/extensions/loader.ts +76 -54
- package/src/extensibility/extensions/runner.ts +11 -12
- package/src/extensibility/extensions/types.ts +20 -27
- package/src/extensibility/extensions/wrapper.ts +3 -4
- package/src/extensibility/hooks/index.ts +1 -1
- package/src/extensibility/hooks/loader.ts +9 -10
- package/src/extensibility/hooks/runner.ts +7 -8
- package/src/extensibility/hooks/tool-wrapper.ts +0 -1
- package/src/extensibility/hooks/types.ts +11 -18
- package/src/extensibility/plugins/doctor.ts +3 -3
- package/src/extensibility/plugins/installer.ts +27 -27
- package/src/extensibility/plugins/loader.ts +59 -56
- package/src/extensibility/plugins/manager.ts +211 -171
- package/src/extensibility/plugins/parser.ts +1 -1
- package/src/extensibility/plugins/paths.ts +8 -8
- package/src/extensibility/skills.ts +63 -60
- package/src/extensibility/slash-commands.ts +10 -10
- package/src/index.ts +54 -54
- package/src/internal-urls/agent-protocol.ts +21 -11
- package/src/internal-urls/artifact-protocol.ts +17 -13
- package/src/internal-urls/router.ts +1 -2
- package/src/internal-urls/rule-protocol.ts +3 -4
- package/src/internal-urls/skill-protocol.ts +3 -4
- package/src/ipy/executor.ts +109 -9
- package/src/ipy/gateway-coordinator.ts +79 -90
- package/src/ipy/kernel.ts +32 -30
- package/src/ipy/modules.ts +13 -13
- package/src/lsp/client.ts +21 -10
- package/src/lsp/clients/biome-client.ts +1 -2
- package/src/lsp/clients/index.ts +3 -3
- package/src/lsp/clients/lsp-linter-client.ts +4 -5
- package/src/lsp/config.ts +15 -15
- package/src/lsp/edits.ts +4 -5
- package/src/lsp/index.ts +43 -44
- package/src/lsp/lspmux.ts +8 -8
- package/src/lsp/render.ts +99 -61
- package/src/lsp/utils.ts +3 -3
- package/src/main.ts +71 -37
- package/src/mcp/client.ts +2 -3
- package/src/mcp/config.ts +5 -6
- package/src/mcp/json-rpc.ts +0 -1
- package/src/mcp/loader.ts +6 -7
- package/src/mcp/manager.ts +17 -18
- package/src/mcp/tool-bridge.ts +4 -9
- package/src/mcp/tool-cache.ts +2 -3
- package/src/mcp/transports/http.ts +2 -4
- package/src/mcp/transports/stdio.ts +1 -2
- package/src/migrations.ts +63 -52
- package/src/modes/components/armin.ts +4 -5
- package/src/modes/components/assistant-message.ts +33 -5
- package/src/modes/components/bash-execution.ts +7 -8
- package/src/modes/components/bordered-loader.ts +3 -3
- package/src/modes/components/branch-summary-message.ts +3 -3
- package/src/modes/components/compaction-summary-message.ts +3 -3
- package/src/modes/components/countdown-timer.ts +0 -1
- package/src/modes/components/custom-message.ts +5 -5
- package/src/modes/components/diff.ts +1 -1
- package/src/modes/components/dynamic-border.ts +2 -2
- package/src/modes/components/extensions/extension-dashboard.ts +6 -7
- package/src/modes/components/extensions/extension-list.ts +2 -3
- package/src/modes/components/extensions/inspector-panel.ts +3 -4
- package/src/modes/components/extensions/state-manager.ts +25 -26
- package/src/modes/components/extensions/types.ts +1 -2
- package/src/modes/components/footer.ts +47 -43
- package/src/modes/components/history-search.ts +2 -2
- package/src/modes/components/hook-editor.ts +3 -4
- package/src/modes/components/hook-input.ts +2 -3
- package/src/modes/components/hook-message.ts +5 -5
- package/src/modes/components/hook-selector.ts +2 -3
- package/src/modes/components/keybinding-hints.ts +2 -3
- package/src/modes/components/login-dialog.ts +2 -2
- package/src/modes/components/model-selector.ts +12 -12
- package/src/modes/components/oauth-selector.ts +2 -2
- package/src/modes/components/plugin-settings.ts +20 -20
- package/src/modes/components/python-execution.ts +7 -8
- package/src/modes/components/queue-mode-selector.ts +3 -3
- package/src/modes/components/read-tool-group.ts +2 -2
- package/src/modes/components/session-selector.ts +4 -4
- package/src/modes/components/settings-defs.ts +77 -69
- package/src/modes/components/settings-selector.ts +16 -16
- package/src/modes/components/show-images-selector.ts +2 -2
- package/src/modes/components/status-line/segments.ts +4 -4
- package/src/modes/components/status-line/separators.ts +1 -1
- package/src/modes/components/status-line/types.ts +2 -2
- package/src/modes/components/status-line-segment-editor.ts +7 -8
- package/src/modes/components/status-line.ts +12 -12
- package/src/modes/components/theme-selector.ts +8 -7
- package/src/modes/components/thinking-selector.ts +4 -4
- package/src/modes/components/todo-display.ts +2 -2
- package/src/modes/components/todo-reminder.ts +4 -4
- package/src/modes/components/tool-execution.ts +16 -19
- package/src/modes/components/tree-selector.ts +12 -12
- package/src/modes/components/ttsr-notification.ts +5 -5
- package/src/modes/components/user-message-selector.ts +1 -1
- package/src/modes/components/user-message.ts +1 -1
- package/src/modes/components/visual-truncate.ts +0 -1
- package/src/modes/components/welcome.ts +4 -4
- package/src/modes/controllers/command-controller.ts +46 -47
- package/src/modes/controllers/event-controller.ts +16 -20
- package/src/modes/controllers/extension-ui-controller.ts +40 -46
- package/src/modes/controllers/input-controller.ts +17 -18
- package/src/modes/controllers/selector-controller.ts +103 -91
- package/src/modes/index.ts +3 -3
- package/src/modes/interactive-mode.ts +31 -31
- package/src/modes/print-mode.ts +12 -13
- package/src/modes/rpc/rpc-client.ts +7 -8
- package/src/modes/rpc/rpc-mode.ts +24 -28
- package/src/modes/rpc/rpc-types.ts +3 -4
- package/src/modes/theme/mermaid-cache.ts +89 -0
- package/src/modes/theme/theme.ts +130 -53
- package/src/modes/types.ts +10 -10
- package/src/modes/utils/ui-helpers.ts +17 -17
- package/src/patch/applicator.ts +18 -19
- package/src/patch/diff.ts +1 -2
- package/src/patch/fuzzy.ts +1 -2
- package/src/patch/index.ts +11 -18
- package/src/patch/normalize.ts +4 -4
- package/src/patch/normative.ts +1 -2
- package/src/patch/parser.ts +8 -9
- package/src/patch/shared.ts +43 -16
- package/src/prompts/tools/task.md +2 -0
- package/src/sdk.ts +100 -65
- package/src/session/agent-session.ts +84 -85
- package/src/session/agent-storage.ts +43 -39
- package/src/session/artifacts.ts +32 -10
- package/src/session/auth-storage.ts +50 -39
- package/src/session/compaction/branch-summarization.ts +7 -10
- package/src/session/compaction/compaction.ts +8 -19
- package/src/session/compaction/utils.ts +6 -9
- package/src/session/history-storage.ts +10 -10
- package/src/session/messages.ts +4 -5
- package/src/session/session-manager.ts +76 -65
- package/src/session/session-storage.ts +57 -69
- package/src/session/storage-migration.ts +14 -56
- package/src/session/streaming-output.ts +2 -2
- package/src/ssh/connection-manager.ts +43 -50
- package/src/ssh/ssh-executor.ts +2 -2
- package/src/ssh/sshfs-mount.ts +11 -18
- package/src/system-prompt.ts +28 -35
- package/src/task/agents.ts +45 -30
- package/src/task/commands.ts +6 -7
- package/src/task/discovery.ts +39 -76
- package/src/task/executor.ts +14 -15
- package/src/task/index.ts +40 -34
- package/src/task/output-manager.ts +93 -0
- package/src/task/parallel.ts +0 -1
- package/src/task/render.ts +24 -30
- package/src/task/subprocess-tool-registry.ts +1 -2
- package/src/task/worker-protocol.ts +3 -3
- package/src/task/worker.ts +33 -39
- package/src/task/worktree.ts +19 -19
- package/src/tools/ask.ts +41 -20
- package/src/tools/bash-interceptor.ts +1 -5
- package/src/tools/bash.ts +91 -97
- package/src/tools/calculator.ts +49 -47
- package/src/tools/complete.ts +4 -5
- package/src/tools/context.ts +2 -2
- package/src/tools/fetch.ts +84 -124
- package/src/tools/find.ts +94 -98
- package/src/tools/gemini-image.ts +14 -14
- package/src/tools/grep.ts +100 -116
- package/src/tools/index.ts +80 -55
- package/src/tools/list-limit.ts +1 -1
- package/src/tools/ls.ts +44 -70
- package/src/tools/notebook.ts +51 -67
- package/src/tools/output-meta.ts +3 -4
- package/src/tools/output-utils.ts +2 -2
- package/src/tools/path-utils.ts +5 -5
- package/src/tools/python.ts +104 -217
- package/src/tools/read.ts +92 -33
- package/src/tools/render-utils.ts +8 -23
- package/src/tools/renderers.ts +6 -7
- package/src/tools/review.ts +8 -11
- package/src/tools/ssh.ts +69 -49
- package/src/tools/todo-write.ts +37 -25
- package/src/tools/tool-errors.ts +3 -3
- package/src/tools/tool-result.ts +3 -8
- package/src/tools/write.ts +99 -75
- package/src/tui/code-cell.ts +109 -0
- package/src/tui/file-list.ts +47 -0
- package/src/tui/index.ts +11 -0
- package/src/tui/output-block.ts +72 -0
- package/src/tui/status-line.ts +39 -0
- package/src/tui/tree-list.ts +55 -0
- package/src/tui/types.ts +16 -0
- package/src/tui/utils.ts +48 -0
- package/src/utils/changelog.ts +9 -10
- package/src/utils/clipboard.ts +11 -11
- package/src/utils/file-mentions.ts +4 -10
- package/src/utils/frontmatter.ts +6 -3
- package/src/utils/fuzzy.ts +2 -2
- package/src/utils/image-convert.ts +1 -1
- package/src/utils/image-resize.ts +1 -1
- package/src/utils/mime.ts +2 -2
- package/src/utils/shell-snapshot.ts +11 -13
- package/src/utils/shell.ts +4 -5
- package/src/utils/title-generator.ts +8 -9
- package/src/utils/tools-manager.ts +23 -23
- package/src/vendor/photon/index.js +1099 -1059
- package/src/vendor/photon/photon_rs_bg.wasm +0 -0
- package/src/web/scrapers/artifacthub.ts +1 -1
- package/src/web/scrapers/arxiv.ts +2 -2
- package/src/web/scrapers/bluesky.ts +2 -2
- package/src/web/scrapers/cheatsh.ts +1 -1
- package/src/web/scrapers/chocolatey.ts +2 -2
- package/src/web/scrapers/choosealicense.ts +5 -5
- package/src/web/scrapers/cisa-kev.ts +1 -1
- package/src/web/scrapers/crossref.ts +2 -2
- package/src/web/scrapers/devto.ts +3 -3
- package/src/web/scrapers/discogs.ts +3 -4
- package/src/web/scrapers/discourse.ts +1 -1
- package/src/web/scrapers/dockerhub.ts +1 -1
- package/src/web/scrapers/fdroid.ts +2 -2
- package/src/web/scrapers/firefox-addons.ts +3 -3
- package/src/web/scrapers/flathub.ts +1 -1
- package/src/web/scrapers/github.ts +3 -3
- package/src/web/scrapers/gitlab.ts +4 -4
- package/src/web/scrapers/hackernews.ts +2 -2
- package/src/web/scrapers/huggingface.ts +1 -1
- package/src/web/scrapers/iacr.ts +2 -2
- package/src/web/scrapers/index.ts +0 -1
- package/src/web/scrapers/jetbrains-marketplace.ts +1 -1
- package/src/web/scrapers/lemmy.ts +2 -2
- package/src/web/scrapers/maven.ts +2 -2
- package/src/web/scrapers/mdn.ts +2 -4
- package/src/web/scrapers/metacpan.ts +2 -2
- package/src/web/scrapers/musicbrainz.ts +1 -2
- package/src/web/scrapers/npm.ts +1 -1
- package/src/web/scrapers/nuget.ts +2 -2
- package/src/web/scrapers/nvd.ts +3 -3
- package/src/web/scrapers/ollama.ts +7 -9
- package/src/web/scrapers/opencorporates.ts +2 -2
- package/src/web/scrapers/openlibrary.ts +6 -6
- package/src/web/scrapers/orcid.ts +0 -1
- package/src/web/scrapers/osv.ts +2 -2
- package/src/web/scrapers/packagist.ts +1 -1
- package/src/web/scrapers/pubmed.ts +1 -2
- package/src/web/scrapers/rawg.ts +2 -2
- package/src/web/scrapers/readthedocs.ts +1 -2
- package/src/web/scrapers/repology.ts +2 -2
- package/src/web/scrapers/rfc.ts +1 -1
- package/src/web/scrapers/searchcode.ts +2 -2
- package/src/web/scrapers/semantic-scholar.ts +1 -1
- package/src/web/scrapers/snapcraft.ts +2 -2
- package/src/web/scrapers/sourcegraph.ts +1 -1
- package/src/web/scrapers/spdx.ts +3 -3
- package/src/web/scrapers/spotify.ts +0 -1
- package/src/web/scrapers/twitter.ts +1 -1
- package/src/web/scrapers/types.ts +1 -2
- package/src/web/scrapers/utils.ts +5 -5
- package/src/web/scrapers/wikidata.ts +3 -3
- package/src/web/scrapers/youtube.ts +9 -14
- package/src/web/search/auth.ts +5 -10
- package/src/web/search/index.ts +11 -21
- package/src/web/search/providers/anthropic.ts +3 -9
- package/src/web/search/providers/exa.ts +6 -10
- package/src/web/search/providers/perplexity.ts +5 -5
- package/src/web/search/render.ts +129 -175
- package/tsconfig.json +0 -42
|
@@ -5,173 +5,173 @@
|
|
|
5
5
|
* For use when communicating between JS and WASM, and also natively.
|
|
6
6
|
*/
|
|
7
7
|
export class PhotonImage {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
8
|
+
static __wrap(ptr) {
|
|
9
|
+
ptr = ptr >>> 0;
|
|
10
|
+
const obj = Object.create(PhotonImage.prototype);
|
|
11
|
+
obj.__wbg_ptr = ptr;
|
|
12
|
+
PhotonImageFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
13
|
+
return obj;
|
|
14
|
+
}
|
|
15
|
+
__destroy_into_raw() {
|
|
16
|
+
const ptr = this.__wbg_ptr;
|
|
17
|
+
this.__wbg_ptr = 0;
|
|
18
|
+
PhotonImageFinalization.unregister(this);
|
|
19
|
+
return ptr;
|
|
20
|
+
}
|
|
21
|
+
free() {
|
|
22
|
+
const ptr = this.__destroy_into_raw();
|
|
23
|
+
wasm.__wbg_photonimage_free(ptr, 0);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Convert the PhotonImage to base64.
|
|
27
|
+
* @returns {string}
|
|
28
|
+
*/
|
|
29
|
+
get_base64() {
|
|
30
|
+
let deferred1_0;
|
|
31
|
+
let deferred1_1;
|
|
32
|
+
try {
|
|
33
|
+
const ret = wasm.photonimage_get_base64(this.__wbg_ptr);
|
|
34
|
+
deferred1_0 = ret[0];
|
|
35
|
+
deferred1_1 = ret[1];
|
|
36
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
37
|
+
} finally {
|
|
38
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Convert the PhotonImage to raw bytes. Returns PNG.
|
|
43
|
+
* @returns {Uint8Array}
|
|
44
|
+
*/
|
|
45
|
+
get_bytes() {
|
|
46
|
+
const ret = wasm.photonimage_get_bytes(this.__wbg_ptr);
|
|
47
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
48
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
49
|
+
return v1;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Convert the PhotonImage to raw bytes. Returns a JPEG.
|
|
53
|
+
* @param {number} quality
|
|
54
|
+
* @returns {Uint8Array}
|
|
55
|
+
*/
|
|
56
|
+
get_bytes_jpeg(quality) {
|
|
57
|
+
const ret = wasm.photonimage_get_bytes_jpeg(this.__wbg_ptr, quality);
|
|
58
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
59
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
60
|
+
return v1;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Convert the PhotonImage to raw bytes. Returns a WEBP.
|
|
64
|
+
* @returns {Uint8Array}
|
|
65
|
+
*/
|
|
66
|
+
get_bytes_webp() {
|
|
67
|
+
const ret = wasm.photonimage_get_bytes_webp(this.__wbg_ptr);
|
|
68
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
69
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
70
|
+
return v1;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Calculates estimated filesize and returns number of bytes
|
|
74
|
+
* @returns {bigint}
|
|
75
|
+
*/
|
|
76
|
+
get_estimated_filesize() {
|
|
77
|
+
const ret = wasm.photonimage_get_estimated_filesize(this.__wbg_ptr);
|
|
78
|
+
return BigInt.asUintN(64, ret);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Get the height of the PhotonImage.
|
|
82
|
+
* @returns {number}
|
|
83
|
+
*/
|
|
84
|
+
get_height() {
|
|
85
|
+
const ret = wasm.photonimage_get_height(this.__wbg_ptr);
|
|
86
|
+
return ret >>> 0;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Convert the PhotonImage's raw pixels to JS-compatible ImageData.
|
|
90
|
+
* @returns {ImageData}
|
|
91
|
+
*/
|
|
92
|
+
get_image_data() {
|
|
93
|
+
const ret = wasm.photonimage_get_image_data(this.__wbg_ptr);
|
|
94
|
+
return ret;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Get the PhotonImage's pixels as a Vec of u8s.
|
|
98
|
+
* @returns {Uint8Array}
|
|
99
|
+
*/
|
|
100
|
+
get_raw_pixels() {
|
|
101
|
+
const ret = wasm.photonimage_get_raw_pixels(this.__wbg_ptr);
|
|
102
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
103
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
104
|
+
return v1;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Get the width of the PhotonImage.
|
|
108
|
+
* @returns {number}
|
|
109
|
+
*/
|
|
110
|
+
get_width() {
|
|
111
|
+
const ret = wasm.photonimage_get_width(this.__wbg_ptr);
|
|
112
|
+
return ret >>> 0;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Create a new PhotonImage from a Vec of u8s, which represent raw pixels.
|
|
116
|
+
* @param {Uint8Array} raw_pixels
|
|
117
|
+
* @param {number} width
|
|
118
|
+
* @param {number} height
|
|
119
|
+
*/
|
|
120
|
+
constructor(raw_pixels, width, height) {
|
|
121
|
+
const ptr0 = passArray8ToWasm0(raw_pixels, wasm.__wbindgen_malloc);
|
|
122
|
+
const len0 = WASM_VECTOR_LEN;
|
|
123
|
+
const ret = wasm.photonimage_new(ptr0, len0, width, height);
|
|
124
|
+
this.__wbg_ptr = ret >>> 0;
|
|
125
|
+
PhotonImageFinalization.register(this, this.__wbg_ptr, this);
|
|
126
|
+
return this;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Create a new PhotonImage from a base64 string.
|
|
130
|
+
* @param {string} base64
|
|
131
|
+
* @returns {PhotonImage}
|
|
132
|
+
*/
|
|
133
|
+
static new_from_base64(base64) {
|
|
134
|
+
const ptr0 = passStringToWasm0(base64, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
135
|
+
const len0 = WASM_VECTOR_LEN;
|
|
136
|
+
const ret = wasm.base64_to_image(ptr0, len0);
|
|
137
|
+
return PhotonImage.__wrap(ret);
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Create a new PhotonImage from a Blob/File.
|
|
141
|
+
* @param {Blob} blob
|
|
142
|
+
* @returns {PhotonImage}
|
|
143
|
+
*/
|
|
144
|
+
static new_from_blob(blob) {
|
|
145
|
+
const ret = wasm.photonimage_new_from_blob(blob);
|
|
146
|
+
return PhotonImage.__wrap(ret);
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Create a new PhotonImage from a byteslice.
|
|
150
|
+
* @param {Uint8Array} vec
|
|
151
|
+
* @returns {PhotonImage}
|
|
152
|
+
*/
|
|
153
|
+
static new_from_byteslice(vec) {
|
|
154
|
+
const ptr0 = passArray8ToWasm0(vec, wasm.__wbindgen_malloc);
|
|
155
|
+
const len0 = WASM_VECTOR_LEN;
|
|
156
|
+
const ret = wasm.photonimage_new_from_byteslice(ptr0, len0);
|
|
157
|
+
return PhotonImage.__wrap(ret);
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Create a new PhotonImage from a HTMLImageElement
|
|
161
|
+
* @param {HTMLImageElement} image
|
|
162
|
+
* @returns {PhotonImage}
|
|
163
|
+
*/
|
|
164
|
+
static new_from_image(image) {
|
|
165
|
+
const ret = wasm.photonimage_new_from_image(image);
|
|
166
|
+
return PhotonImage.__wrap(ret);
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Convert ImageData to raw pixels, and update the PhotonImage's raw pixels to this.
|
|
170
|
+
* @param {ImageData} img_data
|
|
171
|
+
*/
|
|
172
|
+
set_imgdata(img_data) {
|
|
173
|
+
wasm.photonimage_set_imgdata(this.__wbg_ptr, img_data);
|
|
174
|
+
}
|
|
175
175
|
}
|
|
176
176
|
if (Symbol.dispose) PhotonImage.prototype[Symbol.dispose] = PhotonImage.prototype.free;
|
|
177
177
|
|
|
@@ -179,73 +179,73 @@ if (Symbol.dispose) PhotonImage.prototype[Symbol.dispose] = PhotonImage.prototyp
|
|
|
179
179
|
* RGB color type.
|
|
180
180
|
*/
|
|
181
181
|
export class Rgb {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
182
|
+
__destroy_into_raw() {
|
|
183
|
+
const ptr = this.__wbg_ptr;
|
|
184
|
+
this.__wbg_ptr = 0;
|
|
185
|
+
RgbFinalization.unregister(this);
|
|
186
|
+
return ptr;
|
|
187
|
+
}
|
|
188
|
+
free() {
|
|
189
|
+
const ptr = this.__destroy_into_raw();
|
|
190
|
+
wasm.__wbg_rgb_free(ptr, 0);
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Get the Blue value.
|
|
194
|
+
* @returns {number}
|
|
195
|
+
*/
|
|
196
|
+
get_blue() {
|
|
197
|
+
const ret = wasm.rgb_get_blue(this.__wbg_ptr);
|
|
198
|
+
return ret;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Get the Green value.
|
|
202
|
+
* @returns {number}
|
|
203
|
+
*/
|
|
204
|
+
get_green() {
|
|
205
|
+
const ret = wasm.rgb_get_green(this.__wbg_ptr);
|
|
206
|
+
return ret;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Get the Red value.
|
|
210
|
+
* @returns {number}
|
|
211
|
+
*/
|
|
212
|
+
get_red() {
|
|
213
|
+
const ret = wasm.rgb_get_red(this.__wbg_ptr);
|
|
214
|
+
return ret;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Create a new RGB struct.
|
|
218
|
+
* @param {number} r
|
|
219
|
+
* @param {number} g
|
|
220
|
+
* @param {number} b
|
|
221
|
+
*/
|
|
222
|
+
constructor(r, g, b) {
|
|
223
|
+
const ret = wasm.rgb_new(r, g, b);
|
|
224
|
+
this.__wbg_ptr = ret >>> 0;
|
|
225
|
+
RgbFinalization.register(this, this.__wbg_ptr, this);
|
|
226
|
+
return this;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Set the Blue value.
|
|
230
|
+
* @param {number} b
|
|
231
|
+
*/
|
|
232
|
+
set_blue(b) {
|
|
233
|
+
wasm.rgb_set_blue(this.__wbg_ptr, b);
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Get the Green value.
|
|
237
|
+
* @param {number} g
|
|
238
|
+
*/
|
|
239
|
+
set_green(g) {
|
|
240
|
+
wasm.rgb_set_green(this.__wbg_ptr, g);
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Set the Red value.
|
|
244
|
+
* @param {number} r
|
|
245
|
+
*/
|
|
246
|
+
set_red(r) {
|
|
247
|
+
wasm.rgb_set_red(this.__wbg_ptr, r);
|
|
248
|
+
}
|
|
249
249
|
}
|
|
250
250
|
if (Symbol.dispose) Rgb.prototype[Symbol.dispose] = Rgb.prototype.free;
|
|
251
251
|
|
|
@@ -253,89 +253,89 @@ if (Symbol.dispose) Rgb.prototype[Symbol.dispose] = Rgb.prototype.free;
|
|
|
253
253
|
* RGBA color type.
|
|
254
254
|
*/
|
|
255
255
|
export class Rgba {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
256
|
+
__destroy_into_raw() {
|
|
257
|
+
const ptr = this.__wbg_ptr;
|
|
258
|
+
this.__wbg_ptr = 0;
|
|
259
|
+
RgbaFinalization.unregister(this);
|
|
260
|
+
return ptr;
|
|
261
|
+
}
|
|
262
|
+
free() {
|
|
263
|
+
const ptr = this.__destroy_into_raw();
|
|
264
|
+
wasm.__wbg_rgba_free(ptr, 0);
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Get the alpha value for this color.
|
|
268
|
+
* @returns {number}
|
|
269
|
+
*/
|
|
270
|
+
get_alpha() {
|
|
271
|
+
const ret = wasm.rgba_get_alpha(this.__wbg_ptr);
|
|
272
|
+
return ret;
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Get the Blue value.
|
|
276
|
+
* @returns {number}
|
|
277
|
+
*/
|
|
278
|
+
get_blue() {
|
|
279
|
+
const ret = wasm.rgb_get_blue(this.__wbg_ptr);
|
|
280
|
+
return ret;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Get the Green value.
|
|
284
|
+
* @returns {number}
|
|
285
|
+
*/
|
|
286
|
+
get_green() {
|
|
287
|
+
const ret = wasm.rgb_get_green(this.__wbg_ptr);
|
|
288
|
+
return ret;
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Get the Red value.
|
|
292
|
+
* @returns {number}
|
|
293
|
+
*/
|
|
294
|
+
get_red() {
|
|
295
|
+
const ret = wasm.rgb_get_red(this.__wbg_ptr);
|
|
296
|
+
return ret;
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Create a new RGBA struct.
|
|
300
|
+
* @param {number} r
|
|
301
|
+
* @param {number} g
|
|
302
|
+
* @param {number} b
|
|
303
|
+
* @param {number} a
|
|
304
|
+
*/
|
|
305
|
+
constructor(r, g, b, a) {
|
|
306
|
+
const ret = wasm.rgba_new(r, g, b, a);
|
|
307
|
+
this.__wbg_ptr = ret >>> 0;
|
|
308
|
+
RgbaFinalization.register(this, this.__wbg_ptr, this);
|
|
309
|
+
return this;
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Set the alpha value.
|
|
313
|
+
* @param {number} a
|
|
314
|
+
*/
|
|
315
|
+
set_alpha(a) {
|
|
316
|
+
wasm.rgba_set_alpha(this.__wbg_ptr, a);
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Set the Blue value.
|
|
320
|
+
* @param {number} b
|
|
321
|
+
*/
|
|
322
|
+
set_blue(b) {
|
|
323
|
+
wasm.rgb_set_blue(this.__wbg_ptr, b);
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Get the Green value.
|
|
327
|
+
* @param {number} g
|
|
328
|
+
*/
|
|
329
|
+
set_green(g) {
|
|
330
|
+
wasm.rgb_set_green(this.__wbg_ptr, g);
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Set the Red value.
|
|
334
|
+
* @param {number} r
|
|
335
|
+
*/
|
|
336
|
+
set_red(r) {
|
|
337
|
+
wasm.rgb_set_red(this.__wbg_ptr, r);
|
|
338
|
+
}
|
|
339
339
|
}
|
|
340
340
|
if (Symbol.dispose) Rgba.prototype[Symbol.dispose] = Rgba.prototype.free;
|
|
341
341
|
|
|
@@ -343,11 +343,16 @@ if (Symbol.dispose) Rgba.prototype[Symbol.dispose] = Rgba.prototype.free;
|
|
|
343
343
|
* @enum {1 | 2 | 3 | 4 | 5}
|
|
344
344
|
*/
|
|
345
345
|
export const SamplingFilter = Object.freeze({
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
346
|
+
Nearest: 1,
|
|
347
|
+
1: "Nearest",
|
|
348
|
+
Triangle: 2,
|
|
349
|
+
2: "Triangle",
|
|
350
|
+
CatmullRom: 3,
|
|
351
|
+
3: "CatmullRom",
|
|
352
|
+
Gaussian: 4,
|
|
353
|
+
4: "Gaussian",
|
|
354
|
+
Lanczos3: 5,
|
|
355
|
+
5: "Lanczos3",
|
|
351
356
|
});
|
|
352
357
|
|
|
353
358
|
/**
|
|
@@ -373,8 +378,8 @@ export const SamplingFilter = Object.freeze({
|
|
|
373
378
|
* @param {PhotonImage} photon_image
|
|
374
379
|
*/
|
|
375
380
|
export function add_noise_rand(photon_image) {
|
|
376
|
-
|
|
377
|
-
|
|
381
|
+
_assertClass(photon_image, PhotonImage);
|
|
382
|
+
wasm.add_noise_rand(photon_image.__wbg_ptr);
|
|
378
383
|
}
|
|
379
384
|
|
|
380
385
|
/**
|
|
@@ -398,8 +403,8 @@ export function add_noise_rand(photon_image) {
|
|
|
398
403
|
* @param {number} brightness
|
|
399
404
|
*/
|
|
400
405
|
export function adjust_brightness(photon_image, brightness) {
|
|
401
|
-
|
|
402
|
-
|
|
406
|
+
_assertClass(photon_image, PhotonImage);
|
|
407
|
+
wasm.adjust_brightness(photon_image.__wbg_ptr, brightness);
|
|
403
408
|
}
|
|
404
409
|
|
|
405
410
|
/**
|
|
@@ -422,8 +427,8 @@ export function adjust_brightness(photon_image, brightness) {
|
|
|
422
427
|
* @param {number} contrast
|
|
423
428
|
*/
|
|
424
429
|
export function adjust_contrast(photon_image, contrast) {
|
|
425
|
-
|
|
426
|
-
|
|
430
|
+
_assertClass(photon_image, PhotonImage);
|
|
431
|
+
wasm.adjust_contrast(photon_image.__wbg_ptr, contrast);
|
|
427
432
|
}
|
|
428
433
|
|
|
429
434
|
/**
|
|
@@ -447,8 +452,8 @@ export function adjust_contrast(photon_image, contrast) {
|
|
|
447
452
|
* @param {number} amt
|
|
448
453
|
*/
|
|
449
454
|
export function alter_blue_channel(img, amt) {
|
|
450
|
-
|
|
451
|
-
|
|
455
|
+
_assertClass(img, PhotonImage);
|
|
456
|
+
wasm.alter_blue_channel(img.__wbg_ptr, amt);
|
|
452
457
|
}
|
|
453
458
|
|
|
454
459
|
/**
|
|
@@ -489,8 +494,8 @@ export function alter_blue_channel(img, amt) {
|
|
|
489
494
|
* @param {number} amt
|
|
490
495
|
*/
|
|
491
496
|
export function alter_channel(img, channel, amt) {
|
|
492
|
-
|
|
493
|
-
|
|
497
|
+
_assertClass(img, PhotonImage);
|
|
498
|
+
wasm.alter_channel(img.__wbg_ptr, channel, amt);
|
|
494
499
|
}
|
|
495
500
|
|
|
496
501
|
/**
|
|
@@ -519,8 +524,8 @@ export function alter_channel(img, channel, amt) {
|
|
|
519
524
|
* @param {number} b_amt
|
|
520
525
|
*/
|
|
521
526
|
export function alter_channels(img, r_amt, g_amt, b_amt) {
|
|
522
|
-
|
|
523
|
-
|
|
527
|
+
_assertClass(img, PhotonImage);
|
|
528
|
+
wasm.alter_channels(img.__wbg_ptr, r_amt, g_amt, b_amt);
|
|
524
529
|
}
|
|
525
530
|
|
|
526
531
|
/**
|
|
@@ -544,8 +549,8 @@ export function alter_channels(img, r_amt, g_amt, b_amt) {
|
|
|
544
549
|
* @param {number} amt
|
|
545
550
|
*/
|
|
546
551
|
export function alter_green_channel(img, amt) {
|
|
547
|
-
|
|
548
|
-
|
|
552
|
+
_assertClass(img, PhotonImage);
|
|
553
|
+
wasm.alter_green_channel(img.__wbg_ptr, amt);
|
|
549
554
|
}
|
|
550
555
|
|
|
551
556
|
/**
|
|
@@ -569,8 +574,8 @@ export function alter_green_channel(img, amt) {
|
|
|
569
574
|
* @param {number} amt
|
|
570
575
|
*/
|
|
571
576
|
export function alter_red_channel(photon_image, amt) {
|
|
572
|
-
|
|
573
|
-
|
|
577
|
+
_assertClass(photon_image, PhotonImage);
|
|
578
|
+
wasm.alter_red_channel(photon_image.__wbg_ptr, amt);
|
|
574
579
|
}
|
|
575
580
|
|
|
576
581
|
/**
|
|
@@ -600,8 +605,8 @@ export function alter_red_channel(photon_image, amt) {
|
|
|
600
605
|
* @param {number} amt2
|
|
601
606
|
*/
|
|
602
607
|
export function alter_two_channels(img, channel1, amt1, channel2, amt2) {
|
|
603
|
-
|
|
604
|
-
|
|
608
|
+
_assertClass(img, PhotonImage);
|
|
609
|
+
wasm.alter_two_channels(img.__wbg_ptr, channel1, amt1, channel2, amt2);
|
|
605
610
|
}
|
|
606
611
|
|
|
607
612
|
/**
|
|
@@ -609,8 +614,8 @@ export function alter_two_channels(img, channel1, amt1, channel2, amt2) {
|
|
|
609
614
|
* @param {PhotonImage} image
|
|
610
615
|
*/
|
|
611
616
|
export function apply_gradient(image) {
|
|
612
|
-
|
|
613
|
-
|
|
617
|
+
_assertClass(image, PhotonImage);
|
|
618
|
+
wasm.apply_gradient(image.__wbg_ptr);
|
|
614
619
|
}
|
|
615
620
|
|
|
616
621
|
/**
|
|
@@ -631,8 +636,8 @@ export function apply_gradient(image) {
|
|
|
631
636
|
* @param {PhotonImage} photon_image
|
|
632
637
|
*/
|
|
633
638
|
export function b_grayscale(photon_image) {
|
|
634
|
-
|
|
635
|
-
|
|
639
|
+
_assertClass(photon_image, PhotonImage);
|
|
640
|
+
wasm.b_grayscale(photon_image.__wbg_ptr);
|
|
636
641
|
}
|
|
637
642
|
|
|
638
643
|
/**
|
|
@@ -641,10 +646,10 @@ export function b_grayscale(photon_image) {
|
|
|
641
646
|
* @returns {PhotonImage}
|
|
642
647
|
*/
|
|
643
648
|
export function base64_to_image(base64) {
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
649
|
+
const ptr0 = passStringToWasm0(base64, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
650
|
+
const len0 = WASM_VECTOR_LEN;
|
|
651
|
+
const ret = wasm.base64_to_image(ptr0, len0);
|
|
652
|
+
return PhotonImage.__wrap(ret);
|
|
648
653
|
}
|
|
649
654
|
|
|
650
655
|
/**
|
|
@@ -653,12 +658,12 @@ export function base64_to_image(base64) {
|
|
|
653
658
|
* @returns {Uint8Array}
|
|
654
659
|
*/
|
|
655
660
|
export function base64_to_vec(base64) {
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
661
|
+
const ptr0 = passStringToWasm0(base64, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
662
|
+
const len0 = WASM_VECTOR_LEN;
|
|
663
|
+
const ret = wasm.base64_to_vec(ptr0, len0);
|
|
664
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
665
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
666
|
+
return v2;
|
|
662
667
|
}
|
|
663
668
|
|
|
664
669
|
/**
|
|
@@ -690,11 +695,11 @@ export function base64_to_vec(base64) {
|
|
|
690
695
|
* @param {string} blend_mode
|
|
691
696
|
*/
|
|
692
697
|
export function blend(photon_image, photon_image2, blend_mode) {
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
+
_assertClass(photon_image, PhotonImage);
|
|
699
|
+
_assertClass(photon_image2, PhotonImage);
|
|
700
|
+
const ptr0 = passStringToWasm0(blend_mode, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
701
|
+
const len0 = WASM_VECTOR_LEN;
|
|
702
|
+
wasm.blend(photon_image.__wbg_ptr, photon_image2.__wbg_ptr, ptr0, len0);
|
|
698
703
|
}
|
|
699
704
|
|
|
700
705
|
/**
|
|
@@ -716,8 +721,8 @@ export function blend(photon_image, photon_image2, blend_mode) {
|
|
|
716
721
|
* @param {PhotonImage} photon_image
|
|
717
722
|
*/
|
|
718
723
|
export function box_blur(photon_image) {
|
|
719
|
-
|
|
720
|
-
|
|
724
|
+
_assertClass(photon_image, PhotonImage);
|
|
725
|
+
wasm.box_blur(photon_image.__wbg_ptr);
|
|
721
726
|
}
|
|
722
727
|
|
|
723
728
|
/**
|
|
@@ -737,8 +742,8 @@ export function box_blur(photon_image) {
|
|
|
737
742
|
* @param {PhotonImage} img
|
|
738
743
|
*/
|
|
739
744
|
export function cali(img) {
|
|
740
|
-
|
|
741
|
-
|
|
745
|
+
_assertClass(img, PhotonImage);
|
|
746
|
+
wasm.cali(img.__wbg_ptr);
|
|
742
747
|
}
|
|
743
748
|
|
|
744
749
|
/**
|
|
@@ -765,10 +770,10 @@ export function cali(img) {
|
|
|
765
770
|
* @param {Rgb} color
|
|
766
771
|
*/
|
|
767
772
|
export function color_horizontal_strips(photon_image, num_strips, color) {
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
773
|
+
_assertClass(photon_image, PhotonImage);
|
|
774
|
+
_assertClass(color, Rgb);
|
|
775
|
+
var ptr0 = color.__destroy_into_raw();
|
|
776
|
+
wasm.color_horizontal_strips(photon_image.__wbg_ptr, num_strips, ptr0);
|
|
772
777
|
}
|
|
773
778
|
|
|
774
779
|
/**
|
|
@@ -795,10 +800,10 @@ export function color_horizontal_strips(photon_image, num_strips, color) {
|
|
|
795
800
|
* @param {Rgb} color
|
|
796
801
|
*/
|
|
797
802
|
export function color_vertical_strips(photon_image, num_strips, color) {
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
803
|
+
_assertClass(photon_image, PhotonImage);
|
|
804
|
+
_assertClass(color, Rgb);
|
|
805
|
+
var ptr0 = color.__destroy_into_raw();
|
|
806
|
+
wasm.color_vertical_strips(photon_image.__wbg_ptr, num_strips, ptr0);
|
|
802
807
|
}
|
|
803
808
|
|
|
804
809
|
/**
|
|
@@ -819,8 +824,8 @@ export function color_vertical_strips(photon_image, num_strips, color) {
|
|
|
819
824
|
* @param {PhotonImage} photon_image
|
|
820
825
|
*/
|
|
821
826
|
export function colorize(photon_image) {
|
|
822
|
-
|
|
823
|
-
|
|
827
|
+
_assertClass(photon_image, PhotonImage);
|
|
828
|
+
wasm.colorize(photon_image.__wbg_ptr);
|
|
824
829
|
}
|
|
825
830
|
|
|
826
831
|
/**
|
|
@@ -829,8 +834,8 @@ export function colorize(photon_image) {
|
|
|
829
834
|
* @returns {PhotonImage}
|
|
830
835
|
*/
|
|
831
836
|
export function create_gradient(width, height) {
|
|
832
|
-
|
|
833
|
-
|
|
837
|
+
const ret = wasm.create_gradient(width, height);
|
|
838
|
+
return PhotonImage.__wrap(ret);
|
|
834
839
|
}
|
|
835
840
|
|
|
836
841
|
/**
|
|
@@ -859,9 +864,9 @@ export function create_gradient(width, height) {
|
|
|
859
864
|
* @returns {PhotonImage}
|
|
860
865
|
*/
|
|
861
866
|
export function crop(photon_image, x1, y1, x2, y2) {
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
867
|
+
_assertClass(photon_image, PhotonImage);
|
|
868
|
+
const ret = wasm.crop(photon_image.__wbg_ptr, x1, y1, x2, y2);
|
|
869
|
+
return PhotonImage.__wrap(ret);
|
|
865
870
|
}
|
|
866
871
|
|
|
867
872
|
/**
|
|
@@ -873,8 +878,8 @@ export function crop(photon_image, x1, y1, x2, y2) {
|
|
|
873
878
|
* @returns {HTMLCanvasElement}
|
|
874
879
|
*/
|
|
875
880
|
export function crop_img_browser(source_canvas, width, height, left, top) {
|
|
876
|
-
|
|
877
|
-
|
|
881
|
+
const ret = wasm.crop_img_browser(source_canvas, width, height, left, top);
|
|
882
|
+
return ret;
|
|
878
883
|
}
|
|
879
884
|
|
|
880
885
|
/**
|
|
@@ -900,8 +905,8 @@ export function crop_img_browser(source_canvas, width, height, left, top) {
|
|
|
900
905
|
* @param {number} level
|
|
901
906
|
*/
|
|
902
907
|
export function darken_hsl(img, level) {
|
|
903
|
-
|
|
904
|
-
|
|
908
|
+
_assertClass(img, PhotonImage);
|
|
909
|
+
wasm.darken_hsl(img.__wbg_ptr, level);
|
|
905
910
|
}
|
|
906
911
|
|
|
907
912
|
/**
|
|
@@ -927,8 +932,8 @@ export function darken_hsl(img, level) {
|
|
|
927
932
|
* @param {number} level
|
|
928
933
|
*/
|
|
929
934
|
export function darken_hsluv(img, level) {
|
|
930
|
-
|
|
931
|
-
|
|
935
|
+
_assertClass(img, PhotonImage);
|
|
936
|
+
wasm.darken_hsluv(img.__wbg_ptr, level);
|
|
932
937
|
}
|
|
933
938
|
|
|
934
939
|
/**
|
|
@@ -954,8 +959,8 @@ export function darken_hsluv(img, level) {
|
|
|
954
959
|
* @param {number} level
|
|
955
960
|
*/
|
|
956
961
|
export function darken_hsv(img, level) {
|
|
957
|
-
|
|
958
|
-
|
|
962
|
+
_assertClass(img, PhotonImage);
|
|
963
|
+
wasm.darken_hsv(img.__wbg_ptr, level);
|
|
959
964
|
}
|
|
960
965
|
|
|
961
966
|
/**
|
|
@@ -981,8 +986,8 @@ export function darken_hsv(img, level) {
|
|
|
981
986
|
* @param {number} level
|
|
982
987
|
*/
|
|
983
988
|
export function darken_lch(img, level) {
|
|
984
|
-
|
|
985
|
-
|
|
989
|
+
_assertClass(img, PhotonImage);
|
|
990
|
+
wasm.darken_lch(img.__wbg_ptr, level);
|
|
986
991
|
}
|
|
987
992
|
|
|
988
993
|
/**
|
|
@@ -1005,8 +1010,8 @@ export function darken_lch(img, level) {
|
|
|
1005
1010
|
* @param {number} brightness
|
|
1006
1011
|
*/
|
|
1007
1012
|
export function dec_brightness(photon_image, brightness) {
|
|
1008
|
-
|
|
1009
|
-
|
|
1013
|
+
_assertClass(photon_image, PhotonImage);
|
|
1014
|
+
wasm.dec_brightness(photon_image.__wbg_ptr, brightness);
|
|
1010
1015
|
}
|
|
1011
1016
|
|
|
1012
1017
|
/**
|
|
@@ -1028,8 +1033,8 @@ export function dec_brightness(photon_image, brightness) {
|
|
|
1028
1033
|
* @param {PhotonImage} img
|
|
1029
1034
|
*/
|
|
1030
1035
|
export function decompose_max(img) {
|
|
1031
|
-
|
|
1032
|
-
|
|
1036
|
+
_assertClass(img, PhotonImage);
|
|
1037
|
+
wasm.decompose_max(img.__wbg_ptr);
|
|
1033
1038
|
}
|
|
1034
1039
|
|
|
1035
1040
|
/**
|
|
@@ -1051,8 +1056,8 @@ export function decompose_max(img) {
|
|
|
1051
1056
|
* @param {PhotonImage} img
|
|
1052
1057
|
*/
|
|
1053
1058
|
export function decompose_min(img) {
|
|
1054
|
-
|
|
1055
|
-
|
|
1059
|
+
_assertClass(img, PhotonImage);
|
|
1060
|
+
wasm.decompose_min(img.__wbg_ptr);
|
|
1056
1061
|
}
|
|
1057
1062
|
|
|
1058
1063
|
/**
|
|
@@ -1073,8 +1078,8 @@ export function decompose_min(img) {
|
|
|
1073
1078
|
* @param {PhotonImage} img
|
|
1074
1079
|
*/
|
|
1075
1080
|
export function desaturate(img) {
|
|
1076
|
-
|
|
1077
|
-
|
|
1081
|
+
_assertClass(img, PhotonImage);
|
|
1082
|
+
wasm.desaturate(img.__wbg_ptr);
|
|
1078
1083
|
}
|
|
1079
1084
|
|
|
1080
1085
|
/**
|
|
@@ -1100,8 +1105,8 @@ export function desaturate(img) {
|
|
|
1100
1105
|
* @param {number} level
|
|
1101
1106
|
*/
|
|
1102
1107
|
export function desaturate_hsl(img, level) {
|
|
1103
|
-
|
|
1104
|
-
|
|
1108
|
+
_assertClass(img, PhotonImage);
|
|
1109
|
+
wasm.desaturate_hsl(img.__wbg_ptr, level);
|
|
1105
1110
|
}
|
|
1106
1111
|
|
|
1107
1112
|
/**
|
|
@@ -1127,8 +1132,8 @@ export function desaturate_hsl(img, level) {
|
|
|
1127
1132
|
* @param {number} level
|
|
1128
1133
|
*/
|
|
1129
1134
|
export function desaturate_hsluv(img, level) {
|
|
1130
|
-
|
|
1131
|
-
|
|
1135
|
+
_assertClass(img, PhotonImage);
|
|
1136
|
+
wasm.desaturate_hsluv(img.__wbg_ptr, level);
|
|
1132
1137
|
}
|
|
1133
1138
|
|
|
1134
1139
|
/**
|
|
@@ -1154,8 +1159,8 @@ export function desaturate_hsluv(img, level) {
|
|
|
1154
1159
|
* @param {number} level
|
|
1155
1160
|
*/
|
|
1156
1161
|
export function desaturate_hsv(img, level) {
|
|
1157
|
-
|
|
1158
|
-
|
|
1162
|
+
_assertClass(img, PhotonImage);
|
|
1163
|
+
wasm.desaturate_hsv(img.__wbg_ptr, level);
|
|
1159
1164
|
}
|
|
1160
1165
|
|
|
1161
1166
|
/**
|
|
@@ -1181,8 +1186,8 @@ export function desaturate_hsv(img, level) {
|
|
|
1181
1186
|
* @param {number} level
|
|
1182
1187
|
*/
|
|
1183
1188
|
export function desaturate_lch(img, level) {
|
|
1184
|
-
|
|
1185
|
-
|
|
1189
|
+
_assertClass(img, PhotonImage);
|
|
1190
|
+
wasm.desaturate_lch(img.__wbg_ptr, level);
|
|
1186
1191
|
}
|
|
1187
1192
|
|
|
1188
1193
|
/**
|
|
@@ -1204,8 +1209,8 @@ export function desaturate_lch(img, level) {
|
|
|
1204
1209
|
* @param {PhotonImage} photon_image
|
|
1205
1210
|
*/
|
|
1206
1211
|
export function detect_135_deg_lines(photon_image) {
|
|
1207
|
-
|
|
1208
|
-
|
|
1212
|
+
_assertClass(photon_image, PhotonImage);
|
|
1213
|
+
wasm.detect_135_deg_lines(photon_image.__wbg_ptr);
|
|
1209
1214
|
}
|
|
1210
1215
|
|
|
1211
1216
|
/**
|
|
@@ -1227,8 +1232,8 @@ export function detect_135_deg_lines(photon_image) {
|
|
|
1227
1232
|
* @param {PhotonImage} photon_image
|
|
1228
1233
|
*/
|
|
1229
1234
|
export function detect_45_deg_lines(photon_image) {
|
|
1230
|
-
|
|
1231
|
-
|
|
1235
|
+
_assertClass(photon_image, PhotonImage);
|
|
1236
|
+
wasm.detect_45_deg_lines(photon_image.__wbg_ptr);
|
|
1232
1237
|
}
|
|
1233
1238
|
|
|
1234
1239
|
/**
|
|
@@ -1250,8 +1255,8 @@ export function detect_45_deg_lines(photon_image) {
|
|
|
1250
1255
|
* @param {PhotonImage} photon_image
|
|
1251
1256
|
*/
|
|
1252
1257
|
export function detect_horizontal_lines(photon_image) {
|
|
1253
|
-
|
|
1254
|
-
|
|
1258
|
+
_assertClass(photon_image, PhotonImage);
|
|
1259
|
+
wasm.detect_horizontal_lines(photon_image.__wbg_ptr);
|
|
1255
1260
|
}
|
|
1256
1261
|
|
|
1257
1262
|
/**
|
|
@@ -1273,8 +1278,8 @@ export function detect_horizontal_lines(photon_image) {
|
|
|
1273
1278
|
* @param {PhotonImage} photon_image
|
|
1274
1279
|
*/
|
|
1275
1280
|
export function detect_vertical_lines(photon_image) {
|
|
1276
|
-
|
|
1277
|
-
|
|
1281
|
+
_assertClass(photon_image, PhotonImage);
|
|
1282
|
+
wasm.detect_vertical_lines(photon_image.__wbg_ptr);
|
|
1278
1283
|
}
|
|
1279
1284
|
|
|
1280
1285
|
/**
|
|
@@ -1298,8 +1303,8 @@ export function detect_vertical_lines(photon_image) {
|
|
|
1298
1303
|
* @param {number} depth
|
|
1299
1304
|
*/
|
|
1300
1305
|
export function dither(photon_image, depth) {
|
|
1301
|
-
|
|
1302
|
-
|
|
1306
|
+
_assertClass(photon_image, PhotonImage);
|
|
1307
|
+
wasm.dither(photon_image.__wbg_ptr, depth);
|
|
1303
1308
|
}
|
|
1304
1309
|
|
|
1305
1310
|
/**
|
|
@@ -1319,8 +1324,8 @@ export function dither(photon_image, depth) {
|
|
|
1319
1324
|
* @param {PhotonImage} img
|
|
1320
1325
|
*/
|
|
1321
1326
|
export function dramatic(img) {
|
|
1322
|
-
|
|
1323
|
-
|
|
1327
|
+
_assertClass(img, PhotonImage);
|
|
1328
|
+
wasm.dramatic(img.__wbg_ptr);
|
|
1324
1329
|
}
|
|
1325
1330
|
|
|
1326
1331
|
/**
|
|
@@ -1353,10 +1358,10 @@ export function dramatic(img) {
|
|
|
1353
1358
|
* @param {number} font_size
|
|
1354
1359
|
*/
|
|
1355
1360
|
export function draw_text(photon_img, text, x, y, font_size) {
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1361
|
+
_assertClass(photon_img, PhotonImage);
|
|
1362
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1363
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1364
|
+
wasm.draw_text(photon_img.__wbg_ptr, ptr0, len0, x, y, font_size);
|
|
1360
1365
|
}
|
|
1361
1366
|
|
|
1362
1367
|
/**
|
|
@@ -1389,10 +1394,10 @@ export function draw_text(photon_img, text, x, y, font_size) {
|
|
|
1389
1394
|
* @param {number} font_size
|
|
1390
1395
|
*/
|
|
1391
1396
|
export function draw_text_with_border(photon_img, text, x, y, font_size) {
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1397
|
+
_assertClass(photon_img, PhotonImage);
|
|
1398
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1399
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1400
|
+
wasm.draw_text_with_border(photon_img.__wbg_ptr, ptr0, len0, x, y, font_size);
|
|
1396
1401
|
}
|
|
1397
1402
|
|
|
1398
1403
|
/**
|
|
@@ -1401,12 +1406,12 @@ export function draw_text_with_border(photon_img, text, x, y, font_size) {
|
|
|
1401
1406
|
* @param {Rgb} color_b
|
|
1402
1407
|
*/
|
|
1403
1408
|
export function duotone(photon_image, color_a, color_b) {
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1409
|
+
_assertClass(photon_image, PhotonImage);
|
|
1410
|
+
_assertClass(color_a, Rgb);
|
|
1411
|
+
var ptr0 = color_a.__destroy_into_raw();
|
|
1412
|
+
_assertClass(color_b, Rgb);
|
|
1413
|
+
var ptr1 = color_b.__destroy_into_raw();
|
|
1414
|
+
wasm.duotone(photon_image.__wbg_ptr, ptr0, ptr1);
|
|
1410
1415
|
}
|
|
1411
1416
|
|
|
1412
1417
|
/**
|
|
@@ -1426,8 +1431,8 @@ export function duotone(photon_image, color_a, color_b) {
|
|
|
1426
1431
|
* @param {PhotonImage} img
|
|
1427
1432
|
*/
|
|
1428
1433
|
export function duotone_horizon(img) {
|
|
1429
|
-
|
|
1430
|
-
|
|
1434
|
+
_assertClass(img, PhotonImage);
|
|
1435
|
+
wasm.duotone_horizon(img.__wbg_ptr);
|
|
1431
1436
|
}
|
|
1432
1437
|
|
|
1433
1438
|
/**
|
|
@@ -1447,8 +1452,8 @@ export function duotone_horizon(img) {
|
|
|
1447
1452
|
* @param {PhotonImage} img
|
|
1448
1453
|
*/
|
|
1449
1454
|
export function duotone_lilac(img) {
|
|
1450
|
-
|
|
1451
|
-
|
|
1455
|
+
_assertClass(img, PhotonImage);
|
|
1456
|
+
wasm.duotone_lilac(img.__wbg_ptr);
|
|
1452
1457
|
}
|
|
1453
1458
|
|
|
1454
1459
|
/**
|
|
@@ -1468,8 +1473,8 @@ export function duotone_lilac(img) {
|
|
|
1468
1473
|
* @param {PhotonImage} img
|
|
1469
1474
|
*/
|
|
1470
1475
|
export function duotone_ochre(img) {
|
|
1471
|
-
|
|
1472
|
-
|
|
1476
|
+
_assertClass(img, PhotonImage);
|
|
1477
|
+
wasm.duotone_ochre(img.__wbg_ptr);
|
|
1473
1478
|
}
|
|
1474
1479
|
|
|
1475
1480
|
/**
|
|
@@ -1493,10 +1498,10 @@ export function duotone_ochre(img) {
|
|
|
1493
1498
|
* @param {Rgb} rgb_color
|
|
1494
1499
|
*/
|
|
1495
1500
|
export function duotone_tint(img, rgb_color) {
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1501
|
+
_assertClass(img, PhotonImage);
|
|
1502
|
+
_assertClass(rgb_color, Rgb);
|
|
1503
|
+
var ptr0 = rgb_color.__destroy_into_raw();
|
|
1504
|
+
wasm.duotone_tint(img.__wbg_ptr, ptr0);
|
|
1500
1505
|
}
|
|
1501
1506
|
|
|
1502
1507
|
/**
|
|
@@ -1516,8 +1521,8 @@ export function duotone_tint(img, rgb_color) {
|
|
|
1516
1521
|
* @param {PhotonImage} img
|
|
1517
1522
|
*/
|
|
1518
1523
|
export function duotone_violette(img) {
|
|
1519
|
-
|
|
1520
|
-
|
|
1524
|
+
_assertClass(img, PhotonImage);
|
|
1525
|
+
wasm.duotone_violette(img.__wbg_ptr);
|
|
1521
1526
|
}
|
|
1522
1527
|
|
|
1523
1528
|
/**
|
|
@@ -1539,8 +1544,8 @@ export function duotone_violette(img) {
|
|
|
1539
1544
|
* @param {PhotonImage} photon_image
|
|
1540
1545
|
*/
|
|
1541
1546
|
export function edge_detection(photon_image) {
|
|
1542
|
-
|
|
1543
|
-
|
|
1547
|
+
_assertClass(photon_image, PhotonImage);
|
|
1548
|
+
wasm.edge_detection(photon_image.__wbg_ptr);
|
|
1544
1549
|
}
|
|
1545
1550
|
|
|
1546
1551
|
/**
|
|
@@ -1562,8 +1567,8 @@ export function edge_detection(photon_image) {
|
|
|
1562
1567
|
* @param {PhotonImage} photon_image
|
|
1563
1568
|
*/
|
|
1564
1569
|
export function edge_one(photon_image) {
|
|
1565
|
-
|
|
1566
|
-
|
|
1570
|
+
_assertClass(photon_image, PhotonImage);
|
|
1571
|
+
wasm.edge_one(photon_image.__wbg_ptr);
|
|
1567
1572
|
}
|
|
1568
1573
|
|
|
1569
1574
|
/**
|
|
@@ -1585,8 +1590,8 @@ export function edge_one(photon_image) {
|
|
|
1585
1590
|
* @param {PhotonImage} photon_image
|
|
1586
1591
|
*/
|
|
1587
1592
|
export function emboss(photon_image) {
|
|
1588
|
-
|
|
1589
|
-
|
|
1593
|
+
_assertClass(photon_image, PhotonImage);
|
|
1594
|
+
wasm.emboss(photon_image.__wbg_ptr);
|
|
1590
1595
|
}
|
|
1591
1596
|
|
|
1592
1597
|
/**
|
|
@@ -1624,10 +1629,10 @@ export function emboss(photon_image) {
|
|
|
1624
1629
|
* @param {string} filter_name
|
|
1625
1630
|
*/
|
|
1626
1631
|
export function filter(img, filter_name) {
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1632
|
+
_assertClass(img, PhotonImage);
|
|
1633
|
+
const ptr0 = passStringToWasm0(filter_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1634
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1635
|
+
wasm.filter(img.__wbg_ptr, ptr0, len0);
|
|
1631
1636
|
}
|
|
1632
1637
|
|
|
1633
1638
|
/**
|
|
@@ -1647,8 +1652,8 @@ export function filter(img, filter_name) {
|
|
|
1647
1652
|
* @param {PhotonImage} img
|
|
1648
1653
|
*/
|
|
1649
1654
|
export function firenze(img) {
|
|
1650
|
-
|
|
1651
|
-
|
|
1655
|
+
_assertClass(img, PhotonImage);
|
|
1656
|
+
wasm.firenze(img.__wbg_ptr);
|
|
1652
1657
|
}
|
|
1653
1658
|
|
|
1654
1659
|
/**
|
|
@@ -1670,8 +1675,8 @@ export function firenze(img) {
|
|
|
1670
1675
|
* @param {PhotonImage} photon_image
|
|
1671
1676
|
*/
|
|
1672
1677
|
export function fliph(photon_image) {
|
|
1673
|
-
|
|
1674
|
-
|
|
1678
|
+
_assertClass(photon_image, PhotonImage);
|
|
1679
|
+
wasm.fliph(photon_image.__wbg_ptr);
|
|
1675
1680
|
}
|
|
1676
1681
|
|
|
1677
1682
|
/**
|
|
@@ -1693,8 +1698,8 @@ export function fliph(photon_image) {
|
|
|
1693
1698
|
* @param {PhotonImage} photon_image
|
|
1694
1699
|
*/
|
|
1695
1700
|
export function flipv(photon_image) {
|
|
1696
|
-
|
|
1697
|
-
|
|
1701
|
+
_assertClass(photon_image, PhotonImage);
|
|
1702
|
+
wasm.flipv(photon_image.__wbg_ptr);
|
|
1698
1703
|
}
|
|
1699
1704
|
|
|
1700
1705
|
/**
|
|
@@ -1715,8 +1720,8 @@ export function flipv(photon_image) {
|
|
|
1715
1720
|
* @param {PhotonImage} photon_image
|
|
1716
1721
|
*/
|
|
1717
1722
|
export function frosted_glass(photon_image) {
|
|
1718
|
-
|
|
1719
|
-
|
|
1723
|
+
_assertClass(photon_image, PhotonImage);
|
|
1724
|
+
wasm.frosted_glass(photon_image.__wbg_ptr);
|
|
1720
1725
|
}
|
|
1721
1726
|
|
|
1722
1727
|
/**
|
|
@@ -1737,8 +1742,8 @@ export function frosted_glass(photon_image) {
|
|
|
1737
1742
|
* @param {PhotonImage} photon_image
|
|
1738
1743
|
*/
|
|
1739
1744
|
export function g_grayscale(photon_image) {
|
|
1740
|
-
|
|
1741
|
-
|
|
1745
|
+
_assertClass(photon_image, PhotonImage);
|
|
1746
|
+
wasm.g_grayscale(photon_image.__wbg_ptr);
|
|
1742
1747
|
}
|
|
1743
1748
|
|
|
1744
1749
|
/**
|
|
@@ -1764,8 +1769,8 @@ export function g_grayscale(photon_image) {
|
|
|
1764
1769
|
* @param {number} blue
|
|
1765
1770
|
*/
|
|
1766
1771
|
export function gamma_correction(photon_image, red, green, blue) {
|
|
1767
|
-
|
|
1768
|
-
|
|
1772
|
+
_assertClass(photon_image, PhotonImage);
|
|
1773
|
+
wasm.gamma_correction(photon_image.__wbg_ptr, red, green, blue);
|
|
1769
1774
|
}
|
|
1770
1775
|
|
|
1771
1776
|
/**
|
|
@@ -1789,8 +1794,8 @@ export function gamma_correction(photon_image, red, green, blue) {
|
|
|
1789
1794
|
* @param {number} radius
|
|
1790
1795
|
*/
|
|
1791
1796
|
export function gaussian_blur(photon_image, radius) {
|
|
1792
|
-
|
|
1793
|
-
|
|
1797
|
+
_assertClass(photon_image, PhotonImage);
|
|
1798
|
+
wasm.gaussian_blur(photon_image.__wbg_ptr, radius);
|
|
1794
1799
|
}
|
|
1795
1800
|
|
|
1796
1801
|
/**
|
|
@@ -1800,8 +1805,8 @@ export function gaussian_blur(photon_image, radius) {
|
|
|
1800
1805
|
* @returns {ImageData}
|
|
1801
1806
|
*/
|
|
1802
1807
|
export function get_image_data(canvas, ctx) {
|
|
1803
|
-
|
|
1804
|
-
|
|
1808
|
+
const ret = wasm.get_image_data(canvas, ctx);
|
|
1809
|
+
return ret;
|
|
1805
1810
|
}
|
|
1806
1811
|
|
|
1807
1812
|
/**
|
|
@@ -1821,8 +1826,8 @@ export function get_image_data(canvas, ctx) {
|
|
|
1821
1826
|
* @param {PhotonImage} img
|
|
1822
1827
|
*/
|
|
1823
1828
|
export function golden(img) {
|
|
1824
|
-
|
|
1825
|
-
|
|
1829
|
+
_assertClass(img, PhotonImage);
|
|
1830
|
+
wasm.golden(img.__wbg_ptr);
|
|
1826
1831
|
}
|
|
1827
1832
|
|
|
1828
1833
|
/**
|
|
@@ -1843,8 +1848,8 @@ export function golden(img) {
|
|
|
1843
1848
|
* @param {PhotonImage} img
|
|
1844
1849
|
*/
|
|
1845
1850
|
export function grayscale(img) {
|
|
1846
|
-
|
|
1847
|
-
|
|
1851
|
+
_assertClass(img, PhotonImage);
|
|
1852
|
+
wasm.grayscale(img.__wbg_ptr);
|
|
1848
1853
|
}
|
|
1849
1854
|
|
|
1850
1855
|
/**
|
|
@@ -1865,8 +1870,8 @@ export function grayscale(img) {
|
|
|
1865
1870
|
* @param {PhotonImage} img
|
|
1866
1871
|
*/
|
|
1867
1872
|
export function grayscale_human_corrected(img) {
|
|
1868
|
-
|
|
1869
|
-
|
|
1873
|
+
_assertClass(img, PhotonImage);
|
|
1874
|
+
wasm.grayscale_human_corrected(img.__wbg_ptr);
|
|
1870
1875
|
}
|
|
1871
1876
|
|
|
1872
1877
|
/**
|
|
@@ -1890,8 +1895,8 @@ export function grayscale_human_corrected(img) {
|
|
|
1890
1895
|
* @param {number} num_shades
|
|
1891
1896
|
*/
|
|
1892
1897
|
export function grayscale_shades(photon_image, num_shades) {
|
|
1893
|
-
|
|
1894
|
-
|
|
1898
|
+
_assertClass(photon_image, PhotonImage);
|
|
1899
|
+
wasm.grayscale_shades(photon_image.__wbg_ptr, num_shades);
|
|
1895
1900
|
}
|
|
1896
1901
|
|
|
1897
1902
|
/**
|
|
@@ -1912,8 +1917,8 @@ export function grayscale_shades(photon_image, num_shades) {
|
|
|
1912
1917
|
* @param {PhotonImage} photon_image
|
|
1913
1918
|
*/
|
|
1914
1919
|
export function halftone(photon_image) {
|
|
1915
|
-
|
|
1916
|
-
|
|
1920
|
+
_assertClass(photon_image, PhotonImage);
|
|
1921
|
+
wasm.halftone(photon_image.__wbg_ptr);
|
|
1917
1922
|
}
|
|
1918
1923
|
|
|
1919
1924
|
/**
|
|
@@ -1936,8 +1941,8 @@ export function halftone(photon_image) {
|
|
|
1936
1941
|
* @param {number} num_strips
|
|
1937
1942
|
*/
|
|
1938
1943
|
export function horizontal_strips(photon_image, num_strips) {
|
|
1939
|
-
|
|
1940
|
-
|
|
1944
|
+
_assertClass(photon_image, PhotonImage);
|
|
1945
|
+
wasm.horizontal_strips(photon_image.__wbg_ptr, num_strips);
|
|
1941
1946
|
}
|
|
1942
1947
|
|
|
1943
1948
|
/**
|
|
@@ -1969,10 +1974,10 @@ export function horizontal_strips(photon_image, num_strips) {
|
|
|
1969
1974
|
* @param {number} amt
|
|
1970
1975
|
*/
|
|
1971
1976
|
export function hsl(photon_image, mode, amt) {
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1977
|
+
_assertClass(photon_image, PhotonImage);
|
|
1978
|
+
const ptr0 = passStringToWasm0(mode, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1979
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1980
|
+
wasm.hsl(photon_image.__wbg_ptr, ptr0, len0, amt);
|
|
1976
1981
|
}
|
|
1977
1982
|
|
|
1978
1983
|
/**
|
|
@@ -2004,10 +2009,10 @@ export function hsl(photon_image, mode, amt) {
|
|
|
2004
2009
|
* @param {number} amt
|
|
2005
2010
|
*/
|
|
2006
2011
|
export function hsluv(photon_image, mode, amt) {
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2012
|
+
_assertClass(photon_image, PhotonImage);
|
|
2013
|
+
const ptr0 = passStringToWasm0(mode, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2014
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2015
|
+
wasm.hsluv(photon_image.__wbg_ptr, ptr0, len0, amt);
|
|
2011
2016
|
}
|
|
2012
2017
|
|
|
2013
2018
|
/**
|
|
@@ -2040,10 +2045,10 @@ export function hsluv(photon_image, mode, amt) {
|
|
|
2040
2045
|
* @param {number} amt
|
|
2041
2046
|
*/
|
|
2042
2047
|
export function hsv(photon_image, mode, amt) {
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2048
|
+
_assertClass(photon_image, PhotonImage);
|
|
2049
|
+
const ptr0 = passStringToWasm0(mode, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2050
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2051
|
+
wasm.hsv(photon_image.__wbg_ptr, ptr0, len0, amt);
|
|
2047
2052
|
}
|
|
2048
2053
|
|
|
2049
2054
|
/**
|
|
@@ -2066,8 +2071,8 @@ export function hsv(photon_image, mode, amt) {
|
|
|
2066
2071
|
* @param {number} degrees
|
|
2067
2072
|
*/
|
|
2068
2073
|
export function hue_rotate_hsl(img, degrees) {
|
|
2069
|
-
|
|
2070
|
-
|
|
2074
|
+
_assertClass(img, PhotonImage);
|
|
2075
|
+
wasm.hue_rotate_hsl(img.__wbg_ptr, degrees);
|
|
2071
2076
|
}
|
|
2072
2077
|
|
|
2073
2078
|
/**
|
|
@@ -2090,8 +2095,8 @@ export function hue_rotate_hsl(img, degrees) {
|
|
|
2090
2095
|
* @param {number} degrees
|
|
2091
2096
|
*/
|
|
2092
2097
|
export function hue_rotate_hsluv(img, degrees) {
|
|
2093
|
-
|
|
2094
|
-
|
|
2098
|
+
_assertClass(img, PhotonImage);
|
|
2099
|
+
wasm.hue_rotate_hsluv(img.__wbg_ptr, degrees);
|
|
2095
2100
|
}
|
|
2096
2101
|
|
|
2097
2102
|
/**
|
|
@@ -2114,8 +2119,8 @@ export function hue_rotate_hsluv(img, degrees) {
|
|
|
2114
2119
|
* @param {number} degrees
|
|
2115
2120
|
*/
|
|
2116
2121
|
export function hue_rotate_hsv(img, degrees) {
|
|
2117
|
-
|
|
2118
|
-
|
|
2122
|
+
_assertClass(img, PhotonImage);
|
|
2123
|
+
wasm.hue_rotate_hsv(img.__wbg_ptr, degrees);
|
|
2119
2124
|
}
|
|
2120
2125
|
|
|
2121
2126
|
/**
|
|
@@ -2138,8 +2143,8 @@ export function hue_rotate_hsv(img, degrees) {
|
|
|
2138
2143
|
* @param {number} degrees
|
|
2139
2144
|
*/
|
|
2140
2145
|
export function hue_rotate_lch(img, degrees) {
|
|
2141
|
-
|
|
2142
|
-
|
|
2146
|
+
_assertClass(img, PhotonImage);
|
|
2147
|
+
wasm.hue_rotate_lch(img.__wbg_ptr, degrees);
|
|
2143
2148
|
}
|
|
2144
2149
|
|
|
2145
2150
|
/**
|
|
@@ -2161,8 +2166,8 @@ export function hue_rotate_lch(img, degrees) {
|
|
|
2161
2166
|
* @param {PhotonImage} photon_image
|
|
2162
2167
|
*/
|
|
2163
2168
|
export function identity(photon_image) {
|
|
2164
|
-
|
|
2165
|
-
|
|
2169
|
+
_assertClass(photon_image, PhotonImage);
|
|
2170
|
+
wasm.identity(photon_image.__wbg_ptr);
|
|
2166
2171
|
}
|
|
2167
2172
|
|
|
2168
2173
|
/**
|
|
@@ -2184,8 +2189,8 @@ export function identity(photon_image) {
|
|
|
2184
2189
|
* @param {number} brightness
|
|
2185
2190
|
*/
|
|
2186
2191
|
export function inc_brightness(photon_image, brightness) {
|
|
2187
|
-
|
|
2188
|
-
|
|
2192
|
+
_assertClass(photon_image, PhotonImage);
|
|
2193
|
+
wasm.inc_brightness(photon_image.__wbg_ptr, brightness);
|
|
2189
2194
|
}
|
|
2190
2195
|
|
|
2191
2196
|
/**
|
|
@@ -2205,8 +2210,8 @@ export function inc_brightness(photon_image, brightness) {
|
|
|
2205
2210
|
* @param {PhotonImage} photon_image
|
|
2206
2211
|
*/
|
|
2207
2212
|
export function invert(photon_image) {
|
|
2208
|
-
|
|
2209
|
-
|
|
2213
|
+
_assertClass(photon_image, PhotonImage);
|
|
2214
|
+
wasm.invert(photon_image.__wbg_ptr);
|
|
2210
2215
|
}
|
|
2211
2216
|
|
|
2212
2217
|
/**
|
|
@@ -2228,8 +2233,8 @@ export function invert(photon_image) {
|
|
|
2228
2233
|
* @param {PhotonImage} photon_image
|
|
2229
2234
|
*/
|
|
2230
2235
|
export function laplace(photon_image) {
|
|
2231
|
-
|
|
2232
|
-
|
|
2236
|
+
_assertClass(photon_image, PhotonImage);
|
|
2237
|
+
wasm.laplace(photon_image.__wbg_ptr);
|
|
2233
2238
|
}
|
|
2234
2239
|
|
|
2235
2240
|
/**
|
|
@@ -2261,10 +2266,10 @@ export function laplace(photon_image) {
|
|
|
2261
2266
|
* @param {number} amt
|
|
2262
2267
|
*/
|
|
2263
2268
|
export function lch(photon_image, mode, amt) {
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2269
|
+
_assertClass(photon_image, PhotonImage);
|
|
2270
|
+
const ptr0 = passStringToWasm0(mode, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2271
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2272
|
+
wasm.lch(photon_image.__wbg_ptr, ptr0, len0, amt);
|
|
2268
2273
|
}
|
|
2269
2274
|
|
|
2270
2275
|
/**
|
|
@@ -2289,8 +2294,8 @@ export function lch(photon_image, mode, amt) {
|
|
|
2289
2294
|
* @param {number} level
|
|
2290
2295
|
*/
|
|
2291
2296
|
export function lighten_hsl(img, level) {
|
|
2292
|
-
|
|
2293
|
-
|
|
2297
|
+
_assertClass(img, PhotonImage);
|
|
2298
|
+
wasm.lighten_hsl(img.__wbg_ptr, level);
|
|
2294
2299
|
}
|
|
2295
2300
|
|
|
2296
2301
|
/**
|
|
@@ -2316,8 +2321,8 @@ export function lighten_hsl(img, level) {
|
|
|
2316
2321
|
* @param {number} level
|
|
2317
2322
|
*/
|
|
2318
2323
|
export function lighten_hsluv(img, level) {
|
|
2319
|
-
|
|
2320
|
-
|
|
2324
|
+
_assertClass(img, PhotonImage);
|
|
2325
|
+
wasm.lighten_hsluv(img.__wbg_ptr, level);
|
|
2321
2326
|
}
|
|
2322
2327
|
|
|
2323
2328
|
/**
|
|
@@ -2343,8 +2348,8 @@ export function lighten_hsluv(img, level) {
|
|
|
2343
2348
|
* @param {number} level
|
|
2344
2349
|
*/
|
|
2345
2350
|
export function lighten_hsv(img, level) {
|
|
2346
|
-
|
|
2347
|
-
|
|
2351
|
+
_assertClass(img, PhotonImage);
|
|
2352
|
+
wasm.lighten_hsv(img.__wbg_ptr, level);
|
|
2348
2353
|
}
|
|
2349
2354
|
|
|
2350
2355
|
/**
|
|
@@ -2370,8 +2375,8 @@ export function lighten_hsv(img, level) {
|
|
|
2370
2375
|
* @param {number} level
|
|
2371
2376
|
*/
|
|
2372
2377
|
export function lighten_lch(img, level) {
|
|
2373
|
-
|
|
2374
|
-
|
|
2378
|
+
_assertClass(img, PhotonImage);
|
|
2379
|
+
wasm.lighten_lch(img.__wbg_ptr, level);
|
|
2375
2380
|
}
|
|
2376
2381
|
|
|
2377
2382
|
/**
|
|
@@ -2391,8 +2396,8 @@ export function lighten_lch(img, level) {
|
|
|
2391
2396
|
* @param {PhotonImage} photon_image
|
|
2392
2397
|
*/
|
|
2393
2398
|
export function lix(photon_image) {
|
|
2394
|
-
|
|
2395
|
-
|
|
2399
|
+
_assertClass(photon_image, PhotonImage);
|
|
2400
|
+
wasm.lix(photon_image.__wbg_ptr);
|
|
2396
2401
|
}
|
|
2397
2402
|
|
|
2398
2403
|
/**
|
|
@@ -2412,8 +2417,8 @@ export function lix(photon_image) {
|
|
|
2412
2417
|
* @param {PhotonImage} img
|
|
2413
2418
|
*/
|
|
2414
2419
|
export function lofi(img) {
|
|
2415
|
-
|
|
2416
|
-
|
|
2420
|
+
_assertClass(img, PhotonImage);
|
|
2421
|
+
wasm.lofi(img.__wbg_ptr);
|
|
2417
2422
|
}
|
|
2418
2423
|
|
|
2419
2424
|
/**
|
|
@@ -2445,10 +2450,10 @@ export function lofi(img) {
|
|
|
2445
2450
|
* @param {number} opacity
|
|
2446
2451
|
*/
|
|
2447
2452
|
export function mix_with_colour(photon_image, mix_colour, opacity) {
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2453
|
+
_assertClass(photon_image, PhotonImage);
|
|
2454
|
+
_assertClass(mix_colour, Rgb);
|
|
2455
|
+
var ptr0 = mix_colour.__destroy_into_raw();
|
|
2456
|
+
wasm.mix_with_colour(photon_image.__wbg_ptr, ptr0, opacity);
|
|
2452
2457
|
}
|
|
2453
2458
|
|
|
2454
2459
|
/**
|
|
@@ -2478,8 +2483,8 @@ export function mix_with_colour(photon_image, mix_colour, opacity) {
|
|
|
2478
2483
|
* @param {number} b_offset
|
|
2479
2484
|
*/
|
|
2480
2485
|
export function monochrome(img, r_offset, g_offset, b_offset) {
|
|
2481
|
-
|
|
2482
|
-
|
|
2486
|
+
_assertClass(img, PhotonImage);
|
|
2487
|
+
wasm.monochrome(img.__wbg_ptr, r_offset, g_offset, b_offset);
|
|
2483
2488
|
}
|
|
2484
2489
|
|
|
2485
2490
|
/**
|
|
@@ -2503,10 +2508,10 @@ export function monochrome(img, r_offset, g_offset, b_offset) {
|
|
|
2503
2508
|
* @param {Rgb} rgb_color
|
|
2504
2509
|
*/
|
|
2505
2510
|
export function monochrome_tint(img, rgb_color) {
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2511
|
+
_assertClass(img, PhotonImage);
|
|
2512
|
+
_assertClass(rgb_color, Rgb);
|
|
2513
|
+
var ptr0 = rgb_color.__destroy_into_raw();
|
|
2514
|
+
wasm.monochrome_tint(img.__wbg_ptr, ptr0);
|
|
2510
2515
|
}
|
|
2511
2516
|
|
|
2512
2517
|
/**
|
|
@@ -2531,8 +2536,8 @@ export function monochrome_tint(img, rgb_color) {
|
|
|
2531
2536
|
* @param {number} channel_index2
|
|
2532
2537
|
*/
|
|
2533
2538
|
export function multiple_offsets(photon_image, offset, channel_index, channel_index2) {
|
|
2534
|
-
|
|
2535
|
-
|
|
2539
|
+
_assertClass(photon_image, PhotonImage);
|
|
2540
|
+
wasm.multiple_offsets(photon_image.__wbg_ptr, offset, channel_index, channel_index2);
|
|
2536
2541
|
}
|
|
2537
2542
|
|
|
2538
2543
|
/**
|
|
@@ -2552,8 +2557,8 @@ export function multiple_offsets(photon_image, offset, channel_index, channel_in
|
|
|
2552
2557
|
* @param {PhotonImage} photon_image
|
|
2553
2558
|
*/
|
|
2554
2559
|
export function neue(photon_image) {
|
|
2555
|
-
|
|
2556
|
-
|
|
2560
|
+
_assertClass(photon_image, PhotonImage);
|
|
2561
|
+
wasm.neue(photon_image.__wbg_ptr);
|
|
2557
2562
|
}
|
|
2558
2563
|
|
|
2559
2564
|
/**
|
|
@@ -2576,8 +2581,8 @@ export function neue(photon_image) {
|
|
|
2576
2581
|
* @param {PhotonImage} photon_image
|
|
2577
2582
|
*/
|
|
2578
2583
|
export function noise_reduction(photon_image) {
|
|
2579
|
-
|
|
2580
|
-
|
|
2584
|
+
_assertClass(photon_image, PhotonImage);
|
|
2585
|
+
wasm.noise_reduction(photon_image.__wbg_ptr);
|
|
2581
2586
|
}
|
|
2582
2587
|
|
|
2583
2588
|
/**
|
|
@@ -2599,8 +2604,8 @@ export function noise_reduction(photon_image) {
|
|
|
2599
2604
|
* @param {PhotonImage} photon_image
|
|
2600
2605
|
*/
|
|
2601
2606
|
export function normalize(photon_image) {
|
|
2602
|
-
|
|
2603
|
-
|
|
2607
|
+
_assertClass(photon_image, PhotonImage);
|
|
2608
|
+
wasm.normalize(photon_image.__wbg_ptr);
|
|
2604
2609
|
}
|
|
2605
2610
|
|
|
2606
2611
|
/**
|
|
@@ -2620,8 +2625,8 @@ export function normalize(photon_image) {
|
|
|
2620
2625
|
* @param {PhotonImage} img
|
|
2621
2626
|
*/
|
|
2622
2627
|
export function obsidian(img) {
|
|
2623
|
-
|
|
2624
|
-
|
|
2628
|
+
_assertClass(img, PhotonImage);
|
|
2629
|
+
wasm.obsidian(img.__wbg_ptr);
|
|
2625
2630
|
}
|
|
2626
2631
|
|
|
2627
2632
|
/**
|
|
@@ -2648,8 +2653,8 @@ export function obsidian(img) {
|
|
|
2648
2653
|
* @param {number} offset
|
|
2649
2654
|
*/
|
|
2650
2655
|
export function offset(photon_image, channel_index, offset) {
|
|
2651
|
-
|
|
2652
|
-
|
|
2656
|
+
_assertClass(photon_image, PhotonImage);
|
|
2657
|
+
wasm.offset(photon_image.__wbg_ptr, channel_index, offset);
|
|
2653
2658
|
}
|
|
2654
2659
|
|
|
2655
2660
|
/**
|
|
@@ -2672,8 +2677,8 @@ export function offset(photon_image, channel_index, offset) {
|
|
|
2672
2677
|
* @param {number} offset_amt
|
|
2673
2678
|
*/
|
|
2674
2679
|
export function offset_blue(img, offset_amt) {
|
|
2675
|
-
|
|
2676
|
-
|
|
2680
|
+
_assertClass(img, PhotonImage);
|
|
2681
|
+
wasm.offset_blue(img.__wbg_ptr, offset_amt);
|
|
2677
2682
|
}
|
|
2678
2683
|
|
|
2679
2684
|
/**
|
|
@@ -2696,8 +2701,8 @@ export function offset_blue(img, offset_amt) {
|
|
|
2696
2701
|
* @param {number} offset_amt
|
|
2697
2702
|
*/
|
|
2698
2703
|
export function offset_green(img, offset_amt) {
|
|
2699
|
-
|
|
2700
|
-
|
|
2704
|
+
_assertClass(img, PhotonImage);
|
|
2705
|
+
wasm.offset_green(img.__wbg_ptr, offset_amt);
|
|
2701
2706
|
}
|
|
2702
2707
|
|
|
2703
2708
|
/**
|
|
@@ -2720,8 +2725,8 @@ export function offset_green(img, offset_amt) {
|
|
|
2720
2725
|
* @param {number} offset_amt
|
|
2721
2726
|
*/
|
|
2722
2727
|
export function offset_red(img, offset_amt) {
|
|
2723
|
-
|
|
2724
|
-
|
|
2728
|
+
_assertClass(img, PhotonImage);
|
|
2729
|
+
wasm.offset_red(img.__wbg_ptr, offset_amt);
|
|
2725
2730
|
}
|
|
2726
2731
|
|
|
2727
2732
|
/**
|
|
@@ -2746,8 +2751,8 @@ export function offset_red(img, offset_amt) {
|
|
|
2746
2751
|
* @param {number} intensity
|
|
2747
2752
|
*/
|
|
2748
2753
|
export function oil(photon_image, radius, intensity) {
|
|
2749
|
-
|
|
2750
|
-
|
|
2754
|
+
_assertClass(photon_image, PhotonImage);
|
|
2755
|
+
wasm.oil(photon_image.__wbg_ptr, radius, intensity);
|
|
2751
2756
|
}
|
|
2752
2757
|
|
|
2753
2758
|
/**
|
|
@@ -2760,8 +2765,8 @@ export function oil(photon_image, radius, intensity) {
|
|
|
2760
2765
|
* @returns {PhotonImage}
|
|
2761
2766
|
*/
|
|
2762
2767
|
export function open_image(canvas, ctx) {
|
|
2763
|
-
|
|
2764
|
-
|
|
2768
|
+
const ret = wasm.open_image(canvas, ctx);
|
|
2769
|
+
return PhotonImage.__wrap(ret);
|
|
2765
2770
|
}
|
|
2766
2771
|
|
|
2767
2772
|
/**
|
|
@@ -2790,11 +2795,11 @@ export function open_image(canvas, ctx) {
|
|
|
2790
2795
|
* @returns {PhotonImage}
|
|
2791
2796
|
*/
|
|
2792
2797
|
export function padding_bottom(img, padding, padding_rgba) {
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
+
_assertClass(img, PhotonImage);
|
|
2799
|
+
_assertClass(padding_rgba, Rgba);
|
|
2800
|
+
var ptr0 = padding_rgba.__destroy_into_raw();
|
|
2801
|
+
const ret = wasm.padding_bottom(img.__wbg_ptr, padding, ptr0);
|
|
2802
|
+
return PhotonImage.__wrap(ret);
|
|
2798
2803
|
}
|
|
2799
2804
|
|
|
2800
2805
|
/**
|
|
@@ -2823,11 +2828,11 @@ export function padding_bottom(img, padding, padding_rgba) {
|
|
|
2823
2828
|
* @returns {PhotonImage}
|
|
2824
2829
|
*/
|
|
2825
2830
|
export function padding_left(img, padding, padding_rgba) {
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
+
_assertClass(img, PhotonImage);
|
|
2832
|
+
_assertClass(padding_rgba, Rgba);
|
|
2833
|
+
var ptr0 = padding_rgba.__destroy_into_raw();
|
|
2834
|
+
const ret = wasm.padding_left(img.__wbg_ptr, padding, ptr0);
|
|
2835
|
+
return PhotonImage.__wrap(ret);
|
|
2831
2836
|
}
|
|
2832
2837
|
|
|
2833
2838
|
/**
|
|
@@ -2856,11 +2861,11 @@ export function padding_left(img, padding, padding_rgba) {
|
|
|
2856
2861
|
* @returns {PhotonImage}
|
|
2857
2862
|
*/
|
|
2858
2863
|
export function padding_right(img, padding, padding_rgba) {
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
+
_assertClass(img, PhotonImage);
|
|
2865
|
+
_assertClass(padding_rgba, Rgba);
|
|
2866
|
+
var ptr0 = padding_rgba.__destroy_into_raw();
|
|
2867
|
+
const ret = wasm.padding_right(img.__wbg_ptr, padding, ptr0);
|
|
2868
|
+
return PhotonImage.__wrap(ret);
|
|
2864
2869
|
}
|
|
2865
2870
|
|
|
2866
2871
|
/**
|
|
@@ -2889,11 +2894,11 @@ export function padding_right(img, padding, padding_rgba) {
|
|
|
2889
2894
|
* @returns {PhotonImage}
|
|
2890
2895
|
*/
|
|
2891
2896
|
export function padding_top(img, padding, padding_rgba) {
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
+
_assertClass(img, PhotonImage);
|
|
2898
|
+
_assertClass(padding_rgba, Rgba);
|
|
2899
|
+
var ptr0 = padding_rgba.__destroy_into_raw();
|
|
2900
|
+
const ret = wasm.padding_top(img.__wbg_ptr, padding, ptr0);
|
|
2901
|
+
return PhotonImage.__wrap(ret);
|
|
2897
2902
|
}
|
|
2898
2903
|
|
|
2899
2904
|
/**
|
|
@@ -2922,11 +2927,11 @@ export function padding_top(img, padding, padding_rgba) {
|
|
|
2922
2927
|
* @returns {PhotonImage}
|
|
2923
2928
|
*/
|
|
2924
2929
|
export function padding_uniform(img, padding, padding_rgba) {
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
+
_assertClass(img, PhotonImage);
|
|
2931
|
+
_assertClass(padding_rgba, Rgba);
|
|
2932
|
+
var ptr0 = padding_rgba.__destroy_into_raw();
|
|
2933
|
+
const ret = wasm.padding_uniform(img.__wbg_ptr, padding, ptr0);
|
|
2934
|
+
return PhotonImage.__wrap(ret);
|
|
2930
2935
|
}
|
|
2931
2936
|
|
|
2932
2937
|
/**
|
|
@@ -2946,8 +2951,8 @@ export function padding_uniform(img, padding, padding_rgba) {
|
|
|
2946
2951
|
* @param {PhotonImage} img
|
|
2947
2952
|
*/
|
|
2948
2953
|
export function pastel_pink(img) {
|
|
2949
|
-
|
|
2950
|
-
|
|
2954
|
+
_assertClass(img, PhotonImage);
|
|
2955
|
+
wasm.pastel_pink(img.__wbg_ptr);
|
|
2951
2956
|
}
|
|
2952
2957
|
|
|
2953
2958
|
/**
|
|
@@ -2971,8 +2976,8 @@ export function pastel_pink(img) {
|
|
|
2971
2976
|
* @param {PhotonImage} photon_image
|
|
2972
2977
|
*/
|
|
2973
2978
|
export function pink_noise(photon_image) {
|
|
2974
|
-
|
|
2975
|
-
|
|
2979
|
+
_assertClass(photon_image, PhotonImage);
|
|
2980
|
+
wasm.pink_noise(photon_image.__wbg_ptr);
|
|
2976
2981
|
}
|
|
2977
2982
|
|
|
2978
2983
|
/**
|
|
@@ -2995,8 +3000,8 @@ export function pink_noise(photon_image) {
|
|
|
2995
3000
|
* @param {number} pixel_size
|
|
2996
3001
|
*/
|
|
2997
3002
|
export function pixelize(photon_image, pixel_size) {
|
|
2998
|
-
|
|
2999
|
-
|
|
3003
|
+
_assertClass(photon_image, PhotonImage);
|
|
3004
|
+
wasm.pixelize(photon_image.__wbg_ptr, pixel_size);
|
|
3000
3005
|
}
|
|
3001
3006
|
|
|
3002
3007
|
/**
|
|
@@ -3018,8 +3023,8 @@ export function pixelize(photon_image, pixel_size) {
|
|
|
3018
3023
|
* @param {PhotonImage} photon_image
|
|
3019
3024
|
*/
|
|
3020
3025
|
export function prewitt_horizontal(photon_image) {
|
|
3021
|
-
|
|
3022
|
-
|
|
3026
|
+
_assertClass(photon_image, PhotonImage);
|
|
3027
|
+
wasm.prewitt_horizontal(photon_image.__wbg_ptr);
|
|
3023
3028
|
}
|
|
3024
3029
|
|
|
3025
3030
|
/**
|
|
@@ -3040,8 +3045,8 @@ export function prewitt_horizontal(photon_image) {
|
|
|
3040
3045
|
* @param {PhotonImage} img
|
|
3041
3046
|
*/
|
|
3042
3047
|
export function primary(img) {
|
|
3043
|
-
|
|
3044
|
-
|
|
3048
|
+
_assertClass(img, PhotonImage);
|
|
3049
|
+
wasm.primary(img.__wbg_ptr);
|
|
3045
3050
|
}
|
|
3046
3051
|
|
|
3047
3052
|
/**
|
|
@@ -3051,9 +3056,9 @@ export function primary(img) {
|
|
|
3051
3056
|
* @param {PhotonImage} new_image
|
|
3052
3057
|
*/
|
|
3053
3058
|
export function putImageData(canvas, ctx, new_image) {
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3059
|
+
_assertClass(new_image, PhotonImage);
|
|
3060
|
+
var ptr0 = new_image.__destroy_into_raw();
|
|
3061
|
+
wasm.putImageData(canvas, ctx, ptr0);
|
|
3057
3062
|
}
|
|
3058
3063
|
|
|
3059
3064
|
/**
|
|
@@ -3074,8 +3079,8 @@ export function putImageData(canvas, ctx, new_image) {
|
|
|
3074
3079
|
* @param {PhotonImage} photon_image
|
|
3075
3080
|
*/
|
|
3076
3081
|
export function r_grayscale(photon_image) {
|
|
3077
|
-
|
|
3078
|
-
|
|
3082
|
+
_assertClass(photon_image, PhotonImage);
|
|
3083
|
+
wasm.r_grayscale(photon_image.__wbg_ptr);
|
|
3079
3084
|
}
|
|
3080
3085
|
|
|
3081
3086
|
/**
|
|
@@ -3099,8 +3104,8 @@ export function r_grayscale(photon_image) {
|
|
|
3099
3104
|
* @param {number} min_filter
|
|
3100
3105
|
*/
|
|
3101
3106
|
export function remove_blue_channel(img, min_filter) {
|
|
3102
|
-
|
|
3103
|
-
|
|
3107
|
+
_assertClass(img, PhotonImage);
|
|
3108
|
+
wasm.remove_blue_channel(img.__wbg_ptr, min_filter);
|
|
3104
3109
|
}
|
|
3105
3110
|
|
|
3106
3111
|
/**
|
|
@@ -3128,8 +3133,8 @@ export function remove_blue_channel(img, min_filter) {
|
|
|
3128
3133
|
* @param {number} min_filter
|
|
3129
3134
|
*/
|
|
3130
3135
|
export function remove_channel(img, channel, min_filter) {
|
|
3131
|
-
|
|
3132
|
-
|
|
3136
|
+
_assertClass(img, PhotonImage);
|
|
3137
|
+
wasm.remove_channel(img.__wbg_ptr, channel, min_filter);
|
|
3133
3138
|
}
|
|
3134
3139
|
|
|
3135
3140
|
/**
|
|
@@ -3153,8 +3158,8 @@ export function remove_channel(img, channel, min_filter) {
|
|
|
3153
3158
|
* @param {number} min_filter
|
|
3154
3159
|
*/
|
|
3155
3160
|
export function remove_green_channel(img, min_filter) {
|
|
3156
|
-
|
|
3157
|
-
|
|
3161
|
+
_assertClass(img, PhotonImage);
|
|
3162
|
+
wasm.remove_green_channel(img.__wbg_ptr, min_filter);
|
|
3158
3163
|
}
|
|
3159
3164
|
|
|
3160
3165
|
/**
|
|
@@ -3178,8 +3183,8 @@ export function remove_green_channel(img, min_filter) {
|
|
|
3178
3183
|
* @param {number} min_filter
|
|
3179
3184
|
*/
|
|
3180
3185
|
export function remove_red_channel(img, min_filter) {
|
|
3181
|
-
|
|
3182
|
-
|
|
3186
|
+
_assertClass(img, PhotonImage);
|
|
3187
|
+
wasm.remove_red_channel(img.__wbg_ptr, min_filter);
|
|
3183
3188
|
}
|
|
3184
3189
|
|
|
3185
3190
|
/**
|
|
@@ -3206,9 +3211,9 @@ export function remove_red_channel(img, min_filter) {
|
|
|
3206
3211
|
* @returns {PhotonImage}
|
|
3207
3212
|
*/
|
|
3208
3213
|
export function resample(img, dst_width, dst_height) {
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3214
|
+
_assertClass(img, PhotonImage);
|
|
3215
|
+
const ret = wasm.resample(img.__wbg_ptr, dst_width, dst_height);
|
|
3216
|
+
return PhotonImage.__wrap(ret);
|
|
3212
3217
|
}
|
|
3213
3218
|
|
|
3214
3219
|
/**
|
|
@@ -3226,9 +3231,9 @@ export function resample(img, dst_width, dst_height) {
|
|
|
3226
3231
|
* @returns {PhotonImage}
|
|
3227
3232
|
*/
|
|
3228
3233
|
export function resize(photon_img, width, height, sampling_filter) {
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3234
|
+
_assertClass(photon_img, PhotonImage);
|
|
3235
|
+
const ret = wasm.resize(photon_img.__wbg_ptr, width, height, sampling_filter);
|
|
3236
|
+
return PhotonImage.__wrap(ret);
|
|
3232
3237
|
}
|
|
3233
3238
|
|
|
3234
3239
|
/**
|
|
@@ -3246,9 +3251,9 @@ export function resize(photon_img, width, height, sampling_filter) {
|
|
|
3246
3251
|
* @returns {HTMLCanvasElement}
|
|
3247
3252
|
*/
|
|
3248
3253
|
export function resize_img_browser(photon_img, width, height, sampling_filter) {
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3254
|
+
_assertClass(photon_img, PhotonImage);
|
|
3255
|
+
const ret = wasm.resize_img_browser(photon_img.__wbg_ptr, width, height, sampling_filter);
|
|
3256
|
+
return ret;
|
|
3252
3257
|
}
|
|
3253
3258
|
|
|
3254
3259
|
/**
|
|
@@ -3274,19 +3279,19 @@ export function resize_img_browser(photon_img, width, height, sampling_filter) {
|
|
|
3274
3279
|
* @returns {PhotonImage}
|
|
3275
3280
|
*/
|
|
3276
3281
|
export function rotate(photon_img, angle) {
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3282
|
+
_assertClass(photon_img, PhotonImage);
|
|
3283
|
+
const ret = wasm.rotate(photon_img.__wbg_ptr, angle);
|
|
3284
|
+
return PhotonImage.__wrap(ret);
|
|
3280
3285
|
}
|
|
3281
3286
|
|
|
3282
3287
|
/**
|
|
3283
3288
|
* ! [temp] Check if WASM is supported.
|
|
3284
3289
|
*/
|
|
3285
3290
|
export function run() {
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3291
|
+
const ret = wasm.run();
|
|
3292
|
+
if (ret[1]) {
|
|
3293
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
3294
|
+
}
|
|
3290
3295
|
}
|
|
3291
3296
|
|
|
3292
3297
|
/**
|
|
@@ -3306,8 +3311,8 @@ export function run() {
|
|
|
3306
3311
|
* @param {PhotonImage} photon_image
|
|
3307
3312
|
*/
|
|
3308
3313
|
export function ryo(photon_image) {
|
|
3309
|
-
|
|
3310
|
-
|
|
3314
|
+
_assertClass(photon_image, PhotonImage);
|
|
3315
|
+
wasm.ryo(photon_image.__wbg_ptr);
|
|
3311
3316
|
}
|
|
3312
3317
|
|
|
3313
3318
|
/**
|
|
@@ -3333,8 +3338,8 @@ export function ryo(photon_image) {
|
|
|
3333
3338
|
* @param {number} level
|
|
3334
3339
|
*/
|
|
3335
3340
|
export function saturate_hsl(img, level) {
|
|
3336
|
-
|
|
3337
|
-
|
|
3341
|
+
_assertClass(img, PhotonImage);
|
|
3342
|
+
wasm.saturate_hsl(img.__wbg_ptr, level);
|
|
3338
3343
|
}
|
|
3339
3344
|
|
|
3340
3345
|
/**
|
|
@@ -3359,8 +3364,8 @@ export function saturate_hsl(img, level) {
|
|
|
3359
3364
|
* @param {number} level
|
|
3360
3365
|
*/
|
|
3361
3366
|
export function saturate_hsluv(img, level) {
|
|
3362
|
-
|
|
3363
|
-
|
|
3367
|
+
_assertClass(img, PhotonImage);
|
|
3368
|
+
wasm.saturate_hsluv(img.__wbg_ptr, level);
|
|
3364
3369
|
}
|
|
3365
3370
|
|
|
3366
3371
|
/**
|
|
@@ -3385,8 +3390,8 @@ export function saturate_hsluv(img, level) {
|
|
|
3385
3390
|
* @param {number} level
|
|
3386
3391
|
*/
|
|
3387
3392
|
export function saturate_hsv(img, level) {
|
|
3388
|
-
|
|
3389
|
-
|
|
3393
|
+
_assertClass(img, PhotonImage);
|
|
3394
|
+
wasm.saturate_hsv(img.__wbg_ptr, level);
|
|
3390
3395
|
}
|
|
3391
3396
|
|
|
3392
3397
|
/**
|
|
@@ -3411,8 +3416,8 @@ export function saturate_hsv(img, level) {
|
|
|
3411
3416
|
* @param {number} level
|
|
3412
3417
|
*/
|
|
3413
3418
|
export function saturate_lch(img, level) {
|
|
3414
|
-
|
|
3415
|
-
|
|
3419
|
+
_assertClass(img, PhotonImage);
|
|
3420
|
+
wasm.saturate_lch(img.__wbg_ptr, level);
|
|
3416
3421
|
}
|
|
3417
3422
|
|
|
3418
3423
|
/**
|
|
@@ -3442,9 +3447,9 @@ export function saturate_lch(img, level) {
|
|
|
3442
3447
|
* @returns {PhotonImage}
|
|
3443
3448
|
*/
|
|
3444
3449
|
export function seam_carve(img, width, height) {
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3450
|
+
_assertClass(img, PhotonImage);
|
|
3451
|
+
const ret = wasm.seam_carve(img.__wbg_ptr, width, height);
|
|
3452
|
+
return PhotonImage.__wrap(ret);
|
|
3448
3453
|
}
|
|
3449
3454
|
|
|
3450
3455
|
/**
|
|
@@ -3478,12 +3483,12 @@ export function seam_carve(img, width, height) {
|
|
|
3478
3483
|
* @param {number} fraction
|
|
3479
3484
|
*/
|
|
3480
3485
|
export function selective_color_convert(photon_image, ref_color, new_color, fraction) {
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3486
|
+
_assertClass(photon_image, PhotonImage);
|
|
3487
|
+
_assertClass(ref_color, Rgb);
|
|
3488
|
+
var ptr0 = ref_color.__destroy_into_raw();
|
|
3489
|
+
_assertClass(new_color, Rgb);
|
|
3490
|
+
var ptr1 = new_color.__destroy_into_raw();
|
|
3491
|
+
wasm.selective_color_convert(photon_image.__wbg_ptr, ptr0, ptr1, fraction);
|
|
3487
3492
|
}
|
|
3488
3493
|
|
|
3489
3494
|
/**
|
|
@@ -3514,10 +3519,10 @@ export function selective_color_convert(photon_image, ref_color, new_color, frac
|
|
|
3514
3519
|
* @param {number} amt
|
|
3515
3520
|
*/
|
|
3516
3521
|
export function selective_desaturate(img, ref_color, amt) {
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3522
|
+
_assertClass(img, PhotonImage);
|
|
3523
|
+
_assertClass(ref_color, Rgb);
|
|
3524
|
+
var ptr0 = ref_color.__destroy_into_raw();
|
|
3525
|
+
wasm.selective_desaturate(img.__wbg_ptr, ptr0, amt);
|
|
3521
3526
|
}
|
|
3522
3527
|
|
|
3523
3528
|
/**
|
|
@@ -3547,11 +3552,11 @@ export function selective_desaturate(img, ref_color, amt) {
|
|
|
3547
3552
|
* @param {Rgb} ref_color
|
|
3548
3553
|
*/
|
|
3549
3554
|
export function selective_greyscale(photon_image, ref_color) {
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
+
_assertClass(photon_image, PhotonImage);
|
|
3556
|
+
var ptr0 = photon_image.__destroy_into_raw();
|
|
3557
|
+
_assertClass(ref_color, Rgb);
|
|
3558
|
+
var ptr1 = ref_color.__destroy_into_raw();
|
|
3559
|
+
wasm.selective_greyscale(ptr0, ptr1);
|
|
3555
3560
|
}
|
|
3556
3561
|
|
|
3557
3562
|
/**
|
|
@@ -3582,10 +3587,10 @@ export function selective_greyscale(photon_image, ref_color) {
|
|
|
3582
3587
|
* @param {number} degrees
|
|
3583
3588
|
*/
|
|
3584
3589
|
export function selective_hue_rotate(photon_image, ref_color, degrees) {
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3590
|
+
_assertClass(photon_image, PhotonImage);
|
|
3591
|
+
_assertClass(ref_color, Rgb);
|
|
3592
|
+
var ptr0 = ref_color.__destroy_into_raw();
|
|
3593
|
+
wasm.selective_hue_rotate(photon_image.__wbg_ptr, ptr0, degrees);
|
|
3589
3594
|
}
|
|
3590
3595
|
|
|
3591
3596
|
/**
|
|
@@ -3615,10 +3620,10 @@ export function selective_hue_rotate(photon_image, ref_color, degrees) {
|
|
|
3615
3620
|
* @param {number} amt
|
|
3616
3621
|
*/
|
|
3617
3622
|
export function selective_lighten(img, ref_color, amt) {
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3623
|
+
_assertClass(img, PhotonImage);
|
|
3624
|
+
_assertClass(ref_color, Rgb);
|
|
3625
|
+
var ptr0 = ref_color.__destroy_into_raw();
|
|
3626
|
+
wasm.selective_lighten(img.__wbg_ptr, ptr0, amt);
|
|
3622
3627
|
}
|
|
3623
3628
|
|
|
3624
3629
|
/**
|
|
@@ -3649,10 +3654,10 @@ export function selective_lighten(img, ref_color, amt) {
|
|
|
3649
3654
|
* @param {number} amt
|
|
3650
3655
|
*/
|
|
3651
3656
|
export function selective_saturate(img, ref_color, amt) {
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3657
|
+
_assertClass(img, PhotonImage);
|
|
3658
|
+
_assertClass(ref_color, Rgb);
|
|
3659
|
+
var ptr0 = ref_color.__destroy_into_raw();
|
|
3660
|
+
wasm.selective_saturate(img.__wbg_ptr, ptr0, amt);
|
|
3656
3661
|
}
|
|
3657
3662
|
|
|
3658
3663
|
/**
|
|
@@ -3673,8 +3678,8 @@ export function selective_saturate(img, ref_color, amt) {
|
|
|
3673
3678
|
* @param {PhotonImage} img
|
|
3674
3679
|
*/
|
|
3675
3680
|
export function sepia(img) {
|
|
3676
|
-
|
|
3677
|
-
|
|
3681
|
+
_assertClass(img, PhotonImage);
|
|
3682
|
+
wasm.sepia(img.__wbg_ptr);
|
|
3678
3683
|
}
|
|
3679
3684
|
|
|
3680
3685
|
/**
|
|
@@ -3697,8 +3702,8 @@ export function sepia(img) {
|
|
|
3697
3702
|
* @param {PhotonImage} photon_image
|
|
3698
3703
|
*/
|
|
3699
3704
|
export function sharpen(photon_image) {
|
|
3700
|
-
|
|
3701
|
-
|
|
3705
|
+
_assertClass(photon_image, PhotonImage);
|
|
3706
|
+
wasm.sharpen(photon_image.__wbg_ptr);
|
|
3702
3707
|
}
|
|
3703
3708
|
|
|
3704
3709
|
/**
|
|
@@ -3724,9 +3729,9 @@ export function sharpen(photon_image) {
|
|
|
3724
3729
|
* @returns {PhotonImage}
|
|
3725
3730
|
*/
|
|
3726
3731
|
export function shearx(photon_img, shear) {
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3732
|
+
_assertClass(photon_img, PhotonImage);
|
|
3733
|
+
const ret = wasm.shearx(photon_img.__wbg_ptr, shear);
|
|
3734
|
+
return PhotonImage.__wrap(ret);
|
|
3730
3735
|
}
|
|
3731
3736
|
|
|
3732
3737
|
/**
|
|
@@ -3752,9 +3757,9 @@ export function shearx(photon_img, shear) {
|
|
|
3752
3757
|
* @returns {PhotonImage}
|
|
3753
3758
|
*/
|
|
3754
3759
|
export function sheary(photon_img, shear) {
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3760
|
+
_assertClass(photon_img, PhotonImage);
|
|
3761
|
+
const ret = wasm.sheary(photon_img.__wbg_ptr, shear);
|
|
3762
|
+
return PhotonImage.__wrap(ret);
|
|
3758
3763
|
}
|
|
3759
3764
|
|
|
3760
3765
|
/**
|
|
@@ -3777,8 +3782,8 @@ export function sheary(photon_img, shear) {
|
|
|
3777
3782
|
* @param {number} channel
|
|
3778
3783
|
*/
|
|
3779
3784
|
export function single_channel_grayscale(photon_image, channel) {
|
|
3780
|
-
|
|
3781
|
-
|
|
3785
|
+
_assertClass(photon_image, PhotonImage);
|
|
3786
|
+
wasm.single_channel_grayscale(photon_image.__wbg_ptr, channel);
|
|
3782
3787
|
}
|
|
3783
3788
|
|
|
3784
3789
|
/**
|
|
@@ -3803,8 +3808,8 @@ export function single_channel_grayscale(photon_image, channel) {
|
|
|
3803
3808
|
* @param {PhotonImage} photon_image
|
|
3804
3809
|
*/
|
|
3805
3810
|
export function sobel_global(photon_image) {
|
|
3806
|
-
|
|
3807
|
-
|
|
3811
|
+
_assertClass(photon_image, PhotonImage);
|
|
3812
|
+
wasm.sobel_global(photon_image.__wbg_ptr);
|
|
3808
3813
|
}
|
|
3809
3814
|
|
|
3810
3815
|
/**
|
|
@@ -3826,8 +3831,8 @@ export function sobel_global(photon_image) {
|
|
|
3826
3831
|
* @param {PhotonImage} photon_image
|
|
3827
3832
|
*/
|
|
3828
3833
|
export function sobel_horizontal(photon_image) {
|
|
3829
|
-
|
|
3830
|
-
|
|
3834
|
+
_assertClass(photon_image, PhotonImage);
|
|
3835
|
+
wasm.sobel_horizontal(photon_image.__wbg_ptr);
|
|
3831
3836
|
}
|
|
3832
3837
|
|
|
3833
3838
|
/**
|
|
@@ -3849,8 +3854,8 @@ export function sobel_horizontal(photon_image) {
|
|
|
3849
3854
|
* @param {PhotonImage} photon_image
|
|
3850
3855
|
*/
|
|
3851
3856
|
export function sobel_vertical(photon_image) {
|
|
3852
|
-
|
|
3853
|
-
|
|
3857
|
+
_assertClass(photon_image, PhotonImage);
|
|
3858
|
+
wasm.sobel_vertical(photon_image.__wbg_ptr);
|
|
3854
3859
|
}
|
|
3855
3860
|
|
|
3856
3861
|
/**
|
|
@@ -3871,8 +3876,8 @@ export function sobel_vertical(photon_image) {
|
|
|
3871
3876
|
* @param {PhotonImage} photon_image
|
|
3872
3877
|
*/
|
|
3873
3878
|
export function solarize(photon_image) {
|
|
3874
|
-
|
|
3875
|
-
|
|
3879
|
+
_assertClass(photon_image, PhotonImage);
|
|
3880
|
+
wasm.solarize(photon_image.__wbg_ptr);
|
|
3876
3881
|
}
|
|
3877
3882
|
|
|
3878
3883
|
/**
|
|
@@ -3895,9 +3900,9 @@ export function solarize(photon_image) {
|
|
|
3895
3900
|
* @returns {PhotonImage}
|
|
3896
3901
|
*/
|
|
3897
3902
|
export function solarize_retimg(photon_image) {
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3903
|
+
_assertClass(photon_image, PhotonImage);
|
|
3904
|
+
const ret = wasm.solarize_retimg(photon_image.__wbg_ptr);
|
|
3905
|
+
return PhotonImage.__wrap(ret);
|
|
3901
3906
|
}
|
|
3902
3907
|
|
|
3903
3908
|
/**
|
|
@@ -3923,8 +3928,8 @@ export function solarize_retimg(photon_image) {
|
|
|
3923
3928
|
* @param {number} channel2
|
|
3924
3929
|
*/
|
|
3925
3930
|
export function swap_channels(img, channel1, channel2) {
|
|
3926
|
-
|
|
3927
|
-
|
|
3931
|
+
_assertClass(img, PhotonImage);
|
|
3932
|
+
wasm.swap_channels(img.__wbg_ptr, channel1, channel2);
|
|
3928
3933
|
}
|
|
3929
3934
|
|
|
3930
3935
|
/**
|
|
@@ -3947,8 +3952,8 @@ export function swap_channels(img, channel1, channel2) {
|
|
|
3947
3952
|
* @param {number} threshold
|
|
3948
3953
|
*/
|
|
3949
3954
|
export function threshold(img, threshold) {
|
|
3950
|
-
|
|
3951
|
-
|
|
3955
|
+
_assertClass(img, PhotonImage);
|
|
3956
|
+
wasm.threshold(img.__wbg_ptr, threshold);
|
|
3952
3957
|
}
|
|
3953
3958
|
|
|
3954
3959
|
/**
|
|
@@ -3975,8 +3980,8 @@ export function threshold(img, threshold) {
|
|
|
3975
3980
|
* @param {number} b_offset
|
|
3976
3981
|
*/
|
|
3977
3982
|
export function tint(photon_image, r_offset, g_offset, b_offset) {
|
|
3978
|
-
|
|
3979
|
-
|
|
3983
|
+
_assertClass(photon_image, PhotonImage);
|
|
3984
|
+
wasm.tint(photon_image.__wbg_ptr, r_offset, g_offset, b_offset);
|
|
3980
3985
|
}
|
|
3981
3986
|
|
|
3982
3987
|
/**
|
|
@@ -3985,10 +3990,10 @@ export function tint(photon_image, r_offset, g_offset, b_offset) {
|
|
|
3985
3990
|
* @returns {ImageData}
|
|
3986
3991
|
*/
|
|
3987
3992
|
export function to_image_data(photon_image) {
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3993
|
+
_assertClass(photon_image, PhotonImage);
|
|
3994
|
+
var ptr0 = photon_image.__destroy_into_raw();
|
|
3995
|
+
const ret = wasm.to_image_data(ptr0);
|
|
3996
|
+
return ret;
|
|
3992
3997
|
}
|
|
3993
3998
|
|
|
3994
3999
|
/**
|
|
@@ -3997,10 +4002,10 @@ export function to_image_data(photon_image) {
|
|
|
3997
4002
|
* @returns {Uint8Array}
|
|
3998
4003
|
*/
|
|
3999
4004
|
export function to_raw_pixels(imgdata) {
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4005
|
+
const ret = wasm.to_raw_pixels(imgdata);
|
|
4006
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
4007
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
4008
|
+
return v1;
|
|
4004
4009
|
}
|
|
4005
4010
|
|
|
4006
4011
|
/**
|
|
@@ -4023,8 +4028,8 @@ export function to_raw_pixels(imgdata) {
|
|
|
4023
4028
|
* @param {number} num_strips
|
|
4024
4029
|
*/
|
|
4025
4030
|
export function vertical_strips(photon_image, num_strips) {
|
|
4026
|
-
|
|
4027
|
-
|
|
4031
|
+
_assertClass(photon_image, PhotonImage);
|
|
4032
|
+
wasm.vertical_strips(photon_image.__wbg_ptr, num_strips);
|
|
4028
4033
|
}
|
|
4029
4034
|
|
|
4030
4035
|
/**
|
|
@@ -4052,401 +4057,428 @@ export function vertical_strips(photon_image, num_strips) {
|
|
|
4052
4057
|
* @param {bigint} y
|
|
4053
4058
|
*/
|
|
4054
4059
|
export function watermark(img, watermark, x, y) {
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4060
|
+
_assertClass(img, PhotonImage);
|
|
4061
|
+
_assertClass(watermark, PhotonImage);
|
|
4062
|
+
wasm.watermark(img.__wbg_ptr, watermark.__wbg_ptr, x, y);
|
|
4058
4063
|
}
|
|
4059
4064
|
|
|
4060
4065
|
function __wbg_get_imports() {
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
|
|
4215
|
-
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
const
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4066
|
+
const import0 = {
|
|
4067
|
+
__proto__: null,
|
|
4068
|
+
__wbg___wbindgen_debug_string_0bc8482c6e3508ae: function (arg0, arg1) {
|
|
4069
|
+
const ret = debugString(arg1);
|
|
4070
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
4071
|
+
const len1 = WASM_VECTOR_LEN;
|
|
4072
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
4073
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
4074
|
+
},
|
|
4075
|
+
__wbg___wbindgen_is_undefined_9e4d92534c42d778: function (arg0) {
|
|
4076
|
+
const ret = arg0 === undefined;
|
|
4077
|
+
return ret;
|
|
4078
|
+
},
|
|
4079
|
+
__wbg___wbindgen_throw_be289d5034ed271b: function (arg0, arg1) {
|
|
4080
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
4081
|
+
},
|
|
4082
|
+
__wbg_appendChild_dea38765a26d346d: function () {
|
|
4083
|
+
return handleError(function (arg0, arg1) {
|
|
4084
|
+
const ret = arg0.appendChild(arg1);
|
|
4085
|
+
return ret;
|
|
4086
|
+
}, arguments);
|
|
4087
|
+
},
|
|
4088
|
+
__wbg_body_f67922363a220026: function (arg0) {
|
|
4089
|
+
const ret = arg0.body;
|
|
4090
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
4091
|
+
},
|
|
4092
|
+
__wbg_call_389efe28435a9388: function () {
|
|
4093
|
+
return handleError(function (arg0, arg1) {
|
|
4094
|
+
const ret = arg0.call(arg1);
|
|
4095
|
+
return ret;
|
|
4096
|
+
}, arguments);
|
|
4097
|
+
},
|
|
4098
|
+
__wbg_createElement_49f60fdcaae809c8: function () {
|
|
4099
|
+
return handleError(function (arg0, arg1, arg2) {
|
|
4100
|
+
const ret = arg0.createElement(getStringFromWasm0(arg1, arg2));
|
|
4101
|
+
return ret;
|
|
4102
|
+
}, arguments);
|
|
4103
|
+
},
|
|
4104
|
+
__wbg_data_d52fd40cc1d7d4e8: function (arg0, arg1) {
|
|
4105
|
+
const ret = arg1.data;
|
|
4106
|
+
const ptr1 = passArray8ToWasm0(ret, wasm.__wbindgen_malloc);
|
|
4107
|
+
const len1 = WASM_VECTOR_LEN;
|
|
4108
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
4109
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
4110
|
+
},
|
|
4111
|
+
__wbg_document_ee35a3d3ae34ef6c: function (arg0) {
|
|
4112
|
+
const ret = arg0.document;
|
|
4113
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
4114
|
+
},
|
|
4115
|
+
__wbg_drawImage_00302fc1908197cc: function () {
|
|
4116
|
+
return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) {
|
|
4117
|
+
arg0.drawImage(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
|
|
4118
|
+
}, arguments);
|
|
4119
|
+
},
|
|
4120
|
+
__wbg_drawImage_51b6a9d03c34c5cc: function () {
|
|
4121
|
+
return handleError(function (arg0, arg1, arg2, arg3) {
|
|
4122
|
+
arg0.drawImage(arg1, arg2, arg3);
|
|
4123
|
+
}, arguments);
|
|
4124
|
+
},
|
|
4125
|
+
__wbg_error_7534b8e9a36f1ab4: function (arg0, arg1) {
|
|
4126
|
+
let deferred0_0;
|
|
4127
|
+
let deferred0_1;
|
|
4128
|
+
try {
|
|
4129
|
+
deferred0_0 = arg0;
|
|
4130
|
+
deferred0_1 = arg1;
|
|
4131
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
4132
|
+
} finally {
|
|
4133
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
4134
|
+
}
|
|
4135
|
+
},
|
|
4136
|
+
__wbg_getContext_2a5764d48600bc43: function () {
|
|
4137
|
+
return handleError(function (arg0, arg1, arg2) {
|
|
4138
|
+
const ret = arg0.getContext(getStringFromWasm0(arg1, arg2));
|
|
4139
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
4140
|
+
}, arguments);
|
|
4141
|
+
},
|
|
4142
|
+
__wbg_getImageData_24d72830c218154d: function () {
|
|
4143
|
+
return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
4144
|
+
const ret = arg0.getImageData(arg1, arg2, arg3, arg4);
|
|
4145
|
+
return ret;
|
|
4146
|
+
}, arguments);
|
|
4147
|
+
},
|
|
4148
|
+
__wbg_height_38750dc6de41ee75: function (arg0) {
|
|
4149
|
+
const ret = arg0.height;
|
|
4150
|
+
return ret;
|
|
4151
|
+
},
|
|
4152
|
+
__wbg_height_408f385de046f7e5: function (arg0) {
|
|
4153
|
+
const ret = arg0.height;
|
|
4154
|
+
return ret;
|
|
4155
|
+
},
|
|
4156
|
+
__wbg_height_87250db2be5164b9: function (arg0) {
|
|
4157
|
+
const ret = arg0.height;
|
|
4158
|
+
return ret;
|
|
4159
|
+
},
|
|
4160
|
+
__wbg_instanceof_CanvasRenderingContext2d_4bb052fd1c3d134d: function (arg0) {
|
|
4161
|
+
let result;
|
|
4162
|
+
try {
|
|
4163
|
+
result = arg0 instanceof CanvasRenderingContext2D;
|
|
4164
|
+
} catch (_) {
|
|
4165
|
+
result = false;
|
|
4166
|
+
}
|
|
4167
|
+
const ret = result;
|
|
4168
|
+
return ret;
|
|
4169
|
+
},
|
|
4170
|
+
__wbg_instanceof_HtmlCanvasElement_3f2f6e1edb1c9792: function (arg0) {
|
|
4171
|
+
let result;
|
|
4172
|
+
try {
|
|
4173
|
+
result = arg0 instanceof HTMLCanvasElement;
|
|
4174
|
+
} catch (_) {
|
|
4175
|
+
result = false;
|
|
4176
|
+
}
|
|
4177
|
+
const ret = result;
|
|
4178
|
+
return ret;
|
|
4179
|
+
},
|
|
4180
|
+
__wbg_instanceof_Window_ed49b2db8df90359: function (arg0) {
|
|
4181
|
+
let result;
|
|
4182
|
+
try {
|
|
4183
|
+
result = arg0 instanceof Window;
|
|
4184
|
+
} catch (_) {
|
|
4185
|
+
result = false;
|
|
4186
|
+
}
|
|
4187
|
+
const ret = result;
|
|
4188
|
+
return ret;
|
|
4189
|
+
},
|
|
4190
|
+
__wbg_length_32ed9a279acd054c: function (arg0) {
|
|
4191
|
+
const ret = arg0.length;
|
|
4192
|
+
return ret;
|
|
4193
|
+
},
|
|
4194
|
+
__wbg_new_8a6f238a6ece86ea: function () {
|
|
4195
|
+
const ret = new Error();
|
|
4196
|
+
return ret;
|
|
4197
|
+
},
|
|
4198
|
+
__wbg_new_dd2b680c8bf6ae29: function (arg0) {
|
|
4199
|
+
const ret = new Uint8Array(arg0);
|
|
4200
|
+
return ret;
|
|
4201
|
+
},
|
|
4202
|
+
__wbg_new_no_args_1c7c842f08d00ebb: function (arg0, arg1) {
|
|
4203
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
4204
|
+
return ret;
|
|
4205
|
+
},
|
|
4206
|
+
__wbg_new_with_u8_clamped_array_and_sh_0c0b789ceb2eab31: function () {
|
|
4207
|
+
return handleError(function (arg0, arg1, arg2, arg3) {
|
|
4208
|
+
const ret = new ImageData(getClampedArrayU8FromWasm0(arg0, arg1), arg2 >>> 0, arg3 >>> 0);
|
|
4209
|
+
return ret;
|
|
4210
|
+
}, arguments);
|
|
4211
|
+
},
|
|
4212
|
+
__wbg_prototypesetcall_bdcdcc5842e4d77d: function (arg0, arg1, arg2) {
|
|
4213
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
4214
|
+
},
|
|
4215
|
+
__wbg_putImageData_78318465ad96c2c3: function () {
|
|
4216
|
+
return handleError(function (arg0, arg1, arg2, arg3) {
|
|
4217
|
+
arg0.putImageData(arg1, arg2, arg3);
|
|
4218
|
+
}, arguments);
|
|
4219
|
+
},
|
|
4220
|
+
__wbg_set_height_f21f985387070100: function (arg0, arg1) {
|
|
4221
|
+
arg0.height = arg1 >>> 0;
|
|
4222
|
+
},
|
|
4223
|
+
__wbg_set_textContent_3e87dba095d9cdbc: function (arg0, arg1, arg2) {
|
|
4224
|
+
arg0.textContent = arg1 === 0 ? undefined : getStringFromWasm0(arg1, arg2);
|
|
4225
|
+
},
|
|
4226
|
+
__wbg_set_width_d60bc4f2f20c56a4: function (arg0, arg1) {
|
|
4227
|
+
arg0.width = arg1 >>> 0;
|
|
4228
|
+
},
|
|
4229
|
+
__wbg_stack_0ed75d68575b0f3c: function (arg0, arg1) {
|
|
4230
|
+
const ret = arg1.stack;
|
|
4231
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
4232
|
+
const len1 = WASM_VECTOR_LEN;
|
|
4233
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
4234
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
4235
|
+
},
|
|
4236
|
+
__wbg_static_accessor_GLOBAL_12837167ad935116: function () {
|
|
4237
|
+
const ret = typeof global === "undefined" ? null : global;
|
|
4238
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
4239
|
+
},
|
|
4240
|
+
__wbg_static_accessor_GLOBAL_THIS_e628e89ab3b1c95f: function () {
|
|
4241
|
+
const ret = typeof globalThis === "undefined" ? null : globalThis;
|
|
4242
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
4243
|
+
},
|
|
4244
|
+
__wbg_static_accessor_SELF_a621d3dfbb60d0ce: function () {
|
|
4245
|
+
const ret = typeof self === "undefined" ? null : self;
|
|
4246
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
4247
|
+
},
|
|
4248
|
+
__wbg_static_accessor_WINDOW_f8727f0cf888e0bd: function () {
|
|
4249
|
+
const ret = typeof window === "undefined" ? null : window;
|
|
4250
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
4251
|
+
},
|
|
4252
|
+
__wbg_width_5901d980713eb80b: function (arg0) {
|
|
4253
|
+
const ret = arg0.width;
|
|
4254
|
+
return ret;
|
|
4255
|
+
},
|
|
4256
|
+
__wbg_width_5f66bde2e810fbde: function (arg0) {
|
|
4257
|
+
const ret = arg0.width;
|
|
4258
|
+
return ret;
|
|
4259
|
+
},
|
|
4260
|
+
__wbg_width_be8f36d66d37751f: function (arg0) {
|
|
4261
|
+
const ret = arg0.width;
|
|
4262
|
+
return ret;
|
|
4263
|
+
},
|
|
4264
|
+
__wbindgen_init_externref_table: function () {
|
|
4265
|
+
const table = wasm.__wbindgen_externrefs;
|
|
4266
|
+
const offset = table.grow(4);
|
|
4267
|
+
table.set(0, undefined);
|
|
4268
|
+
table.set(offset + 0, undefined);
|
|
4269
|
+
table.set(offset + 1, null);
|
|
4270
|
+
table.set(offset + 2, true);
|
|
4271
|
+
table.set(offset + 3, false);
|
|
4272
|
+
},
|
|
4273
|
+
};
|
|
4274
|
+
return {
|
|
4275
|
+
__proto__: null,
|
|
4276
|
+
"./photon_rs_bg.js": import0,
|
|
4277
|
+
};
|
|
4278
|
+
}
|
|
4279
|
+
|
|
4280
|
+
const PhotonImageFinalization =
|
|
4281
|
+
typeof FinalizationRegistry === "undefined"
|
|
4282
|
+
? { register: () => {}, unregister: () => {} }
|
|
4283
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_photonimage_free(ptr >>> 0, 1));
|
|
4284
|
+
const RgbFinalization =
|
|
4285
|
+
typeof FinalizationRegistry === "undefined"
|
|
4286
|
+
? { register: () => {}, unregister: () => {} }
|
|
4287
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_rgb_free(ptr >>> 0, 1));
|
|
4288
|
+
const RgbaFinalization =
|
|
4289
|
+
typeof FinalizationRegistry === "undefined"
|
|
4290
|
+
? { register: () => {}, unregister: () => {} }
|
|
4291
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_rgba_free(ptr >>> 0, 1));
|
|
4266
4292
|
|
|
4267
4293
|
function addToExternrefTable0(obj) {
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4294
|
+
const idx = wasm.__externref_table_alloc();
|
|
4295
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
4296
|
+
return idx;
|
|
4271
4297
|
}
|
|
4272
4298
|
|
|
4273
4299
|
function _assertClass(instance, klass) {
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4300
|
+
if (!(instance instanceof klass)) {
|
|
4301
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
4302
|
+
}
|
|
4277
4303
|
}
|
|
4278
4304
|
|
|
4279
4305
|
function debugString(val) {
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4306
|
+
// primitive types
|
|
4307
|
+
const type = typeof val;
|
|
4308
|
+
if (type == "number" || type == "boolean" || val == null) {
|
|
4309
|
+
return `${val}`;
|
|
4310
|
+
}
|
|
4311
|
+
if (type == "string") {
|
|
4312
|
+
return `"${val}"`;
|
|
4313
|
+
}
|
|
4314
|
+
if (type == "symbol") {
|
|
4315
|
+
const description = val.description;
|
|
4316
|
+
if (description == null) {
|
|
4317
|
+
return "Symbol";
|
|
4318
|
+
} else {
|
|
4319
|
+
return `Symbol(${description})`;
|
|
4320
|
+
}
|
|
4321
|
+
}
|
|
4322
|
+
if (type == "function") {
|
|
4323
|
+
const name = val.name;
|
|
4324
|
+
if (typeof name == "string" && name.length > 0) {
|
|
4325
|
+
return `Function(${name})`;
|
|
4326
|
+
} else {
|
|
4327
|
+
return "Function";
|
|
4328
|
+
}
|
|
4329
|
+
}
|
|
4330
|
+
// objects
|
|
4331
|
+
if (Array.isArray(val)) {
|
|
4332
|
+
const length = val.length;
|
|
4333
|
+
let debug = "[";
|
|
4334
|
+
if (length > 0) {
|
|
4335
|
+
debug += debugString(val[0]);
|
|
4336
|
+
}
|
|
4337
|
+
for (let i = 1; i < length; i++) {
|
|
4338
|
+
debug += ", " + debugString(val[i]);
|
|
4339
|
+
}
|
|
4340
|
+
debug += "]";
|
|
4341
|
+
return debug;
|
|
4342
|
+
}
|
|
4343
|
+
// Test for built-in
|
|
4344
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
4345
|
+
let className;
|
|
4346
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
4347
|
+
className = builtInMatches[1];
|
|
4348
|
+
} else {
|
|
4349
|
+
// Failed to match the standard '[object ClassName]'
|
|
4350
|
+
return toString.call(val);
|
|
4351
|
+
}
|
|
4352
|
+
if (className == "Object") {
|
|
4353
|
+
// we're a user defined class or Object
|
|
4354
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
4355
|
+
// easier than looping through ownProperties of `val`.
|
|
4356
|
+
try {
|
|
4357
|
+
return "Object(" + JSON.stringify(val) + ")";
|
|
4358
|
+
} catch (_) {
|
|
4359
|
+
return "Object";
|
|
4360
|
+
}
|
|
4361
|
+
}
|
|
4362
|
+
// errors
|
|
4363
|
+
if (val instanceof Error) {
|
|
4364
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
4365
|
+
}
|
|
4366
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
4367
|
+
return className;
|
|
4342
4368
|
}
|
|
4343
4369
|
|
|
4344
4370
|
function getArrayU8FromWasm0(ptr, len) {
|
|
4345
|
-
|
|
4346
|
-
|
|
4371
|
+
ptr = ptr >>> 0;
|
|
4372
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
4347
4373
|
}
|
|
4348
4374
|
|
|
4349
4375
|
function getClampedArrayU8FromWasm0(ptr, len) {
|
|
4350
|
-
|
|
4351
|
-
|
|
4376
|
+
ptr = ptr >>> 0;
|
|
4377
|
+
return getUint8ClampedArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
4352
4378
|
}
|
|
4353
4379
|
|
|
4354
4380
|
let cachedDataViewMemory0 = null;
|
|
4355
4381
|
function getDataViewMemory0() {
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4382
|
+
if (
|
|
4383
|
+
cachedDataViewMemory0 === null ||
|
|
4384
|
+
cachedDataViewMemory0.buffer.detached === true ||
|
|
4385
|
+
(cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)
|
|
4386
|
+
) {
|
|
4387
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
4388
|
+
}
|
|
4389
|
+
return cachedDataViewMemory0;
|
|
4360
4390
|
}
|
|
4361
4391
|
|
|
4362
4392
|
function getStringFromWasm0(ptr, len) {
|
|
4363
|
-
|
|
4364
|
-
|
|
4393
|
+
ptr = ptr >>> 0;
|
|
4394
|
+
return decodeText(ptr, len);
|
|
4365
4395
|
}
|
|
4366
4396
|
|
|
4367
4397
|
let cachedUint8ArrayMemory0 = null;
|
|
4368
4398
|
function getUint8ArrayMemory0() {
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4399
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
4400
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
4401
|
+
}
|
|
4402
|
+
return cachedUint8ArrayMemory0;
|
|
4373
4403
|
}
|
|
4374
4404
|
|
|
4375
4405
|
let cachedUint8ClampedArrayMemory0 = null;
|
|
4376
4406
|
function getUint8ClampedArrayMemory0() {
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4407
|
+
if (cachedUint8ClampedArrayMemory0 === null || cachedUint8ClampedArrayMemory0.byteLength === 0) {
|
|
4408
|
+
cachedUint8ClampedArrayMemory0 = new Uint8ClampedArray(wasm.memory.buffer);
|
|
4409
|
+
}
|
|
4410
|
+
return cachedUint8ClampedArrayMemory0;
|
|
4381
4411
|
}
|
|
4382
4412
|
|
|
4383
4413
|
function handleError(f, args) {
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4414
|
+
try {
|
|
4415
|
+
return f.apply(this, args);
|
|
4416
|
+
} catch (e) {
|
|
4417
|
+
const idx = addToExternrefTable0(e);
|
|
4418
|
+
wasm.__wbindgen_exn_store(idx);
|
|
4419
|
+
}
|
|
4390
4420
|
}
|
|
4391
4421
|
|
|
4392
4422
|
function isLikeNone(x) {
|
|
4393
|
-
|
|
4423
|
+
return x === undefined || x === null;
|
|
4394
4424
|
}
|
|
4395
4425
|
|
|
4396
4426
|
function passArray8ToWasm0(arg, malloc) {
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4427
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
4428
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
4429
|
+
WASM_VECTOR_LEN = arg.length;
|
|
4430
|
+
return ptr;
|
|
4401
4431
|
}
|
|
4402
4432
|
|
|
4403
4433
|
function passStringToWasm0(arg, malloc, realloc) {
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4434
|
+
if (realloc === undefined) {
|
|
4435
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
4436
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
4437
|
+
getUint8ArrayMemory0()
|
|
4438
|
+
.subarray(ptr, ptr + buf.length)
|
|
4439
|
+
.set(buf);
|
|
4440
|
+
WASM_VECTOR_LEN = buf.length;
|
|
4441
|
+
return ptr;
|
|
4442
|
+
}
|
|
4443
|
+
|
|
4444
|
+
let len = arg.length;
|
|
4445
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
4446
|
+
|
|
4447
|
+
const mem = getUint8ArrayMemory0();
|
|
4448
|
+
|
|
4449
|
+
let offset = 0;
|
|
4450
|
+
|
|
4451
|
+
for (; offset < len; offset++) {
|
|
4452
|
+
const code = arg.charCodeAt(offset);
|
|
4453
|
+
if (code > 0x7f) break;
|
|
4454
|
+
mem[ptr + offset] = code;
|
|
4455
|
+
}
|
|
4456
|
+
if (offset !== len) {
|
|
4457
|
+
if (offset !== 0) {
|
|
4458
|
+
arg = arg.slice(offset);
|
|
4459
|
+
}
|
|
4460
|
+
ptr = realloc(ptr, len, (len = offset + arg.length * 3), 1) >>> 0;
|
|
4461
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
4462
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
4463
|
+
|
|
4464
|
+
offset += ret.written;
|
|
4465
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
4466
|
+
}
|
|
4467
|
+
|
|
4468
|
+
WASM_VECTOR_LEN = offset;
|
|
4469
|
+
return ptr;
|
|
4438
4470
|
}
|
|
4439
4471
|
|
|
4440
4472
|
function takeFromExternrefTable0(idx) {
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
|
|
4473
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
4474
|
+
wasm.__externref_table_dealloc(idx);
|
|
4475
|
+
return value;
|
|
4444
4476
|
}
|
|
4445
4477
|
|
|
4446
|
-
let cachedTextDecoder = new TextDecoder(
|
|
4478
|
+
let cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
|
|
4447
4479
|
cachedTextDecoder.decode();
|
|
4448
4480
|
function decodeText(ptr, len) {
|
|
4449
|
-
|
|
4481
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
4450
4482
|
}
|
|
4451
4483
|
|
|
4452
4484
|
const cachedTextEncoder = new TextEncoder();
|
|
@@ -4457,24 +4489,32 @@ let WASM_VECTOR_LEN = 0;
|
|
|
4457
4489
|
let wasmInstantiated;
|
|
4458
4490
|
const imports = __wbg_get_imports();
|
|
4459
4491
|
|
|
4460
|
-
|
|
4461
|
-
|
|
4492
|
+
import wasmPath from "./photon_rs_bg.wasm";
|
|
4493
|
+
|
|
4462
4494
|
try {
|
|
4463
|
-
|
|
4464
|
-
|
|
4495
|
+
const url = import.meta.resolve(wasmPath);
|
|
4496
|
+
wasmInstantiated = await WebAssembly.instantiateStreaming(fetch(url), imports);
|
|
4465
4497
|
} catch (e) {
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4498
|
+
const log = (message) => {
|
|
4499
|
+
try {
|
|
4500
|
+
process.stderr.write(`${message}\n`);
|
|
4501
|
+
} catch {
|
|
4502
|
+
console.error(message);
|
|
4503
|
+
}
|
|
4504
|
+
};
|
|
4505
|
+
log("============== PHOTON LOADER ==============");
|
|
4506
|
+
if (error instanceof Error) {
|
|
4507
|
+
log(`${error.name}: ${error.message}\n${error.stack}`);
|
|
4508
|
+
} else {
|
|
4509
|
+
log(`Unknown error: ${String(error)}`);
|
|
4510
|
+
}
|
|
4511
|
+
log("============== PHOTON LOADER ==============");
|
|
4512
|
+
try {
|
|
4513
|
+
process.stderr.end();
|
|
4514
|
+
} catch {
|
|
4515
|
+
// Ignore
|
|
4516
|
+
}
|
|
4517
|
+
process.exit(3);
|
|
4478
4518
|
}
|
|
4479
4519
|
|
|
4480
4520
|
const wasm = wasmInstantiated.instance.exports;
|