rife ncnn vs cleanup

This commit is contained in:
n00mkrad
2022-08-15 12:24:23 +02:00
parent 13baf17f0f
commit 61f402b48b
27 changed files with 0 additions and 3005 deletions

Binary file not shown.

View File

@@ -1 +0,0 @@
2018-06-22T15:05:04.133039

View File

@@ -1,5 +0,0 @@
{
"load_extensions": {
"jupyter-js-widgets/extension": true
}
}

View File

@@ -1 +0,0 @@
2018-06-22T15:08:15.250825

View File

@@ -1,5 +0,0 @@
{
"load_extensions": {
"jupyter-js-widgets/extension": true
}
}

View File

@@ -1,600 +0,0 @@
# Configuration file for ipython.
#------------------------------------------------------------------------------
# InteractiveShellApp(Configurable) configuration
#------------------------------------------------------------------------------
## A Mixin for applications that start InteractiveShell instances.
#
# Provides configurables for loading extensions and executing files as part of
# configuring a Shell environment.
#
# The following methods should be called by the :meth:`initialize` method of the
# subclass:
#
# - :meth:`init_path`
# - :meth:`init_shell` (to be implemented by the subclass)
# - :meth:`init_gui_pylab`
# - :meth:`init_extensions`
# - :meth:`init_code`
## Execute the given command string.
#c.InteractiveShellApp.code_to_run = ''
## Run the file referenced by the PYTHONSTARTUP environment variable at IPython
# startup.
#c.InteractiveShellApp.exec_PYTHONSTARTUP = True
## List of files to run at IPython startup.
#c.InteractiveShellApp.exec_files = []
## lines of code to run at IPython startup.
#c.InteractiveShellApp.exec_lines = []
## A list of dotted module names of IPython extensions to load.
c.InteractiveShellApp.extensions = ['yuuno']
## dotted module name of an IPython extension to load.
#c.InteractiveShellApp.extra_extension = ''
## A file to be run
#c.InteractiveShellApp.file_to_run = ''
## Enable GUI event loop integration with any of ('glut', 'gtk', 'gtk2', 'gtk3',
# 'osx', 'pyglet', 'qt', 'qt4', 'qt5', 'tk', 'wx', 'gtk2', 'qt4').
#c.InteractiveShellApp.gui = None
## Should variables loaded at startup (by startup files, exec_lines, etc.) be
# hidden from tools like %who?
#c.InteractiveShellApp.hide_initial_ns = True
## Configure matplotlib for interactive use with the default matplotlib backend.
#c.InteractiveShellApp.matplotlib = None
## Run the module as a script.
#c.InteractiveShellApp.module_to_run = ''
## Pre-load matplotlib and numpy for interactive use, selecting a particular
# matplotlib backend and loop integration.
#c.InteractiveShellApp.pylab = None
## If true, IPython will populate the user namespace with numpy, pylab, etc. and
# an ``import *`` is done from numpy and pylab, when using pylab mode.
#
# When False, pylab mode should not import any names into the user namespace.
#c.InteractiveShellApp.pylab_import_all = True
## Reraise exceptions encountered loading IPython extensions?
#c.InteractiveShellApp.reraise_ipython_extension_failures = False
#------------------------------------------------------------------------------
# Application(SingletonConfigurable) configuration
#------------------------------------------------------------------------------
## This is an application.
## The date format used by logging formatters for %(asctime)s
#c.Application.log_datefmt = '%Y-%m-%d %H:%M:%S'
## The Logging format template
#c.Application.log_format = '[%(name)s]%(highlevel)s %(message)s'
## Set the log level by value or name.
#c.Application.log_level = 30
#------------------------------------------------------------------------------
# BaseIPythonApplication(Application) configuration
#------------------------------------------------------------------------------
## IPython: an enhanced interactive Python shell.
## Whether to create profile dir if it doesn't exist
#c.BaseIPythonApplication.auto_create = False
## Whether to install the default config files into the profile dir. If a new
# profile is being created, and IPython contains config files for that profile,
# then they will be staged into the new directory. Otherwise, default config
# files will be automatically generated.
#c.BaseIPythonApplication.copy_config_files = False
## Path to an extra config file to load.
#
# If specified, load this config file in addition to any other IPython config.
#c.BaseIPythonApplication.extra_config_file = ''
## The name of the IPython directory. This directory is used for logging
# configuration (through profiles), history storage, etc. The default is usually
# $HOME/.ipython. This option can also be specified through the environment
# variable IPYTHONDIR.
#c.BaseIPythonApplication.ipython_dir = ''
## Whether to overwrite existing config files when copying
#c.BaseIPythonApplication.overwrite = False
## The IPython profile to use.
#c.BaseIPythonApplication.profile = 'default'
## Create a massive crash report when IPython encounters what may be an internal
# error. The default is to append a short message to the usual traceback
#c.BaseIPythonApplication.verbose_crash = False
#------------------------------------------------------------------------------
# TerminalIPythonApp(BaseIPythonApplication,InteractiveShellApp) configuration
#------------------------------------------------------------------------------
## Whether to display a banner upon starting IPython.
#c.TerminalIPythonApp.display_banner = True
## If a command or file is given via the command-line, e.g. 'ipython foo.py',
# start an interactive shell after executing the file or command.
#c.TerminalIPythonApp.force_interact = False
## Class to use to instantiate the TerminalInteractiveShell object. Useful for
# custom Frontends
#c.TerminalIPythonApp.interactive_shell_class = 'IPython.terminal.interactiveshell.TerminalInteractiveShell'
## Start IPython quickly by skipping the loading of config files.
#c.TerminalIPythonApp.quick = False
#------------------------------------------------------------------------------
# InteractiveShell(SingletonConfigurable) configuration
#------------------------------------------------------------------------------
## An enhanced, interactive shell for Python.
## 'all', 'last', 'last_expr' or 'none', 'last_expr_or_assign' specifying which
# nodes should be run interactively (displaying output from expressions).
#c.InteractiveShell.ast_node_interactivity = 'last_expr'
## A list of ast.NodeTransformer subclass instances, which will be applied to
# user input before code is run.
#c.InteractiveShell.ast_transformers = []
## Make IPython automatically call any callable object even if you didn't type
# explicit parentheses. For example, 'str 43' becomes 'str(43)' automatically.
# The value can be '0' to disable the feature, '1' for 'smart' autocall, where
# it is not applied if there are no more arguments on the line, and '2' for
# 'full' autocall, where all callable objects are automatically called (even if
# no arguments are present).
#c.InteractiveShell.autocall = 0
## Autoindent IPython code entered interactively.
#c.InteractiveShell.autoindent = True
## Enable magic commands to be called without the leading %.
#c.InteractiveShell.automagic = True
## The part of the banner to be printed before the profile
#c.InteractiveShell.banner1 = "Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 17:00:18) [MSC v.1900 64 bit (AMD64)]\nType 'copyright', 'credits' or 'license' for more information\nIPython 6.4.0 -- An enhanced Interactive Python. Type '?' for help.\n"
## The part of the banner to be printed after the profile
#c.InteractiveShell.banner2 = ''
## Set the size of the output cache. The default is 1000, you can change it
# permanently in your config file. Setting it to 0 completely disables the
# caching system, and the minimum value accepted is 3 (if you provide a value
# less than 3, it is reset to 0 and a warning is issued). This limit is defined
# because otherwise you'll spend more time re-flushing a too small cache than
# working
#c.InteractiveShell.cache_size = 1000
## Use colors for displaying information about objects. Because this information
# is passed through a pager (like 'less'), and some pagers get confused with
# color codes, this capability can be turned off.
#c.InteractiveShell.color_info = True
## Set the color scheme (NoColor, Neutral, Linux, or LightBG).
#c.InteractiveShell.colors = 'Neutral'
##
#c.InteractiveShell.debug = False
## Don't call post-execute functions that have failed in the past.
#c.InteractiveShell.disable_failing_post_execute = False
## If True, anything that would be passed to the pager will be displayed as
# regular output instead.
#c.InteractiveShell.display_page = False
## (Provisional API) enables html representation in mime bundles sent to pagers.
#c.InteractiveShell.enable_html_pager = False
## Total length of command history
#c.InteractiveShell.history_length = 10000
## The number of saved history entries to be loaded into the history buffer at
# startup.
#c.InteractiveShell.history_load_length = 1000
##
#c.InteractiveShell.ipython_dir = ''
## Start logging to the given file in append mode. Use `logfile` to specify a log
# file to **overwrite** logs to.
#c.InteractiveShell.logappend = ''
## The name of the logfile to use.
#c.InteractiveShell.logfile = ''
## Start logging to the default log file in overwrite mode. Use `logappend` to
# specify a log file to **append** logs to.
#c.InteractiveShell.logstart = False
##
#c.InteractiveShell.object_info_string_level = 0
## Automatically call the pdb debugger after every exception.
#c.InteractiveShell.pdb = False
## Deprecated since IPython 4.0 and ignored since 5.0, set
# TerminalInteractiveShell.prompts object directly.
#c.InteractiveShell.prompt_in1 = 'In [\\#]: '
## Deprecated since IPython 4.0 and ignored since 5.0, set
# TerminalInteractiveShell.prompts object directly.
#c.InteractiveShell.prompt_in2 = ' .\\D.: '
## Deprecated since IPython 4.0 and ignored since 5.0, set
# TerminalInteractiveShell.prompts object directly.
#c.InteractiveShell.prompt_out = 'Out[\\#]: '
## Deprecated since IPython 4.0 and ignored since 5.0, set
# TerminalInteractiveShell.prompts object directly.
#c.InteractiveShell.prompts_pad_left = True
##
#c.InteractiveShell.quiet = False
##
#c.InteractiveShell.separate_in = '\n'
##
#c.InteractiveShell.separate_out = ''
##
#c.InteractiveShell.separate_out2 = ''
## Show rewritten input, e.g. for autocall.
#c.InteractiveShell.show_rewritten_input = True
## Enables rich html representation of docstrings. (This requires the docrepr
# module).
#c.InteractiveShell.sphinxify_docstring = False
##
#c.InteractiveShell.wildcards_case_sensitive = True
## Switch modes for the IPython exception handlers.
#c.InteractiveShell.xmode = 'Context'
#------------------------------------------------------------------------------
# TerminalInteractiveShell(InteractiveShell) configuration
#------------------------------------------------------------------------------
## Set to confirm when you try to exit IPython with an EOF (Control-D in Unix,
# Control-Z/Enter in Windows). By typing 'exit' or 'quit', you can force a
# direct exit without any confirmation.
#c.TerminalInteractiveShell.confirm_exit = True
## Options for displaying tab completions, 'column', 'multicolumn', and
# 'readlinelike'. These options are for `prompt_toolkit`, see `prompt_toolkit`
# documentation for more information.
#c.TerminalInteractiveShell.display_completions = 'multicolumn'
## Shortcut style to use at the prompt. 'vi' or 'emacs'.
#c.TerminalInteractiveShell.editing_mode = 'emacs'
## Set the editor used by IPython (default to $EDITOR/vi/notepad).
#c.TerminalInteractiveShell.editor = 'notepad'
## Allows to enable/disable the prompt toolkit history search
#c.TerminalInteractiveShell.enable_history_search = True
## Enable vi (v) or Emacs (C-X C-E) shortcuts to open an external editor. This is
# in addition to the F2 binding, which is always enabled.
#c.TerminalInteractiveShell.extra_open_editor_shortcuts = False
## Provide an alternative handler to be called when the user presses Return. This
# is an advanced option intended for debugging, which may be changed or removed
# in later releases.
#c.TerminalInteractiveShell.handle_return = None
## Highlight matching brackets.
#c.TerminalInteractiveShell.highlight_matching_brackets = True
## The name or class of a Pygments style to use for syntax highlighting. To see
# available styles, run `pygmentize -L styles`.
#c.TerminalInteractiveShell.highlighting_style = traitlets.Undefined
## Override highlighting format for specific tokens
#c.TerminalInteractiveShell.highlighting_style_overrides = {}
## Enable mouse support in the prompt (Note: prevents selecting text with the
# mouse)
#c.TerminalInteractiveShell.mouse_support = False
## Class used to generate Prompt token for prompt_toolkit
#c.TerminalInteractiveShell.prompts_class = 'IPython.terminal.prompts.Prompts'
## Use `raw_input` for the REPL, without completion and prompt colors.
#
# Useful when controlling IPython as a subprocess, and piping STDIN/OUT/ERR.
# Known usage are: IPython own testing machinery, and emacs inferior-shell
# integration through elpy.
#
# This mode default to `True` if the `IPY_TEST_SIMPLE_PROMPT` environment
# variable is set, or the current terminal is not a tty.
#c.TerminalInteractiveShell.simple_prompt = False
## Number of line at the bottom of the screen to reserve for the completion menu
#c.TerminalInteractiveShell.space_for_menu = 6
## Automatically set the terminal title
#c.TerminalInteractiveShell.term_title = True
## Customize the terminal title format. This is a python format string.
# Available substitutions are: {cwd}.
#c.TerminalInteractiveShell.term_title_format = 'IPython: {cwd}'
## Use 24bit colors instead of 256 colors in prompt highlighting. If your
# terminal supports true color, the following command should print 'TRUECOLOR'
# in orange: printf "\x1b[38;2;255;100;0mTRUECOLOR\x1b[0m\n"
#c.TerminalInteractiveShell.true_color = False
#------------------------------------------------------------------------------
# HistoryAccessor(HistoryAccessorBase) configuration
#------------------------------------------------------------------------------
## Access the history database without adding to it.
#
# This is intended for use by standalone history tools. IPython shells use
# HistoryManager, below, which is a subclass of this.
## Options for configuring the SQLite connection
#
# These options are passed as keyword args to sqlite3.connect when establishing
# database connections.
#c.HistoryAccessor.connection_options = {}
## enable the SQLite history
#
# set enabled=False to disable the SQLite history, in which case there will be
# no stored history, no SQLite connection, and no background saving thread.
# This may be necessary in some threaded environments where IPython is embedded.
#c.HistoryAccessor.enabled = True
## Path to file to use for SQLite history database.
#
# By default, IPython will put the history database in the IPython profile
# directory. If you would rather share one history among profiles, you can set
# this value in each, so that they are consistent.
#
# Due to an issue with fcntl, SQLite is known to misbehave on some NFS mounts.
# If you see IPython hanging, try setting this to something on a local disk,
# e.g::
#
# ipython --HistoryManager.hist_file=/tmp/ipython_hist.sqlite
#
# you can also use the specific value `:memory:` (including the colon at both
# end but not the back ticks), to avoid creating an history file.
#c.HistoryAccessor.hist_file = ''
#------------------------------------------------------------------------------
# HistoryManager(HistoryAccessor) configuration
#------------------------------------------------------------------------------
## A class to organize all history-related functionality in one place.
## Write to database every x commands (higher values save disk access & power).
# Values of 1 or less effectively disable caching.
#c.HistoryManager.db_cache_size = 0
## Should the history database include output? (default: no)
#c.HistoryManager.db_log_output = False
#------------------------------------------------------------------------------
# ProfileDir(LoggingConfigurable) configuration
#------------------------------------------------------------------------------
## An object to manage the profile directory and its resources.
#
# The profile directory is used by all IPython applications, to manage
# configuration, logging and security.
#
# This object knows how to find, create and manage these directories. This
# should be used by any code that wants to handle profiles.
## Set the profile location directly. This overrides the logic used by the
# `profile` option.
#c.ProfileDir.location = ''
#------------------------------------------------------------------------------
# BaseFormatter(Configurable) configuration
#------------------------------------------------------------------------------
## A base formatter class that is configurable.
#
# This formatter should usually be used as the base class of all formatters. It
# is a traited :class:`Configurable` class and includes an extensible API for
# users to determine how their objects are formatted. The following logic is
# used to find a function to format an given object.
#
# 1. The object is introspected to see if it has a method with the name
# :attr:`print_method`. If is does, that object is passed to that method
# for formatting.
# 2. If no print method is found, three internal dictionaries are consulted
# to find print method: :attr:`singleton_printers`, :attr:`type_printers`
# and :attr:`deferred_printers`.
#
# Users should use these dictionaries to register functions that will be used to
# compute the format data for their objects (if those objects don't have the
# special print methods). The easiest way of using these dictionaries is through
# the :meth:`for_type` and :meth:`for_type_by_name` methods.
#
# If no function/callable is found to compute the format data, ``None`` is
# returned and this format type is not used.
##
#c.BaseFormatter.deferred_printers = {}
##
#c.BaseFormatter.enabled = True
##
#c.BaseFormatter.singleton_printers = {}
##
#c.BaseFormatter.type_printers = {}
#------------------------------------------------------------------------------
# PlainTextFormatter(BaseFormatter) configuration
#------------------------------------------------------------------------------
## The default pretty-printer.
#
# This uses :mod:`IPython.lib.pretty` to compute the format data of the object.
# If the object cannot be pretty printed, :func:`repr` is used. See the
# documentation of :mod:`IPython.lib.pretty` for details on how to write pretty
# printers. Here is a simple example::
#
# def dtype_pprinter(obj, p, cycle):
# if cycle:
# return p.text('dtype(...)')
# if hasattr(obj, 'fields'):
# if obj.fields is None:
# p.text(repr(obj))
# else:
# p.begin_group(7, 'dtype([')
# for i, field in enumerate(obj.descr):
# if i > 0:
# p.text(',')
# p.breakable()
# p.pretty(field)
# p.end_group(7, '])')
##
#c.PlainTextFormatter.float_precision = ''
## Truncate large collections (lists, dicts, tuples, sets) to this size.
#
# Set to 0 to disable truncation.
#c.PlainTextFormatter.max_seq_length = 1000
##
#c.PlainTextFormatter.max_width = 79
##
#c.PlainTextFormatter.newline = '\n'
##
#c.PlainTextFormatter.pprint = True
##
#c.PlainTextFormatter.verbose = False
#------------------------------------------------------------------------------
# Completer(Configurable) configuration
#------------------------------------------------------------------------------
## Enable unicode completions, e.g. \alpha<tab> . Includes completion of latex
# commands, unicode names, and expanding unicode characters back to latex
# commands.
#c.Completer.backslash_combining_completions = True
## Enable debug for the Completer. Mostly print extra information for
# experimental jedi integration.
#c.Completer.debug = False
## Activate greedy completion PENDING DEPRECTION. this is now mostly taken care
# of with Jedi.
#
# This will enable completion on elements of lists, results of function calls,
# etc., but can be unsafe because the code is actually evaluated on TAB.
#c.Completer.greedy = False
## Experimental: restrict time (in milliseconds) during which Jedi can compute
# types. Set to 0 to stop computing types. Non-zero value lower than 100ms may
# hurt performance by preventing jedi to build its cache.
#c.Completer.jedi_compute_type_timeout = 400
## Experimental: Use Jedi to generate autocompletions. Off by default.
#c.Completer.use_jedi = False
#------------------------------------------------------------------------------
# IPCompleter(Completer) configuration
#------------------------------------------------------------------------------
## Extension of the completer class with IPython-specific features
## DEPRECATED as of version 5.0.
#
# Instruct the completer to use __all__ for the completion
#
# Specifically, when completing on ``object.<tab>``.
#
# When True: only those names in obj.__all__ will be included.
#
# When False [default]: the __all__ attribute is ignored
#c.IPCompleter.limit_to__all__ = False
## Whether to merge completion results into a single list
#
# If False, only the completion results from the first non-empty completer will
# be returned.
#c.IPCompleter.merge_completions = True
## Instruct the completer to omit private method names
#
# Specifically, when completing on ``object.<tab>``.
#
# When 2 [default]: all names that start with '_' will be excluded.
#
# When 1: all 'magic' names (``__foo__``) will be excluded.
#
# When 0: nothing will be excluded.
#c.IPCompleter.omit__names = 2
#------------------------------------------------------------------------------
# ScriptMagics(Magics) configuration
#------------------------------------------------------------------------------
## Magics for talking to scripts
#
# This defines a base `%%script` cell magic for running a cell with a program in
# a subprocess, and registers a few top-level magics that call %%script with
# common interpreters.
## Extra script cell magics to define
#
# This generates simple wrappers of `%%script foo` as `%%foo`.
#
# If you want to add script magics that aren't on your path, specify them in
# script_paths
#c.ScriptMagics.script_magics = []
## Dict mapping short 'ruby' names to full paths, such as '/opt/secret/bin/ruby'
#
# Only necessary for items in script_magics where the default path will not find
# the right interpreter.
#c.ScriptMagics.script_paths = {}
#------------------------------------------------------------------------------
# LoggingMagics(Magics) configuration
#------------------------------------------------------------------------------
## Magics related to all logging machinery.
## Suppress output of log state when logging is enabled
#c.LoggingMagics.quiet = False
#------------------------------------------------------------------------------
# StoreMagics(Magics) configuration
#------------------------------------------------------------------------------
## Lightweight persistence for python variables.
#
# Provides the %store magic.
## If True, any %store-d variables will be automatically restored when IPython
# starts.
#c.StoreMagics.autorestore = False

View File

@@ -1,458 +0,0 @@
# Configuration file for ipython-kernel.
#------------------------------------------------------------------------------
# ConnectionFileMixin(LoggingConfigurable) configuration
#------------------------------------------------------------------------------
## Mixin for configurable classes that work with connection files
## JSON file in which to store connection info [default: kernel-<pid>.json]
#
# This file will contain the IP, ports, and authentication key needed to connect
# clients to this kernel. By default, this file will be created in the security
# dir of the current profile, but can be specified by absolute path.
#c.ConnectionFileMixin.connection_file = ''
## set the control (ROUTER) port [default: random]
#c.ConnectionFileMixin.control_port = 0
## set the heartbeat port [default: random]
#c.ConnectionFileMixin.hb_port = 0
## set the iopub (PUB) port [default: random]
#c.ConnectionFileMixin.iopub_port = 0
## Set the kernel's IP address [default localhost]. If the IP address is
# something other than localhost, then Consoles on other machines will be able
# to connect to the Kernel, so be careful!
#c.ConnectionFileMixin.ip = ''
## set the shell (ROUTER) port [default: random]
#c.ConnectionFileMixin.shell_port = 0
## set the stdin (ROUTER) port [default: random]
#c.ConnectionFileMixin.stdin_port = 0
##
#c.ConnectionFileMixin.transport = 'tcp'
#------------------------------------------------------------------------------
# InteractiveShellApp(Configurable) configuration
#------------------------------------------------------------------------------
## A Mixin for applications that start InteractiveShell instances.
#
# Provides configurables for loading extensions and executing files as part of
# configuring a Shell environment.
#
# The following methods should be called by the :meth:`initialize` method of the
# subclass:
#
# - :meth:`init_path`
# - :meth:`init_shell` (to be implemented by the subclass)
# - :meth:`init_gui_pylab`
# - :meth:`init_extensions`
# - :meth:`init_code`
## Execute the given command string.
#c.InteractiveShellApp.code_to_run = ''
## Run the file referenced by the PYTHONSTARTUP environment variable at IPython
# startup.
#c.InteractiveShellApp.exec_PYTHONSTARTUP = True
## List of files to run at IPython startup.
#c.InteractiveShellApp.exec_files = []
## lines of code to run at IPython startup.
#c.InteractiveShellApp.exec_lines = []
## A list of dotted module names of IPython extensions to load.
#c.InteractiveShellApp.extensions = []
## dotted module name of an IPython extension to load.
#c.InteractiveShellApp.extra_extension = ''
## A file to be run
#c.InteractiveShellApp.file_to_run = ''
## Enable GUI event loop integration with any of ('glut', 'gtk', 'gtk2', 'gtk3',
# 'osx', 'pyglet', 'qt', 'qt4', 'qt5', 'tk', 'wx', 'gtk2', 'qt4').
#c.InteractiveShellApp.gui = None
## Should variables loaded at startup (by startup files, exec_lines, etc.) be
# hidden from tools like %who?
#c.InteractiveShellApp.hide_initial_ns = True
## Configure matplotlib for interactive use with the default matplotlib backend.
#c.InteractiveShellApp.matplotlib = None
## Run the module as a script.
#c.InteractiveShellApp.module_to_run = ''
## Pre-load matplotlib and numpy for interactive use, selecting a particular
# matplotlib backend and loop integration.
#c.InteractiveShellApp.pylab = None
## If true, IPython will populate the user namespace with numpy, pylab, etc. and
# an ``import *`` is done from numpy and pylab, when using pylab mode.
#
# When False, pylab mode should not import any names into the user namespace.
#c.InteractiveShellApp.pylab_import_all = True
## Reraise exceptions encountered loading IPython extensions?
#c.InteractiveShellApp.reraise_ipython_extension_failures = False
#------------------------------------------------------------------------------
# Application(SingletonConfigurable) configuration
#------------------------------------------------------------------------------
## This is an application.
## The date format used by logging formatters for %(asctime)s
#c.Application.log_datefmt = '%Y-%m-%d %H:%M:%S'
## The Logging format template
#c.Application.log_format = '[%(name)s]%(highlevel)s %(message)s'
## Set the log level by value or name.
#c.Application.log_level = 30
#------------------------------------------------------------------------------
# BaseIPythonApplication(Application) configuration
#------------------------------------------------------------------------------
## IPython: an enhanced interactive Python shell.
## Whether to create profile dir if it doesn't exist
#c.BaseIPythonApplication.auto_create = False
## Whether to install the default config files into the profile dir. If a new
# profile is being created, and IPython contains config files for that profile,
# then they will be staged into the new directory. Otherwise, default config
# files will be automatically generated.
#c.BaseIPythonApplication.copy_config_files = False
## Path to an extra config file to load.
#
# If specified, load this config file in addition to any other IPython config.
#c.BaseIPythonApplication.extra_config_file = ''
## The name of the IPython directory. This directory is used for logging
# configuration (through profiles), history storage, etc. The default is usually
# $HOME/.ipython. This option can also be specified through the environment
# variable IPYTHONDIR.
#c.BaseIPythonApplication.ipython_dir = ''
## Whether to overwrite existing config files when copying
#c.BaseIPythonApplication.overwrite = False
## The IPython profile to use.
#c.BaseIPythonApplication.profile = 'default'
## Create a massive crash report when IPython encounters what may be an internal
# error. The default is to append a short message to the usual traceback
#c.BaseIPythonApplication.verbose_crash = False
#------------------------------------------------------------------------------
# IPKernelApp(BaseIPythonApplication,InteractiveShellApp,ConnectionFileMixin) configuration
#------------------------------------------------------------------------------
## IPython: an enhanced interactive Python shell.
## The importstring for the DisplayHook factory
#c.IPKernelApp.displayhook_class = 'ipykernel.displayhook.ZMQDisplayHook'
## ONLY USED ON WINDOWS Interrupt this process when the parent is signaled.
#c.IPKernelApp.interrupt = 0
## The Kernel subclass to be used.
#
# This should allow easy re-use of the IPKernelApp entry point to configure and
# launch kernels other than IPython's own.
#c.IPKernelApp.kernel_class = 'ipykernel.ipkernel.IPythonKernel'
## redirect stderr to the null device
#c.IPKernelApp.no_stderr = False
## redirect stdout to the null device
#c.IPKernelApp.no_stdout = False
## The importstring for the OutStream factory
#c.IPKernelApp.outstream_class = 'ipykernel.iostream.OutStream'
## kill this process if its parent dies. On Windows, the argument specifies the
# HANDLE of the parent process, otherwise it is simply boolean.
#c.IPKernelApp.parent_handle = 0
#------------------------------------------------------------------------------
# Kernel(SingletonConfigurable) configuration
#------------------------------------------------------------------------------
## Whether to use appnope for compatiblity with OS X App Nap.
#
# Only affects OS X >= 10.9.
#c.Kernel._darwin_app_nap = True
##
#c.Kernel._execute_sleep = 0.0005
##
#c.Kernel._poll_interval = 0.05
#------------------------------------------------------------------------------
# IPythonKernel(Kernel) configuration
#------------------------------------------------------------------------------
##
#c.IPythonKernel.help_links = [{'text': 'Python Reference', 'url': 'https://docs.python.org/3.6'}, {'text': 'IPython Reference', 'url': 'https://ipython.org/documentation.html'}, {'text': 'NumPy Reference', 'url': 'https://docs.scipy.org/doc/numpy/reference/'}, {'text': 'SciPy Reference', 'url': 'https://docs.scipy.org/doc/scipy/reference/'}, {'text': 'Matplotlib Reference', 'url': 'https://matplotlib.org/contents.html'}, {'text': 'SymPy Reference', 'url': 'http://docs.sympy.org/latest/index.html'}, {'text': 'pandas Reference', 'url': 'https://pandas.pydata.org/pandas-docs/stable/'}]
## Set this flag to False to deactivate the use of experimental IPython
# completion APIs.
#c.IPythonKernel.use_experimental_completions = True
#------------------------------------------------------------------------------
# InteractiveShell(SingletonConfigurable) configuration
#------------------------------------------------------------------------------
## An enhanced, interactive shell for Python.
## 'all', 'last', 'last_expr' or 'none', 'last_expr_or_assign' specifying which
# nodes should be run interactively (displaying output from expressions).
#c.InteractiveShell.ast_node_interactivity = 'last_expr'
## A list of ast.NodeTransformer subclass instances, which will be applied to
# user input before code is run.
#c.InteractiveShell.ast_transformers = []
## Make IPython automatically call any callable object even if you didn't type
# explicit parentheses. For example, 'str 43' becomes 'str(43)' automatically.
# The value can be '0' to disable the feature, '1' for 'smart' autocall, where
# it is not applied if there are no more arguments on the line, and '2' for
# 'full' autocall, where all callable objects are automatically called (even if
# no arguments are present).
#c.InteractiveShell.autocall = 0
## Autoindent IPython code entered interactively.
#c.InteractiveShell.autoindent = True
## Enable magic commands to be called without the leading %.
#c.InteractiveShell.automagic = True
## The part of the banner to be printed before the profile
#c.InteractiveShell.banner1 = "Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 17:00:18) [MSC v.1900 64 bit (AMD64)]\nType 'copyright', 'credits' or 'license' for more information\nIPython 6.4.0 -- An enhanced Interactive Python. Type '?' for help.\n"
## The part of the banner to be printed after the profile
#c.InteractiveShell.banner2 = ''
## Set the size of the output cache. The default is 1000, you can change it
# permanently in your config file. Setting it to 0 completely disables the
# caching system, and the minimum value accepted is 3 (if you provide a value
# less than 3, it is reset to 0 and a warning is issued). This limit is defined
# because otherwise you'll spend more time re-flushing a too small cache than
# working
#c.InteractiveShell.cache_size = 1000
## Use colors for displaying information about objects. Because this information
# is passed through a pager (like 'less'), and some pagers get confused with
# color codes, this capability can be turned off.
#c.InteractiveShell.color_info = True
## Set the color scheme (NoColor, Neutral, Linux, or LightBG).
#c.InteractiveShell.colors = 'Neutral'
##
#c.InteractiveShell.debug = False
## Don't call post-execute functions that have failed in the past.
#c.InteractiveShell.disable_failing_post_execute = False
## If True, anything that would be passed to the pager will be displayed as
# regular output instead.
#c.InteractiveShell.display_page = False
## (Provisional API) enables html representation in mime bundles sent to pagers.
#c.InteractiveShell.enable_html_pager = False
## Total length of command history
#c.InteractiveShell.history_length = 10000
## The number of saved history entries to be loaded into the history buffer at
# startup.
#c.InteractiveShell.history_load_length = 1000
##
#c.InteractiveShell.ipython_dir = ''
## Start logging to the given file in append mode. Use `logfile` to specify a log
# file to **overwrite** logs to.
#c.InteractiveShell.logappend = ''
## The name of the logfile to use.
#c.InteractiveShell.logfile = ''
## Start logging to the default log file in overwrite mode. Use `logappend` to
# specify a log file to **append** logs to.
#c.InteractiveShell.logstart = False
##
#c.InteractiveShell.object_info_string_level = 0
## Automatically call the pdb debugger after every exception.
#c.InteractiveShell.pdb = False
## Deprecated since IPython 4.0 and ignored since 5.0, set
# TerminalInteractiveShell.prompts object directly.
#c.InteractiveShell.prompt_in1 = 'In [\\#]: '
## Deprecated since IPython 4.0 and ignored since 5.0, set
# TerminalInteractiveShell.prompts object directly.
#c.InteractiveShell.prompt_in2 = ' .\\D.: '
## Deprecated since IPython 4.0 and ignored since 5.0, set
# TerminalInteractiveShell.prompts object directly.
#c.InteractiveShell.prompt_out = 'Out[\\#]: '
## Deprecated since IPython 4.0 and ignored since 5.0, set
# TerminalInteractiveShell.prompts object directly.
#c.InteractiveShell.prompts_pad_left = True
##
#c.InteractiveShell.quiet = False
##
#c.InteractiveShell.separate_in = '\n'
##
#c.InteractiveShell.separate_out = ''
##
#c.InteractiveShell.separate_out2 = ''
## Show rewritten input, e.g. for autocall.
#c.InteractiveShell.show_rewritten_input = True
## Enables rich html representation of docstrings. (This requires the docrepr
# module).
#c.InteractiveShell.sphinxify_docstring = False
##
#c.InteractiveShell.wildcards_case_sensitive = True
## Switch modes for the IPython exception handlers.
#c.InteractiveShell.xmode = 'Context'
#------------------------------------------------------------------------------
# ZMQInteractiveShell(InteractiveShell) configuration
#------------------------------------------------------------------------------
## A subclass of InteractiveShell for ZMQ.
#------------------------------------------------------------------------------
# ProfileDir(LoggingConfigurable) configuration
#------------------------------------------------------------------------------
## An object to manage the profile directory and its resources.
#
# The profile directory is used by all IPython applications, to manage
# configuration, logging and security.
#
# This object knows how to find, create and manage these directories. This
# should be used by any code that wants to handle profiles.
## Set the profile location directly. This overrides the logic used by the
# `profile` option.
#c.ProfileDir.location = ''
#------------------------------------------------------------------------------
# Session(Configurable) configuration
#------------------------------------------------------------------------------
## Object for handling serialization and sending of messages.
#
# The Session object handles building messages and sending them with ZMQ sockets
# or ZMQStream objects. Objects can communicate with each other over the
# network via Session objects, and only need to work with the dict-based IPython
# message spec. The Session will handle serialization/deserialization, security,
# and metadata.
#
# Sessions support configurable serialization via packer/unpacker traits, and
# signing with HMAC digests via the key/keyfile traits.
#
# Parameters ----------
#
# debug : bool
# whether to trigger extra debugging statements
# packer/unpacker : str : 'json', 'pickle' or import_string
# importstrings for methods to serialize message parts. If just
# 'json' or 'pickle', predefined JSON and pickle packers will be used.
# Otherwise, the entire importstring must be used.
#
# The functions must accept at least valid JSON input, and output *bytes*.
#
# For example, to use msgpack:
# packer = 'msgpack.packb', unpacker='msgpack.unpackb'
# pack/unpack : callables
# You can also set the pack/unpack callables for serialization directly.
# session : bytes
# the ID of this Session object. The default is to generate a new UUID.
# username : unicode
# username added to message headers. The default is to ask the OS.
# key : bytes
# The key used to initialize an HMAC signature. If unset, messages
# will not be signed or checked.
# keyfile : filepath
# The file containing a key. If this is set, `key` will be initialized
# to the contents of the file.
## Threshold (in bytes) beyond which an object's buffer should be extracted to
# avoid pickling.
#c.Session.buffer_threshold = 1024
## Whether to check PID to protect against calls after fork.
#
# This check can be disabled if fork-safety is handled elsewhere.
#c.Session.check_pid = True
## Threshold (in bytes) beyond which a buffer should be sent without copying.
#c.Session.copy_threshold = 65536
## Debug output in the Session
#c.Session.debug = False
## The maximum number of digests to remember.
#
# The digest history will be culled when it exceeds this value.
#c.Session.digest_history_size = 65536
## The maximum number of items for a container to be introspected for custom
# serialization. Containers larger than this are pickled outright.
#c.Session.item_threshold = 64
## execution key, for signing messages.
#c.Session.key = b''
## path to file containing execution key.
#c.Session.keyfile = ''
## Metadata dictionary, which serves as the default top-level metadata dict for
# each message.
#c.Session.metadata = {}
## The name of the packer for serializing messages. Should be one of 'json',
# 'pickle', or an import name for a custom callable serializer.
#c.Session.packer = 'json'
## The UUID identifying this session.
#c.Session.session = ''
## The digest scheme used to construct the message signatures. Must have the form
# 'hmac-HASH'.
#c.Session.signature_scheme = 'hmac-sha256'
## The name of the unpacker for unserializing messages. Only used with custom
# functions for `packer`.
#c.Session.unpacker = 'json'
## Username for the Session. Default is your system username.
#c.Session.username = 'username'

View File

@@ -1,11 +0,0 @@
This is the IPython startup directory
.py and .ipy files in this directory will be run *prior* to any code or files specified
via the exec_lines or exec_files configurables whenever you load this profile.
Files will be run in lexicographical order, so you can control the execution order of files
with a prefix, e.g.::
00-first.py
50-middle.py
99-last.ipy

View File

@@ -1,8 +0,0 @@
import sys
import os
import json
import vapoursynth as vs
core = vs.core
clip = core.lsmas.LWLibavSource(r'D:\Temp\AV1AN\blackwidow.mkv')
print(f"Frames: {clip.num_frames}")

Binary file not shown.

View File

@@ -1,38 +0,0 @@
[
{
"filename": "contextnet.bin",
"dir": "",
"size": 2387688,
"crc32": "1062612804"
},
{
"filename": "contextnet.param",
"dir": "",
"size": 3360,
"crc32": "2077820760"
},
{
"filename": "flownet.bin",
"dir": "",
"size": 30555792,
"crc32": "1458171657"
},
{
"filename": "flownet.param",
"dir": "",
"size": 10178,
"crc32": "3826053718"
},
{
"filename": "fusionnet.bin",
"dir": "",
"size": 23686092,
"crc32": "771032652"
},
{
"filename": "fusionnet.param",
"dir": "",
"size": 5775,
"crc32": "2970625635"
}
]

View File

@@ -1,14 +0,0 @@
[
{
"filename": "flownet.bin",
"dir": "",
"size": 10340416,
"crc32": "3775658638"
},
{
"filename": "flownet.param",
"dir": "",
"size": 12979,
"crc32": "1836315872"
}
]

View File

@@ -1,58 +0,0 @@
//////////////////////////////////////////
// This file contains a simple filter
// skeleton you can use to get started.
// With no changes it simply passes
// frames through.
#include "VapourSynth4.h"
#include "VSHelper4.h"
typedef struct {
VSNode *node;
const VSVideoInfo *vi;
} FilterData;
static const VSFrame *VS_CC filterGetFrame(int n, int activationReason, void *instanceData, void **frameData, VSFrameContext *frameCtx, VSCore *core, const VSAPI *vsapi) {
FilterData *d = (FilterData *)instanceData;
if (activationReason == arInitial) {
vsapi->requestFrameFilter(n, d->node, frameCtx);
} else if (activationReason == arAllFramesReady) {
const VSFrame *frame = vsapi->getFrameFilter(n, d->node, frameCtx);
/* your code here... */
return frame;
}
return NULL;
}
static void VS_CC filterFree(void *instanceData, VSCore *core, const VSAPI *vsapi) {
FilterData *d = (FilterData *)instanceData;
vsapi->freeNode(d->node);
free(d);
}
static void VS_CC filterCreate(const VSMap *in, VSMap *out, void *userData, VSCore *core, const VSAPI *vsapi) {
FilterData d;
FilterData *data;
d.node = vsapi->mapGetNode(in, "clip", 0, 0);
d.vi = vsapi->getVideoInfo(d.node);
data = (FilterData *)malloc(sizeof(d));
*data = d;
VSFilterDependency deps[] = {{d.node, rpGeneral}}; /* Depending the the request patterns you may want to change this */
vsapi->createVideoFilter(out, "Filter", data->vi, filterGetFrame, filterFree, fmParallel, deps, 1, data, core);
}
//////////////////////////////////////////
// Init
VS_EXTERNAL_API(void) VapourSynthPluginInit2(VSPlugin *plugin, const VSPLUGINAPI *vspapi) {
vspapi->configPlugin("com.example.filter", "filter", "VapourSynth Filter Skeleton", VS_MAKE_VERSION(1, 0), VAPOURSYNTH_API_VERSION, 0, plugin);
vspapi->registerFunction("Filter", "clip:vnode;", "clip:vnode;", filterCreate, NULL, plugin);
}

View File

@@ -1,173 +0,0 @@
//////////////////////////////////////////
// This file contains a simple invert
// filter that's commented to show
// the basics of the filter api.
// This file may make more sense when
// read from the bottom and up.
#include <stdlib.h>
#include "VapourSynth4.h"
#include "VSHelper4.h"
typedef struct {
VSNode *node;
int enabled;
} InvertData;
// This is the main function that gets called when a frame should be produced. It will, in most cases, get
// called several times to produce one frame. This state is being kept track of by the value of
// activationReason. The first call to produce a certain frame n is always arInitial. In this state
// you should request all the input frames you need. Always do it in ascending order to play nice with the
// upstream filters.
// Once all frames are ready, the filter will be called with arAllFramesReady. It is now time to
// do the actual processing.
static const VSFrame *VS_CC invertGetFrame(int n, int activationReason, void *instanceData, void **frameData, VSFrameContext *frameCtx, VSCore *core, const VSAPI *vsapi) {
InvertData *d = (InvertData *)instanceData;
if (activationReason == arInitial) {
// Request the source frame on the first call
vsapi->requestFrameFilter(n, d->node, frameCtx);
} else if (activationReason == arAllFramesReady) {
const VSFrame *src = vsapi->getFrameFilter(n, d->node, frameCtx);
// The reason we query this on a per frame basis is because we want our filter
// to accept clips with varying dimensions. If we reject such content using d->vi
// would be easier.
const VSVideoFormat *fi = vsapi->getVideoFrameFormat(src);
int height = vsapi->getFrameHeight(src, 0);
int width = vsapi->getFrameWidth(src, 0);
// When creating a new frame for output it is VERY EXTREMELY SUPER IMPORTANT to
// supply the "dominant" source frame to copy properties from. Frame props
// are an essential part of the filter chain and you should NEVER break it.
VSFrame *dst = vsapi->newVideoFrame(fi, width, height, src, core);
// It's processing loop time!
// Loop over all the planes
int plane;
for (plane = 0; plane < fi->numPlanes; plane++) {
const uint8_t *srcp = vsapi->getReadPtr(src, plane);
int src_stride = vsapi->getStride(src, plane);
uint8_t *dstp = vsapi->getWritePtr(dst, plane);
int dst_stride = vsapi->getStride(dst, plane); // note that if a frame has the same dimensions and format, the stride is guaranteed to be the same. int dst_stride = src_stride would be fine too in this filter.
// Since planes may be subsampled you have to query the height of them individually
int h = vsapi->getFrameHeight(src, plane);
int y;
int w = vsapi->getFrameWidth(src, plane);
int x;
for (y = 0; y < h; y++) {
for (x = 0; x < w; x++)
dstp[x] = ~srcp[x];
dstp += dst_stride;
srcp += src_stride;
}
}
// Release the source frame
vsapi->freeFrame(src);
// A reference is consumed when it is returned, so saving the dst reference somewhere
// and reusing it is not allowed.
return dst;
}
return NULL;
}
// Free all allocated data on filter destruction
static void VS_CC invertFree(void *instanceData, VSCore *core, const VSAPI *vsapi) {
InvertData *d = (InvertData *)instanceData;
vsapi->freeNode(d->node);
free(d);
}
// This function is responsible for validating arguments and creating a new filter
static void VS_CC invertCreate(const VSMap *in, VSMap *out, void *userData, VSCore *core, const VSAPI *vsapi) {
InvertData d;
InvertData *data;
int err;
// Get a clip reference from the input arguments. This must be freed later.
d.node = vsapi->mapGetNode(in, "clip", 0, 0);
const VSVideoInfo *vi = vsapi->getVideoInfo(d.node);
// In this first version we only want to handle 8bit integer formats. Note that
// vi->format can be 0 if the input clip can change format midstream.
if (!vsh_isConstantVideoFormat(vi) || vi->format.sampleType != stInteger || vi->format.bitsPerSample != 8) {
vsapi->mapSetError(out, "Invert: only constant format 8bit integer input supported");
vsapi->freeNode(d.node);
return;
}
// If a property read fails for some reason (index out of bounds/wrong type)
// then err will have flags set to indicate why and 0 will be returned. This
// can be very useful to know when having optional arguments. Since we have
// strict checking because of what we wrote in the argument string, the only
// reason this could fail is when the value wasn't set by the user.
// And when it's not set we want it to default to enabled.
d.enabled = !!vsapi->mapGetInt(in, "enable", 0, &err);
if (err)
d.enabled = 1;
// Let's pretend the only allowed values are 1 or 0...
if (d.enabled < 0 || d.enabled > 1) {
vsapi->mapSetError(out, "Invert: enabled must be 0 or 1");
vsapi->freeNode(d.node);
return;
}
// I usually keep the filter data struct on the stack and don't allocate it
// until all the input validation is done.
data = (InvertData *)malloc(sizeof(d));
*data = d;
// Creates a new filter and returns a reference to it. Always pass on the in and out
// arguments or unexpected things may happen. The name should be something that's
// easy to connect to the filter, like its function name.
// The three function pointers handle initialization, frame processing and filter destruction.
// The filtermode is very important to get right as it controls how threading of the filter
// is handled. In general you should only use fmParallel whenever possible. This is if you
// need to modify no shared data at all when the filter is running.
// For more complicated filters, fmParallelRequests is usually easier to achieve as it can
// be prefetched in parallel but the actual processing is serialized.
// The others can be considered special cases where fmFrameState is useful to source filters and
// fmUnordered is useful when a filter's state may change even when deciding which frames to
// prefetch (such as a cache filter).
VSFilterDependency deps[] = {{d.node, rpStrictSpatial}};
vsapi->createVideoFilter(out, "Invert", vi, invertGetFrame, invertFree, fmParallel, deps, 1, data, core);
}
//////////////////////////////////////////
// Init
// This is the entry point that is called when a plugin is loaded. You are only supposed
// to call the two provided functions here.
// configFunc sets the id, namespace, and long name of the plugin (the last 3 arguments
// never need to be changed for a normal plugin).
//
// id: Needs to be a "reverse" url and unique among all plugins.
// It is inspired by how android packages identify themselves.
// If you don't own a domain then make one up that's related
// to the plugin name.
//
// namespace: Should only use [a-z_] and not be too long.
//
// full name: Any name that describes the plugin nicely.
//
// registerFunction is called once for each function you want to register. Function names
// should be CamelCase. The argument string has this format:
// name:type; or name:type:flag1:flag2....;
// All argument name should be lowercase and only use [a-z_].
// The valid types are int,float,data,clip,frame,func. [] can be appended to allow arrays
// of type to be passed (numbers:int[])
// The available flags are opt, to make an argument optional, empty, which controls whether
// or not empty arrays are accepted
VS_EXTERNAL_API(void) VapourSynthPluginInit2(VSPlugin *plugin, const VSPLUGINAPI *vspapi) {
vspapi->configPlugin("com.example.invert", "invert", "VapourSynth Invert Example", VS_MAKE_VERSION(1, 0), VAPOURSYNTH_API_VERSION, 0, plugin);
vspapi->registerFunction("Filter", "clip:vnode;enabled:int:opt;", "clip:vnode;", invertCreate, NULL, plugin);
}

View File

@@ -1,117 +0,0 @@
/*
* This file is an example on how to use the VSScript part of the VapourSynth API.
* It writes out all the frames of an input script to a file.
* This file may be freely modified/copied/distributed.
*
* For an example of how to use getFrameAsync() see src/vspipe/vspipe.cpp
* It's basically the same as this example but with a callback when the
* processing is done.
*/
#include "VSScript4.h"
#include "VSHelper4.h"
#include <stdio.h>
#include <assert.h>
int main(int argc, char **argv) {
const VSAPI *vsapi = NULL;
const VSSCRIPTAPI *vssapi = NULL;
VSScript *se = NULL;
FILE *outFile = NULL;
if (argc != 3) {
fprintf(stderr, "Usage: vsscript_example <infile> <outfile>\n");
return 1;
}
// Open the output file for writing
outFile = fopen(argv[2], "wb");
if (!outFile) {
fprintf(stderr, "Failed to open output for writing\n");
return 1;
}
// Initialize VSScript and get the api pointer
vssapi = getVSScriptAPI(VSSCRIPT_API_VERSION);
if (!vssapi) {
// VapourSynth probably isn't properly installed at all
fprintf(stderr, "Failed to initialize VSScript library\n");
return 1;
}
// Get a pointer to the normal api struct, exists so you don't have to link with the VapourSynth core library
// Failure only happens on very rare API version mismatches and usually doesn't need to be checked
vsapi = vssapi->getVSAPI(VAPOURSYNTH_API_VERSION);
assert(vsapi);
// This line does the actual script evaluation. If se = NULL it will create a new environment
se = vssapi->evaluateFile(argv[1], NULL, NULL);
if (vssapi->getError(se)) {
fprintf(stderr, "Script evaluation failed:\n%s", vssapi->getError(se));
vssapi->freeScript(se);
return 1;
}
// Get the clip set as output. It is valid until the out index is re-set/cleared/the script is freed
VSNode *node = vssapi->getOutputNode(se, 0);
if (!node) {
fprintf(stderr, "Failed to retrieve output node\n");
vssapi->freeScript(se);
return 1;
}
// Reject hard to handle formats
const VSVideoInfo *vi = vsapi->getVideoInfo(node);
if (!vsh_isConstantVideoFormat(vi)) {
fprintf(stderr, "Cannot output clips with varying dimensions or format\n");
vsapi->freeNode(node);
vssapi->freeScript(se);
return 1;
}
// Output all frames
char errMsg[1024];
int error = 0;
for (int n = 0; n < vi->numFrames; n++) {
const VSFrame *frame = vsapi->getFrame(n, node, errMsg, sizeof(errMsg));
if (!frame) { // Check if an error happened when getting the frame
error = 1;
break;
}
// Loop over every row of every plane write to the file
for (int p = 0; p < vi->format.numPlanes; p++) {
ptrdiff_t stride = vsapi->getStride(frame, p);
const uint8_t *readPtr = vsapi->getReadPtr(frame, p);
int rowSize = vsapi->getFrameWidth(frame, p) * vi->format.bytesPerSample;
int height = vsapi->getFrameHeight(frame, p);
for (int y = 0; y < height; y++) {
// You should probably handle any fwrite errors here as well
fwrite(readPtr, rowSize, 1, outFile);
readPtr += stride;
}
}
vsapi->freeFrame(frame);
}
// Cleanup
fclose(outFile);
vsapi->freeNode(node);
vssapi->freeScript(se);
if (error) {
fprintf(stderr, "%s", errMsg);
return 1;
}
return 0;
}

View File

@@ -1,93 +0,0 @@
/*
* Copyright (c) 2021 Fredrik Mellbin
*
* This file is part of VapourSynth.
*
* VapourSynth is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* VapourSynth is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with VapourSynth; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef VSCONSTANTS4_H
#define VSCONSTANTS4_H
typedef enum VSColorRange {
VSC_RANGE_FULL = 0,
VSC_RANGE_LIMITED = 1
} VSColorRange;
typedef enum VSChromaLocation {
VSC_CHROMA_LEFT = 0,
VSC_CHROMA_CENTER = 1,
VSC_CHROMA_TOP_LEFT = 2,
VSC_CHROMA_TOP = 3,
VSC_CHROMA_BOTTOM_LEFT = 4,
VSC_CHROMA_BOTTOM = 5
} VSChromaLocation;
typedef enum VSFieldBased {
VSC_FIELD_PROGRESSIVE = 0,
VSC_FIELD_BOTTOM = 1,
VSC_FIELD_TOP = 2
} VSFieldBased;
typedef enum VSMatrixCoefficients {
VSC_MATRIX_RGB = 0,
VSC_MATRIX_BT709 = 1,
VSC_MATRIX_UNSPECIFIED = 2,
VSC_MATRIX_FCC = 4,
VSC_MATRIX_BT470_BG = 5,
VSC_MATRIX_ST170_M = 6, /* Equivalent to 5. */
VSC_MATRIX_ST240_M = 7,
VSC_MATRIX_YCGCO = 8,
VSC_MATRIX_BT2020_NCL = 9,
VSC_MATRIX_BT2020_CL = 10,
VSC_MATRIX_CHROMATICITY_DERIVED_NCL = 12,
VSC_MATRIX_CHROMATICITY_DERIVED_CL = 13,
VSC_MATRIX_ICTCP = 14
} VSMatrixCoefficients;
typedef enum VSTransferCharacteristics {
VSC_TRANSFER_BT709 = 1,
VSC_TRANSFER_UNSPECIFIED = 2,
VSC_TRANSFER_BT470_M = 4,
VSC_TRANSFER_BT470_BG = 5,
VSC_TRANSFER_BT601 = 6, /* Equivalent to 1. */
VSC_TRANSFER_ST240_M = 7,
VSC_TRANSFER_LINEAR = 8,
VSC_TRANSFER_LOG_100 = 9,
VSC_TRANSFER_LOG_316 = 10,
VSC_TRANSFER_IEC_61966_2_4 = 11,
VSC_TRANSFER_IEC_61966_2_1 = 13,
VSC_TRANSFER_BT2020_10 = 14, /* Equivalent to 1. */
VSC_TRANSFER_BT2020_12 = 15, /* Equivalent to 1. */
VSC_TRANSFER_ST2084 = 16,
VSC_TRANSFER_ARIB_B67 = 18
} VSTransferCharacteristics;
typedef enum VSColorPrimaries {
VSC_PRIMARIES_BT709 = 1,
VSC_PRIMARIES_UNSPECIFIED = 2,
VSC_PRIMARIES_BT470_M = 4,
VSC_PRIMARIES_BT470_BG = 5,
VSC_PRIMARIES_ST170_M = 6,
VSC_PRIMARIES_ST240_M = 7, /* Equivalent to 6. */
VSC_PRIMARIES_FILM = 8,
VSC_PRIMARIES_BT2020 = 9,
VSC_PRIMARIES_ST428 = 10,
VSC_PRIMARIES_ST431_2 = 11,
VSC_PRIMARIES_ST432_1 = 12,
VSC_PRIMARIES_EBU3213_E = 22
} VSColorPrimaries;
#endif /* VSCONSTANTS4_H */

View File

@@ -1,174 +0,0 @@
/*****************************************************************************
* Copyright (c) 2012-2015 Fredrik Mellbin
* --- Legal stuff ---
* This program is free software. It comes without any warranty, to
* the extent permitted by applicable law. You can redistribute it
* and/or modify it under the terms of the Do What The Fuck You Want
* To Public License, Version 2, as published by Sam Hocevar. See
* http://sam.zoy.org/wtfpl/COPYING for more details.
*****************************************************************************/
#ifndef VSHELPER_H
#define VSHELPER_H
#include <limits.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <math.h>
#ifdef _WIN32
#include <malloc.h>
#endif
#include "VapourSynth.h"
/* Visual Studio doesn't recognize inline in c mode */
#if defined(_MSC_VER) && !defined(__cplusplus)
#define inline _inline
#endif
/* A kinda portable definition of the C99 restrict keyword (or its unofficial C++ equivalent) */
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* Available in C99 */
#define VS_RESTRICT restrict
#elif defined(__cplusplus) || defined(_MSC_VER) /* Almost all relevant C++ compilers support it so just assume it works */
#define VS_RESTRICT __restrict
#else /* Not supported */
#define VS_RESTRICT
#endif
#ifdef _WIN32
#define VS_ALIGNED_MALLOC(pptr, size, alignment) do { *(pptr) = _aligned_malloc((size), (alignment)); } while (0)
#define VS_ALIGNED_FREE(ptr) do { _aligned_free((ptr)); } while (0)
#else
#define VS_ALIGNED_MALLOC(pptr, size, alignment) do { if(posix_memalign((void**)(pptr), (alignment), (size))) *((void**)pptr) = NULL; } while (0)
#define VS_ALIGNED_FREE(ptr) do { free((ptr)); } while (0)
#endif
#define VSMAX(a,b) ((a) > (b) ? (a) : (b))
#define VSMIN(a,b) ((a) > (b) ? (b) : (a))
#ifdef __cplusplus
/* A nicer templated malloc for all the C++ users out there */
#if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1900)
template<typename T=void>
#else
template<typename T>
#endif
static inline T* vs_aligned_malloc(size_t size, size_t alignment) {
#ifdef _WIN32
return (T*)_aligned_malloc(size, alignment);
#else
void *tmp = NULL;
if (posix_memalign(&tmp, alignment, size))
tmp = 0;
return (T*)tmp;
#endif
}
static inline void vs_aligned_free(void *ptr) {
VS_ALIGNED_FREE(ptr);
}
#endif /* __cplusplus */
/* convenience function for checking if the format never changes between frames */
static inline int isConstantFormat(const VSVideoInfo *vi) {
return vi->height > 0 && vi->width > 0 && vi->format;
}
/* convenience function to check for if two clips have the same format (unknown/changeable will be considered the same too) */
static inline int isSameFormat(const VSVideoInfo *v1, const VSVideoInfo *v2) {
return v1->height == v2->height && v1->width == v2->width && v1->format == v2->format;
}
/* multiplies and divides a rational number, such as a frame duration, in place and reduces the result */
static inline void muldivRational(int64_t *num, int64_t *den, int64_t mul, int64_t div) {
/* do nothing if the rational number is invalid */
if (!*den)
return;
/* nobody wants to accidentally divide by zero */
assert(div);
int64_t a, b;
*num *= mul;
*den *= div;
a = *num;
b = *den;
while (b != 0) {
int64_t t = a;
a = b;
b = t % b;
}
if (a < 0)
a = -a;
*num /= a;
*den /= a;
}
/* reduces a rational number */
static inline void vs_normalizeRational(int64_t *num, int64_t *den) {
muldivRational(num, den, 1, 1);
}
/* add two rational numbers and reduces the result */
static inline void vs_addRational(int64_t *num, int64_t *den, int64_t addnum, int64_t addden) {
/* do nothing if the rational number is invalid */
if (!*den)
return;
/* nobody wants to accidentally add an invalid rational number */
assert(addden);
if (*den == addden) {
*num += addnum;
} else {
int64_t temp = addden;
addnum *= *den;
addden *= *den;
*num *= temp;
*den *= temp;
*num += addnum;
vs_normalizeRational(num, den);
}
}
/* converts an int64 to int with saturation, useful to silence warnings when reading int properties among other things */
static inline int int64ToIntS(int64_t i) {
if (i > INT_MAX)
return INT_MAX;
else if (i < INT_MIN)
return INT_MIN;
else return (int)i;
}
static inline void vs_bitblt(void *dstp, int dst_stride, const void *srcp, int src_stride, size_t row_size, size_t height) {
if (height) {
if (src_stride == dst_stride && src_stride == (int)row_size) {
memcpy(dstp, srcp, row_size * height);
} else {
const uint8_t *srcp8 = (const uint8_t *)srcp;
uint8_t *dstp8 = (uint8_t *)dstp;
size_t i;
for (i = 0; i < height; i++) {
memcpy(dstp8, srcp8, row_size);
srcp8 += src_stride;
dstp8 += dst_stride;
}
}
}
}
/* check if the frame dimensions are valid for a given format */
/* returns non-zero for valid width and height */
static inline int areValidDimensions(const VSFormat *fi, int width, int height) {
return !(width % (1 << fi->subSamplingW) || height % (1 << fi->subSamplingH));
}
/* Visual Studio doesn't recognize inline in c mode */
#if defined(_MSC_VER) && !defined(__cplusplus)
#undef inline
#endif
#endif

View File

@@ -1,224 +0,0 @@
/*****************************************************************************
* Copyright (c) 2012-2020 Fredrik Mellbin
* --- Legal stuff ---
* This program is free software. It comes without any warranty, to
* the extent permitted by applicable law. You can redistribute it
* and/or modify it under the terms of the Do What The Fuck You Want
* To Public License, Version 2, as published by Sam Hocevar. See
* http://sam.zoy.org/wtfpl/COPYING for more details.
*****************************************************************************/
#ifndef VSHELPER4_H
#define VSHELPER4_H
#include <limits.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <math.h>
#include <float.h>
#ifdef _WIN32
#include <malloc.h>
#endif
#include "VapourSynth4.h"
#define VSH_STD_PLUGIN_ID "com.vapoursynth.std"
#define VSH_RESIZE_PLUGIN_ID "com.vapoursynth.resize"
#define VSH_TEXT_PLUGIN_ID "com.vapoursynth.text"
#ifdef __cplusplus
namespace vsh {
#define VSH4_MANGLE_FUNCTION_NAME(name) name
#define VSH4_BOOLEAN_TYPE bool
#else
#define VSH4_MANGLE_FUNCTION_NAME(name) vsh_##name
#define VSH4_BOOLEAN_TYPE int
#endif
/* Visual Studio doesn't recognize inline in c mode */
#if defined(_MSC_VER) && !defined(__cplusplus)
#define inline _inline
#endif
/* A kinda portable definition of the C99 restrict keyword (or its unofficial C++ equivalent) */
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* Available in C99 */
#define VS_RESTRICT restrict
#elif defined(__cplusplus) || defined(_MSC_VER) /* Almost all relevant C++ compilers support it so just assume it works */
#define VS_RESTRICT __restrict
#else /* Not supported */
#define VS_RESTRICT
#endif
#ifdef _WIN32
#define VSH_ALIGNED_MALLOC(pptr, size, alignment) do { *(pptr) = _aligned_malloc((size), (alignment)); } while (0)
#define VSH_ALIGNED_FREE(ptr) do { _aligned_free((ptr)); } while (0)
#else
#define VSH_ALIGNED_MALLOC(pptr, size, alignment) do { if(posix_memalign((void**)(pptr), (alignment), (size))) *((void**)pptr) = NULL; } while (0)
#define VSH_ALIGNED_FREE(ptr) do { free((ptr)); } while (0)
#endif
#define VSMAX(a,b) ((a) > (b) ? (a) : (b))
#define VSMIN(a,b) ((a) > (b) ? (b) : (a))
#ifdef __cplusplus
/* A nicer templated malloc for all the C++ users out there */
#if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1900)
template<typename T = void>
#else
template<typename T>
#endif
static inline T *vsh_aligned_malloc(size_t size, size_t alignment) {
#ifdef _WIN32
return (T *)_aligned_malloc(size, alignment);
#else
void *tmp = NULL;
if (posix_memalign(&tmp, alignment, size))
tmp = 0;
return (T *)tmp;
#endif
}
static inline void vsh_aligned_free(void *ptr) {
VSH_ALIGNED_FREE(ptr);
}
#endif /* __cplusplus */
/* convenience function for checking if the format never changes between frames */
static inline VSH4_BOOLEAN_TYPE VSH4_MANGLE_FUNCTION_NAME(isConstantVideoFormat)(const VSVideoInfo *vi) {
return vi->height > 0 && vi->width > 0 && vi->format.colorFamily != cfUndefined;
}
/* convenience function to check if two clips have the same format (unknown/changeable will be considered the same too) */
static inline VSH4_BOOLEAN_TYPE VSH4_MANGLE_FUNCTION_NAME(isSameVideoFormat)(const VSVideoFormat *v1, const VSVideoFormat *v2) {
return v1->colorFamily == v2->colorFamily && v1->sampleType == v2->sampleType && v1->bitsPerSample == v2->bitsPerSample && v1->subSamplingW == v2->subSamplingW && v1->subSamplingH == v2->subSamplingH;
}
/* convenience function to check if a clip has the same format as a format id */
static inline VSH4_BOOLEAN_TYPE VSH4_MANGLE_FUNCTION_NAME(isSameVideoPresetFormat)(unsigned presetFormat, const VSVideoFormat *v, VSCore *core, const VSAPI *vsapi) {
return vsapi->queryVideoFormatID(v->colorFamily, v->sampleType, v->bitsPerSample, v->subSamplingW, v->subSamplingH, core) == presetFormat;
}
/* convenience function to check for if two clips have the same format (but not framerate) while also including width and height (unknown/changeable will be considered the same too) */
static inline VSH4_BOOLEAN_TYPE VSH4_MANGLE_FUNCTION_NAME(isSameVideoInfo)(const VSVideoInfo *v1, const VSVideoInfo *v2) {
return v1->height == v2->height && v1->width == v2->width && VSH4_MANGLE_FUNCTION_NAME(isSameVideoFormat)(&v1->format, &v2->format);
}
/* convenience function to check for if two clips have the same format while also including samplerate (unknown/changeable will be considered the same too) */
static inline VSH4_BOOLEAN_TYPE VSH4_MANGLE_FUNCTION_NAME(isSameAudioFormat)(const VSAudioFormat *a1, const VSAudioFormat *a2) {
return a1->bitsPerSample == a2->bitsPerSample && a1->sampleType == a2->sampleType && a1->channelLayout == a2->channelLayout;
}
/* convenience function to check for if two clips have the same format while also including samplerate (unknown/changeable will be considered the same too) */
static inline VSH4_BOOLEAN_TYPE VSH4_MANGLE_FUNCTION_NAME(isSameAudioInfo)(const VSAudioInfo *a1, const VSAudioInfo *a2) {
return a1->sampleRate == a2->sampleRate && VSH4_MANGLE_FUNCTION_NAME(isSameAudioFormat)(&a1->format, &a2->format);
}
/* multiplies and divides a rational number, such as a frame duration, in place and reduces the result */
static inline void VSH4_MANGLE_FUNCTION_NAME(muldivRational)(int64_t *num, int64_t *den, int64_t mul, int64_t div) {
/* do nothing if the rational number is invalid */
if (!*den)
return;
/* nobody wants to accidentally divide by zero */
assert(div);
int64_t a, b;
*num *= mul;
*den *= div;
a = *num;
b = *den;
while (b != 0) {
int64_t t = a;
a = b;
b = t % b;
}
if (a < 0)
a = -a;
*num /= a;
*den /= a;
}
/* reduces a rational number */
static inline void VSH4_MANGLE_FUNCTION_NAME(reduceRational)(int64_t *num, int64_t *den) {
VSH4_MANGLE_FUNCTION_NAME(muldivRational)(num, den, 1, 1);
}
/* add two rational numbers and reduces the result */
static inline void VSH4_MANGLE_FUNCTION_NAME(addRational)(int64_t *num, int64_t *den, int64_t addnum, int64_t addden) {
/* do nothing if the rational number is invalid */
if (!*den)
return;
/* nobody wants to accidentally add an invalid rational number */
assert(addden);
if (*den == addden) {
*num += addnum;
} else {
int64_t temp = addden;
addnum *= *den;
addden *= *den;
*num *= temp;
*den *= temp;
*num += addnum;
VSH4_MANGLE_FUNCTION_NAME(reduceRational)(num, den);
}
}
/* converts an int64 to int with saturation, useful to silence warnings when reading int properties among other things */
static inline int VSH4_MANGLE_FUNCTION_NAME(int64ToIntS)(int64_t i) {
if (i > INT_MAX)
return INT_MAX;
else if (i < INT_MIN)
return INT_MIN;
else return (int)i;
}
/* converts a double to float with saturation, useful to silence warnings when reading float properties among other things */
static inline float VSH4_MANGLE_FUNCTION_NAME(doubleToFloatS)(double d) {
if (!isfinite(d))
return (float)d;
else if (d > FLT_MAX)
return FLT_MAX;
else if (d < -FLT_MAX)
return -FLT_MAX;
else
return (float)d;
}
static inline void VSH4_MANGLE_FUNCTION_NAME(bitblt)(void *dstp, ptrdiff_t dst_stride, const void *srcp, ptrdiff_t src_stride, size_t row_size, size_t height) {
if (height) {
if (src_stride == dst_stride && src_stride == (ptrdiff_t)row_size) {
memcpy(dstp, srcp, row_size * height);
} else {
const uint8_t *srcp8 = (const uint8_t *)srcp;
uint8_t *dstp8 = (uint8_t *)dstp;
size_t i;
for (i = 0; i < height; i++) {
memcpy(dstp8, srcp8, row_size);
srcp8 += src_stride;
dstp8 += dst_stride;
}
}
}
}
/* check if the frame dimensions are valid for a given format */
/* returns non-zero for valid width and height */
static inline VSH4_BOOLEAN_TYPE VSH4_MANGLE_FUNCTION_NAME(areValidDimensions)(const VSVideoFormat *fi, int width, int height) {
return !(width % (1 << fi->subSamplingW) || height % (1 << fi->subSamplingH));
}
/* Visual Studio doesn't recognize inline in c mode */
#if defined(_MSC_VER) && !defined(__cplusplus)
#undef inline
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,85 +0,0 @@
/*
* Copyright (c) 2013-2018 Fredrik Mellbin
*
* This file is part of VapourSynth.
*
* VapourSynth is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* VapourSynth is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with VapourSynth; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef VSSCRIPT_H
#define VSSCRIPT_H
#include "VapourSynth.h"
#define VSSCRIPT_API_MAJOR 3
#define VSSCRIPT_API_MINOR 2
#define VSSCRIPT_API_VERSION ((VSSCRIPT_API_MAJOR << 16) | (VSSCRIPT_API_MINOR))
/* As of api 3.2 all functions are threadsafe */
typedef struct VSScript VSScript;
typedef enum VSEvalFlags {
efSetWorkingDir = 1,
} VSEvalFlags;
/* Get the api version */
VS_API(int) vsscript_getApiVersion(void); /* api 3.1 */
/* Initialize the available scripting runtimes, returns zero on failure */
VS_API(int) vsscript_init(void);
/* Free all scripting runtimes */
VS_API(int) vsscript_finalize(void);
/*
* Pass a pointer to a null handle to create a new one
* The values returned by the query functions are only valid during the lifetime of the VSScript
* scriptFilename is if the error message should reference a certain file, NULL allowed in vsscript_evaluateScript()
* core is to pass in an already created instance so that mixed environments can be used,
* NULL creates a new core that can be fetched with vsscript_getCore() later OR implicitly uses the one associated with an already existing handle when passed
* If efSetWorkingDir is passed to flags the current working directory will be changed to the path of the script
* note that if scriptFilename is NULL in vsscript_evaluateScript() then __file__ won't be set and the working directory won't be changed
* Set efSetWorkingDir to get the default and recommended behavior
*/
VS_API(int) vsscript_evaluateScript(VSScript **handle, const char *script, const char *scriptFilename, int flags);
/* Convenience version of the above function that loads the script from a file */
VS_API(int) vsscript_evaluateFile(VSScript **handle, const char *scriptFilename, int flags);
/* Create an empty environment for use in later invocations, mostly useful to set script variables before execution */
VS_API(int) vsscript_createScript(VSScript **handle);
VS_API(void) vsscript_freeScript(VSScript *handle);
VS_API(const char *) vsscript_getError(VSScript *handle);
VS_API(int) vsscript_getExitCode(VSScript *handle);
/* The node returned must be freed using freeNode() before calling vsscript_freeScript() */
VS_API(VSNodeRef *) vsscript_getOutput(VSScript *handle, int index);
/* Both nodes returned must be freed using freeNode() before calling vsscript_freeScript(), the alpha node pointer will only be set if an alpha clip has been set in the script */
VS_API(VSNodeRef *) vsscript_getOutput2(VSScript *handle, int index, VSNodeRef **alpha); /* api 3.1 */
/* Unset an output index */
VS_API(int) vsscript_clearOutput(VSScript *handle, int index);
/* The core is valid as long as the environment exists */
VS_API(VSCore *) vsscript_getCore(VSScript *handle);
/* Convenience function for retrieving a vsapi pointer */
VS_API(const VSAPI *) vsscript_getVSApi(void); /* deprecated as of api 3.2 since it's impossible to tell the api version supported */
VS_API(const VSAPI *) vsscript_getVSApi2(int version); /* api 3.2, generally you should pass VAPOURSYNTH_API_VERSION */
/* Variables names that are not set or not of a convertible type will return an error */
VS_API(int) vsscript_getVariable(VSScript *handle, const char *name, VSMap *dst);
VS_API(int) vsscript_setVariable(VSScript *handle, const VSMap *vars);
VS_API(int) vsscript_clearVariable(VSScript *handle, const char *name);
/* Tries to clear everything set in an environment, normally it is better to simply free an environment completely and create a new one */
VS_API(void) vsscript_clearEnvironment(VSScript *handle);
#endif /* VSSCRIPT_H */

View File

@@ -1,97 +0,0 @@
/*
* Copyright (c) 2013-2020 Fredrik Mellbin
*
* This file is part of VapourSynth.
*
* VapourSynth is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* VapourSynth is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with VapourSynth; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef VSSCRIPT4_H
#define VSSCRIPT4_H
#include "VapourSynth4.h"
#define VSSCRIPT_API_MAJOR 4
#define VSSCRIPT_API_MINOR 1
#define VSSCRIPT_API_VERSION VS_MAKE_VERSION(VSSCRIPT_API_MAJOR, VSSCRIPT_API_MINOR)
typedef struct VSScript VSScript;
typedef struct VSSCRIPTAPI VSSCRIPTAPI;
struct VSSCRIPTAPI {
/* Returns the highest supported VSSCRIPT_API_VERSION */
int (VS_CC *getAPIVersion)(void) VS_NOEXCEPT;
/* Convenience function for retrieving a VSAPI pointer without having to use the VapourSynth library. Always pass VAPOURSYNTH_API_VERSION */
const VSAPI *(VS_CC *getVSAPI)(int version) VS_NOEXCEPT;
/*
* Providing a pre-created core is useful for setting core creation flags, log callbacks, preload specific plugins and many other things.
* You must create a VSScript object before evaluating a script. Always takes ownership of the core even on failure. Returns NULL on failure.
* Pass NULL to have a core automatically created with the default options.
*/
VSScript *(VS_CC *createScript)(VSCore *core) VS_NOEXCEPT;
/* The core is valid as long as the environment exists, return NULL on error */
VSCore *(VS_CC *getCore)(VSScript *handle) VS_NOEXCEPT;
/*
* Evaluates a script passed in the buffer argument. The scriptFilename is only used for display purposes. in Python
* it means that the main module won't be unnamed in error messages.
*
* Returns 0 on success.
*
* Note that calling any function other than getError() and freeScript() on a VSScript object in the error state
* will result in undefined behavior.
*/
int (VS_CC *evaluateBuffer)(VSScript *handle, const char *buffer, const char *scriptFilename) VS_NOEXCEPT;
/* Convenience version of the above function that loads the script from scriptFilename and passes as the buffer to evaluateBuffer */
int (VS_CC *evaluateFile)(VSScript *handle, const char *scriptFilename) VS_NOEXCEPT;
/* Returns NULL on success, otherwise an error message */
const char *(VS_CC *getError)(VSScript *handle) VS_NOEXCEPT;
/* Returns the script's reported exit code */
int (VS_CC *getExitCode)(VSScript *handle) VS_NOEXCEPT;
/* Fetches a variable of any VSMap storable type set in a script. It is stored in the key with the same name in dst. Returns 0 on success. */
int (VS_CC *getVariable)(VSScript *handle, const char *name, VSMap *dst) VS_NOEXCEPT;
/* Sets all keys in the provided VSMap as variables in the script. Returns 0 on success. */
int (VS_CC *setVariables)(VSScript *handle, const VSMap *vars) VS_NOEXCEPT;
/*
* The returned nodes must be freed using freeNode() before calling freeScript() since they may depend on data in the VSScript
* environment. Returns NULL if no node was set as output in the script. Index 0 is used by default in scripts and other
* values are rarely used.
*/
VSNode *(VS_CC *getOutputNode)(VSScript *handle, int index) VS_NOEXCEPT;
VSNode *(VS_CC *getOutputAlphaNode)(VSScript *handle, int index) VS_NOEXCEPT;
int (VS_CC *getAltOutputMode)(VSScript *handle, int index) VS_NOEXCEPT;
void (VS_CC *freeScript)(VSScript *handle) VS_NOEXCEPT;
/*
* Set whether or not the working directory is temporarily changed to the same
* location as the script file when evaluateFile is called. Off by default.
*/
void (VS_CC *evalSetWorkingDir)(VSScript *handle, int setCWD) VS_NOEXCEPT;
};
VS_API(const VSSCRIPTAPI *) getVSScriptAPI(int version) VS_NOEXCEPT;
#endif /* VSSCRIPT4_H */

View File

@@ -1,359 +0,0 @@
/*
* Copyright (c) 2012-2017 Fredrik Mellbin
*
* This file is part of VapourSynth.
*
* VapourSynth is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* VapourSynth is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with VapourSynth; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef VAPOURSYNTH_H
#define VAPOURSYNTH_H
#include <stdint.h>
#define VAPOURSYNTH_API_MAJOR 3
#define VAPOURSYNTH_API_MINOR 6
#define VAPOURSYNTH_API_VERSION ((VAPOURSYNTH_API_MAJOR << 16) | (VAPOURSYNTH_API_MINOR))
/* Convenience for C++ users. */
#ifdef __cplusplus
# define VS_EXTERN_C extern "C"
# if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1900)
# define VS_NOEXCEPT noexcept
# else
# define VS_NOEXCEPT
# endif
# if __cplusplus >= 201402L || (defined(_MSC_VER) && _MSC_VER >= 1900)
# define VS_DEPRECATE(REASON) [[deprecated(REASON)]]
# else
# define VS_DEPRECATE(REASON)
# endif
#else
# define VS_EXTERN_C
# define VS_NOEXCEPT
# define VS_DEPRECATE(REASON)
#endif
#if defined(_WIN32) && !defined(_WIN64)
# define VS_CC __stdcall
#else
# define VS_CC
#endif
/* And now for some symbol hide-and-seek... */
#if defined(_WIN32) /* Windows being special */
# define VS_EXTERNAL_API(ret) VS_EXTERN_C __declspec(dllexport) ret VS_CC
#elif defined(__GNUC__) && __GNUC__ >= 4
# define VS_EXTERNAL_API(ret) VS_EXTERN_C __attribute__((visibility("default"))) ret VS_CC
#else
# define VS_EXTERNAL_API(ret) VS_EXTERN_C ret VS_CC
#endif
#if !defined(VS_CORE_EXPORTS) && defined(_WIN32)
# define VS_API(ret) VS_EXTERN_C __declspec(dllimport) ret VS_CC
#else
# define VS_API(ret) VS_EXTERNAL_API(ret)
#endif
typedef struct VSFrameRef VSFrameRef;
typedef struct VSNodeRef VSNodeRef;
typedef struct VSCore VSCore;
typedef struct VSPlugin VSPlugin;
typedef struct VSNode VSNode;
typedef struct VSFuncRef VSFuncRef;
typedef struct VSMap VSMap;
typedef struct VSAPI VSAPI;
typedef struct VSFrameContext VSFrameContext;
typedef enum VSColorFamily {
/* all planar formats */
cmGray = 1000000,
cmRGB = 2000000,
cmYUV = 3000000,
cmYCoCg = 4000000,
/* special for compatibility */
cmCompat = 9000000
} VSColorFamily;
typedef enum VSSampleType {
stInteger = 0,
stFloat = 1
} VSSampleType;
/* The +10 is so people won't be using the constants interchangeably "by accident" */
typedef enum VSPresetFormat {
pfNone = 0,
pfGray8 = cmGray + 10,
pfGray16,
pfGrayH,
pfGrayS,
pfYUV420P8 = cmYUV + 10,
pfYUV422P8,
pfYUV444P8,
pfYUV410P8,
pfYUV411P8,
pfYUV440P8,
pfYUV420P9,
pfYUV422P9,
pfYUV444P9,
pfYUV420P10,
pfYUV422P10,
pfYUV444P10,
pfYUV420P16,
pfYUV422P16,
pfYUV444P16,
pfYUV444PH,
pfYUV444PS,
pfYUV420P12,
pfYUV422P12,
pfYUV444P12,
pfYUV420P14,
pfYUV422P14,
pfYUV444P14,
pfRGB24 = cmRGB + 10,
pfRGB27,
pfRGB30,
pfRGB48,
pfRGBH,
pfRGBS,
/* special for compatibility, if you implement these in any filter I'll personally kill you */
/* I'll also change their ids around to break your stuff regularly */
pfCompatBGR32 = cmCompat + 10,
pfCompatYUY2
} VSPresetFormat;
typedef enum VSFilterMode {
fmParallel = 100, /* completely parallel execution */
fmParallelRequests = 200, /* for filters that are serial in nature but can request one or more frames they need in advance */
fmUnordered = 300, /* for filters that modify their internal state every request */
fmSerial = 400 /* for source filters and compatibility with other filtering architectures */
} VSFilterMode;
typedef struct VSFormat {
char name[32];
int id;
int colorFamily; /* see VSColorFamily */
int sampleType; /* see VSSampleType */
int bitsPerSample; /* number of significant bits */
int bytesPerSample; /* actual storage is always in a power of 2 and the smallest possible that can fit the number of bits used per sample */
int subSamplingW; /* log2 subsampling factor, applied to second and third plane */
int subSamplingH;
int numPlanes; /* implicit from colorFamily */
} VSFormat;
typedef enum VSNodeFlags {
nfNoCache = 1,
nfIsCache = 2,
nfMakeLinear = 4 /* api 3.3 */
} VSNodeFlags;
typedef enum VSPropTypes {
ptUnset = 'u',
ptInt = 'i',
ptFloat = 'f',
ptData = 's',
ptNode = 'c',
ptFrame = 'v',
ptFunction = 'm'
} VSPropTypes;
typedef enum VSGetPropErrors {
peUnset = 1,
peType = 2,
peIndex = 4
} VSGetPropErrors;
typedef enum VSPropAppendMode {
paReplace = 0,
paAppend = 1,
paTouch = 2
} VSPropAppendMode;
typedef struct VSCoreInfo {
const char *versionString;
int core;
int api;
int numThreads;
int64_t maxFramebufferSize;
int64_t usedFramebufferSize;
} VSCoreInfo;
typedef struct VSVideoInfo {
const VSFormat *format;
int64_t fpsNum;
int64_t fpsDen;
int width;
int height;
int numFrames; /* api 3.2 - no longer allowed to be 0 */
int flags;
} VSVideoInfo;
typedef enum VSActivationReason {
arInitial = 0,
arFrameReady = 1,
arAllFramesReady = 2,
arError = -1
} VSActivationReason;
typedef enum VSMessageType {
mtDebug = 0,
mtWarning = 1,
mtCritical = 2,
mtFatal = 3
} VSMessageType;
/* core entry point */
typedef const VSAPI *(VS_CC *VSGetVapourSynthAPI)(int version);
/* plugin function and filter typedefs */
typedef void (VS_CC *VSPublicFunction)(const VSMap *in, VSMap *out, void *userData, VSCore *core, const VSAPI *vsapi);
typedef void (VS_CC *VSRegisterFunction)(const char *name, const char *args, VSPublicFunction argsFunc, void *functionData, VSPlugin *plugin);
typedef void (VS_CC *VSConfigPlugin)(const char *identifier, const char *defaultNamespace, const char *name, int apiVersion, int readonly, VSPlugin *plugin);
typedef void (VS_CC *VSInitPlugin)(VSConfigPlugin configFunc, VSRegisterFunction registerFunc, VSPlugin *plugin);
typedef void (VS_CC *VSFreeFuncData)(void *userData);
typedef void (VS_CC *VSFilterInit)(VSMap *in, VSMap *out, void **instanceData, VSNode *node, VSCore *core, const VSAPI *vsapi);
typedef const VSFrameRef *(VS_CC *VSFilterGetFrame)(int n, int activationReason, void **instanceData, void **frameData, VSFrameContext *frameCtx, VSCore *core, const VSAPI *vsapi);
typedef void (VS_CC *VSFilterFree)(void *instanceData, VSCore *core, const VSAPI *vsapi);
/* other */
typedef void (VS_CC *VSFrameDoneCallback)(void *userData, const VSFrameRef *f, int n, VSNodeRef *, const char *errorMsg);
typedef void (VS_CC *VSMessageHandler)(int msgType, const char *msg, void *userData);
typedef void (VS_CC *VSMessageHandlerFree)(void *userData);
struct VSAPI {
VSCore *(VS_CC *createCore)(int threads) VS_NOEXCEPT;
void (VS_CC *freeCore)(VSCore *core) VS_NOEXCEPT;
VS_DEPRECATE("getCoreInfo has been deprecated as of api 3.6, use getCoreInfo2 instead")
const VSCoreInfo *(VS_CC *getCoreInfo)(VSCore *core) VS_NOEXCEPT;
const VSFrameRef *(VS_CC *cloneFrameRef)(const VSFrameRef *f) VS_NOEXCEPT;
VSNodeRef *(VS_CC *cloneNodeRef)(VSNodeRef *node) VS_NOEXCEPT;
VSFuncRef *(VS_CC *cloneFuncRef)(VSFuncRef *f) VS_NOEXCEPT;
void (VS_CC *freeFrame)(const VSFrameRef *f) VS_NOEXCEPT;
void (VS_CC *freeNode)(VSNodeRef *node) VS_NOEXCEPT;
void (VS_CC *freeFunc)(VSFuncRef *f) VS_NOEXCEPT;
VSFrameRef *(VS_CC *newVideoFrame)(const VSFormat *format, int width, int height, const VSFrameRef *propSrc, VSCore *core) VS_NOEXCEPT;
VSFrameRef *(VS_CC *copyFrame)(const VSFrameRef *f, VSCore *core) VS_NOEXCEPT;
void (VS_CC *copyFrameProps)(const VSFrameRef *src, VSFrameRef *dst, VSCore *core) VS_NOEXCEPT;
void (VS_CC *registerFunction)(const char *name, const char *args, VSPublicFunction argsFunc, void *functionData, VSPlugin *plugin) VS_NOEXCEPT;
VSPlugin *(VS_CC *getPluginById)(const char *identifier, VSCore *core) VS_NOEXCEPT;
VSPlugin *(VS_CC *getPluginByNs)(const char *ns, VSCore *core) VS_NOEXCEPT;
VSMap *(VS_CC *getPlugins)(VSCore *core) VS_NOEXCEPT;
VSMap *(VS_CC *getFunctions)(VSPlugin *plugin) VS_NOEXCEPT;
void (VS_CC *createFilter)(const VSMap *in, VSMap *out, const char *name, VSFilterInit init, VSFilterGetFrame getFrame, VSFilterFree free, int filterMode, int flags, void *instanceData, VSCore *core) VS_NOEXCEPT;
void (VS_CC *setError)(VSMap *map, const char *errorMessage) VS_NOEXCEPT; /* use to signal errors outside filter getframe functions */
const char *(VS_CC *getError)(const VSMap *map) VS_NOEXCEPT; /* use to query errors, returns 0 if no error */
void (VS_CC *setFilterError)(const char *errorMessage, VSFrameContext *frameCtx) VS_NOEXCEPT; /* use to signal errors in the filter getframe function */
VSMap *(VS_CC *invoke)(VSPlugin *plugin, const char *name, const VSMap *args) VS_NOEXCEPT;
const VSFormat *(VS_CC *getFormatPreset)(int id, VSCore *core) VS_NOEXCEPT;
const VSFormat *(VS_CC *registerFormat)(int colorFamily, int sampleType, int bitsPerSample, int subSamplingW, int subSamplingH, VSCore *core) VS_NOEXCEPT;
const VSFrameRef *(VS_CC *getFrame)(int n, VSNodeRef *node, char *errorMsg, int bufSize) VS_NOEXCEPT; /* do never use inside a filter's getframe function, for external applications using the core as a library or for requesting frames in a filter constructor */
void (VS_CC *getFrameAsync)(int n, VSNodeRef *node, VSFrameDoneCallback callback, void *userData) VS_NOEXCEPT; /* do never use inside a filter's getframe function, for external applications using the core as a library or for requesting frames in a filter constructor */
const VSFrameRef *(VS_CC *getFrameFilter)(int n, VSNodeRef *node, VSFrameContext *frameCtx) VS_NOEXCEPT; /* only use inside a filter's getframe function */
void (VS_CC *requestFrameFilter)(int n, VSNodeRef *node, VSFrameContext *frameCtx) VS_NOEXCEPT; /* only use inside a filter's getframe function */
void (VS_CC *queryCompletedFrame)(VSNodeRef **node, int *n, VSFrameContext *frameCtx) VS_NOEXCEPT; /* only use inside a filter's getframe function */
void (VS_CC *releaseFrameEarly)(VSNodeRef *node, int n, VSFrameContext *frameCtx) VS_NOEXCEPT; /* only use inside a filter's getframe function */
int (VS_CC *getStride)(const VSFrameRef *f, int plane) VS_NOEXCEPT;
const uint8_t *(VS_CC *getReadPtr)(const VSFrameRef *f, int plane) VS_NOEXCEPT;
uint8_t *(VS_CC *getWritePtr)(VSFrameRef *f, int plane) VS_NOEXCEPT;
VSFuncRef *(VS_CC *createFunc)(VSPublicFunction func, void *userData, VSFreeFuncData free, VSCore *core, const VSAPI *vsapi) VS_NOEXCEPT;
void (VS_CC *callFunc)(VSFuncRef *func, const VSMap *in, VSMap *out, VSCore *core, const VSAPI *vsapi) VS_NOEXCEPT; /* core and vsapi arguments are completely ignored, they only remain to preserve ABI */
/* property access functions */
VSMap *(VS_CC *createMap)(void) VS_NOEXCEPT;
void (VS_CC *freeMap)(VSMap *map) VS_NOEXCEPT;
void (VS_CC *clearMap)(VSMap *map) VS_NOEXCEPT;
const VSVideoInfo *(VS_CC *getVideoInfo)(VSNodeRef *node) VS_NOEXCEPT;
void (VS_CC *setVideoInfo)(const VSVideoInfo *vi, int numOutputs, VSNode *node) VS_NOEXCEPT;
const VSFormat *(VS_CC *getFrameFormat)(const VSFrameRef *f) VS_NOEXCEPT;
int (VS_CC *getFrameWidth)(const VSFrameRef *f, int plane) VS_NOEXCEPT;
int (VS_CC *getFrameHeight)(const VSFrameRef *f, int plane) VS_NOEXCEPT;
const VSMap *(VS_CC *getFramePropsRO)(const VSFrameRef *f) VS_NOEXCEPT;
VSMap *(VS_CC *getFramePropsRW)(VSFrameRef *f) VS_NOEXCEPT;
int (VS_CC *propNumKeys)(const VSMap *map) VS_NOEXCEPT;
const char *(VS_CC *propGetKey)(const VSMap *map, int index) VS_NOEXCEPT;
int (VS_CC *propNumElements)(const VSMap *map, const char *key) VS_NOEXCEPT;
char (VS_CC *propGetType)(const VSMap *map, const char *key) VS_NOEXCEPT;
int64_t(VS_CC *propGetInt)(const VSMap *map, const char *key, int index, int *error) VS_NOEXCEPT;
double(VS_CC *propGetFloat)(const VSMap *map, const char *key, int index, int *error) VS_NOEXCEPT;
const char *(VS_CC *propGetData)(const VSMap *map, const char *key, int index, int *error) VS_NOEXCEPT;
int (VS_CC *propGetDataSize)(const VSMap *map, const char *key, int index, int *error) VS_NOEXCEPT;
VSNodeRef *(VS_CC *propGetNode)(const VSMap *map, const char *key, int index, int *error) VS_NOEXCEPT;
const VSFrameRef *(VS_CC *propGetFrame)(const VSMap *map, const char *key, int index, int *error) VS_NOEXCEPT;
VSFuncRef *(VS_CC *propGetFunc)(const VSMap *map, const char *key, int index, int *error) VS_NOEXCEPT;
int (VS_CC *propDeleteKey)(VSMap *map, const char *key) VS_NOEXCEPT;
int (VS_CC *propSetInt)(VSMap *map, const char *key, int64_t i, int append) VS_NOEXCEPT;
int (VS_CC *propSetFloat)(VSMap *map, const char *key, double d, int append) VS_NOEXCEPT;
int (VS_CC *propSetData)(VSMap *map, const char *key, const char *data, int size, int append) VS_NOEXCEPT;
int (VS_CC *propSetNode)(VSMap *map, const char *key, VSNodeRef *node, int append) VS_NOEXCEPT;
int (VS_CC *propSetFrame)(VSMap *map, const char *key, const VSFrameRef *f, int append) VS_NOEXCEPT;
int (VS_CC *propSetFunc)(VSMap *map, const char *key, VSFuncRef *func, int append) VS_NOEXCEPT;
int64_t (VS_CC *setMaxCacheSize)(int64_t bytes, VSCore *core) VS_NOEXCEPT;
int (VS_CC *getOutputIndex)(VSFrameContext *frameCtx) VS_NOEXCEPT;
VSFrameRef *(VS_CC *newVideoFrame2)(const VSFormat *format, int width, int height, const VSFrameRef **planeSrc, const int *planes, const VSFrameRef *propSrc, VSCore *core) VS_NOEXCEPT;
VS_DEPRECATE("setMessageHandler has been deprecated as of api 3.6, use addMessageHandler and removeMessageHandler instead")
void (VS_CC *setMessageHandler)(VSMessageHandler handler, void *userData) VS_NOEXCEPT;
int (VS_CC *setThreadCount)(int threads, VSCore *core) VS_NOEXCEPT;
const char *(VS_CC *getPluginPath)(const VSPlugin *plugin) VS_NOEXCEPT;
/* api 3.1 */
const int64_t *(VS_CC *propGetIntArray)(const VSMap *map, const char *key, int *error) VS_NOEXCEPT;
const double *(VS_CC *propGetFloatArray)(const VSMap *map, const char *key, int *error) VS_NOEXCEPT;
int (VS_CC *propSetIntArray)(VSMap *map, const char *key, const int64_t *i, int size) VS_NOEXCEPT;
int (VS_CC *propSetFloatArray)(VSMap *map, const char *key, const double *d, int size) VS_NOEXCEPT;
/* api 3.4 */
void (VS_CC *logMessage)(int msgType, const char *msg) VS_NOEXCEPT;
/* api 3.6 */
int (VS_CC *addMessageHandler)(VSMessageHandler handler, VSMessageHandlerFree free, void *userData) VS_NOEXCEPT;
int (VS_CC *removeMessageHandler)(int id) VS_NOEXCEPT;
void (VS_CC *getCoreInfo2)(VSCore *core, VSCoreInfo *info) VS_NOEXCEPT;
};
VS_API(const VSAPI *) getVapourSynthAPI(int version) VS_NOEXCEPT;
#endif /* VAPOURSYNTH_H */

View File

@@ -1,484 +0,0 @@
/*
* Copyright (c) 2012-2021 Fredrik Mellbin
*
* This file is part of VapourSynth.
*
* VapourSynth is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* VapourSynth is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with VapourSynth; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef VAPOURSYNTH4_H
#define VAPOURSYNTH4_H
#include <stdint.h>
#include <stddef.h>
#define VS_MAKE_VERSION(major, minor) (((major) << 16) | (minor))
#define VAPOURSYNTH_API_MAJOR 4
#define VAPOURSYNTH_API_MINOR 0
#define VAPOURSYNTH_API_VERSION VS_MAKE_VERSION(VAPOURSYNTH_API_MAJOR, VAPOURSYNTH_API_MINOR)
#define VS_AUDIO_FRAME_SAMPLES 3072
/* Convenience for C++ users. */
#ifdef __cplusplus
# define VS_EXTERN_C extern "C"
# if __cplusplus >= 201103L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201103L)
# define VS_NOEXCEPT noexcept
# else
# define VS_NOEXCEPT
# endif
#else
# define VS_EXTERN_C
# define VS_NOEXCEPT
#endif
#if defined(_WIN32) && !defined(_WIN64)
# define VS_CC __stdcall
#else
# define VS_CC
#endif
/* And now for some symbol hide-and-seek... */
#if defined(_WIN32) /* Windows being special */
# define VS_EXTERNAL_API(ret) VS_EXTERN_C __declspec(dllexport) ret VS_CC
#elif defined(__GNUC__) && __GNUC__ >= 4
# define VS_EXTERNAL_API(ret) VS_EXTERN_C __attribute__((visibility("default"))) ret VS_CC
#else
# define VS_EXTERNAL_API(ret) VS_EXTERN_C ret VS_CC
#endif
#if !defined(VS_CORE_EXPORTS) && defined(_WIN32)
# define VS_API(ret) VS_EXTERN_C __declspec(dllimport) ret VS_CC
#else
# define VS_API(ret) VS_EXTERNAL_API(ret)
#endif
typedef struct VSFrame VSFrame;
typedef struct VSNode VSNode;
typedef struct VSCore VSCore;
typedef struct VSPlugin VSPlugin;
typedef struct VSPluginFunction VSPluginFunction;
typedef struct VSFunction VSFunction;
typedef struct VSMap VSMap;
typedef struct VSLogHandle VSLogHandle;
typedef struct VSFrameContext VSFrameContext;
typedef struct VSPLUGINAPI VSPLUGINAPI;
typedef struct VSAPI VSAPI;
typedef enum VSColorFamily {
cfUndefined = 0,
cfGray = 1,
cfRGB = 2,
cfYUV = 3
} VSColorFamily;
typedef enum VSSampleType {
stInteger = 0,
stFloat = 1
} VSSampleType;
#define VS_MAKE_VIDEO_ID(colorFamily, sampleType, bitsPerSample, subSamplingW, subSamplingH) ((colorFamily << 28) | (sampleType << 24) | (bitsPerSample << 16) | (subSamplingW << 8) | (subSamplingH << 0))
typedef enum VSPresetFormat {
pfNone = 0,
pfGray8 = VS_MAKE_VIDEO_ID(cfGray, stInteger, 8, 0, 0),
pfGray9 = VS_MAKE_VIDEO_ID(cfGray, stInteger, 9, 0, 0),
pfGray10 = VS_MAKE_VIDEO_ID(cfGray, stInteger, 10, 0, 0),
pfGray12 = VS_MAKE_VIDEO_ID(cfGray, stInteger, 12, 0, 0),
pfGray14 = VS_MAKE_VIDEO_ID(cfGray, stInteger, 14, 0, 0),
pfGray16 = VS_MAKE_VIDEO_ID(cfGray, stInteger, 16, 0, 0),
pfGray32 = VS_MAKE_VIDEO_ID(cfGray, stInteger, 32, 0, 0),
pfGrayH = VS_MAKE_VIDEO_ID(cfGray, stFloat, 16, 0, 0),
pfGrayS = VS_MAKE_VIDEO_ID(cfGray, stFloat, 32, 0, 0),
pfYUV410P8 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 8, 2, 2),
pfYUV411P8 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 8, 2, 0),
pfYUV440P8 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 8, 0, 1),
pfYUV420P8 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 8, 1, 1),
pfYUV422P8 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 8, 1, 0),
pfYUV444P8 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 8, 0, 0),
pfYUV420P9 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 9, 1, 1),
pfYUV422P9 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 9, 1, 0),
pfYUV444P9 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 9, 0, 0),
pfYUV420P10 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 10, 1, 1),
pfYUV422P10 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 10, 1, 0),
pfYUV444P10 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 10, 0, 0),
pfYUV420P12 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 12, 1, 1),
pfYUV422P12 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 12, 1, 0),
pfYUV444P12 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 12, 0, 0),
pfYUV420P14 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 14, 1, 1),
pfYUV422P14 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 14, 1, 0),
pfYUV444P14 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 14, 0, 0),
pfYUV420P16 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 16, 1, 1),
pfYUV422P16 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 16, 1, 0),
pfYUV444P16 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 16, 0, 0),
pfYUV444PH = VS_MAKE_VIDEO_ID(cfYUV, stFloat, 16, 0, 0),
pfYUV444PS = VS_MAKE_VIDEO_ID(cfYUV, stFloat, 32, 0, 0),
pfRGB24 = VS_MAKE_VIDEO_ID(cfRGB, stInteger, 8, 0, 0),
pfRGB27 = VS_MAKE_VIDEO_ID(cfRGB, stInteger, 9, 0, 0),
pfRGB30 = VS_MAKE_VIDEO_ID(cfRGB, stInteger, 10, 0, 0),
pfRGB36 = VS_MAKE_VIDEO_ID(cfRGB, stInteger, 12, 0, 0),
pfRGB42 = VS_MAKE_VIDEO_ID(cfRGB, stInteger, 14, 0, 0),
pfRGB48 = VS_MAKE_VIDEO_ID(cfRGB, stInteger, 16, 0, 0),
pfRGBH = VS_MAKE_VIDEO_ID(cfRGB, stFloat, 16, 0, 0),
pfRGBS = VS_MAKE_VIDEO_ID(cfRGB, stFloat, 32, 0, 0),
} VSPresetFormat;
#undef VS_MAKE_VIDEO_ID
typedef enum VSFilterMode {
fmParallel = 0, /* completely parallel execution */
fmParallelRequests = 1, /* for filters that are serial in nature but can request one or more frames they need in advance */
fmUnordered = 2, /* for filters that modify their internal state every request like source filters that read a file */
fmFrameState = 3 /* DO NOT USE UNLESS ABSOLUTELY NECESSARY, for compatibility with external code that can only keep the processing state of a single frame at a time */
} VSFilterMode;
typedef enum VSMediaType {
mtVideo = 1,
mtAudio = 2
} VSMediaType;
typedef struct VSVideoFormat {
int colorFamily; /* see VSColorFamily */
int sampleType; /* see VSSampleType */
int bitsPerSample; /* number of significant bits */
int bytesPerSample; /* actual storage is always in a power of 2 and the smallest possible that can fit the number of bits used per sample */
int subSamplingW; /* log2 subsampling factor, applied to second and third plane */
int subSamplingH; /* log2 subsampling factor, applied to second and third plane */
int numPlanes; /* implicit from colorFamily */
} VSVideoFormat;
typedef enum VSAudioChannels {
acFrontLeft = 0,
acFrontRight = 1,
acFrontCenter = 2,
acLowFrequency = 3,
acBackLeft = 4,
acBackRight = 5,
acFrontLeftOFCenter = 6,
acFrontRightOFCenter = 7,
acBackCenter = 8,
acSideLeft = 9,
acSideRight = 10,
acTopCenter = 11,
acTopFrontLeft = 12,
acTopFrontCenter = 13,
acTopFrontRight = 14,
acTopBackLeft = 15,
acTopBackCenter = 16,
acTopBackRight = 17,
acStereoLeft = 29,
acStereoRight = 30,
acWideLeft = 31,
acWideRight = 32,
acSurroundDirectLeft = 33,
acSurroundDirectRight = 34,
acLowFrequency2 = 35
} VSAudioChannels;
typedef struct VSAudioFormat {
int sampleType;
int bitsPerSample;
int bytesPerSample; /* implicit from bitsPerSample */
int numChannels; /* implicit from channelLayout */
uint64_t channelLayout;
} VSAudioFormat;
typedef enum VSPropertyType {
ptUnset = 0,
ptInt = 1,
ptFloat = 2,
ptData = 3,
ptFunction = 4,
ptVideoNode = 5,
ptAudioNode = 6,
ptVideoFrame = 7,
ptAudioFrame = 8
} VSPropertyType;
typedef enum VSMapPropertyError {
peSuccess = 0,
peUnset = 1, /* no key exists */
peType = 2, /* key exists but not of a compatible type */
peIndex = 4, /* index out of bounds */
peError = 3 /* map has error state set */
} VSMapPropertyError;
typedef enum VSMapAppendMode {
maReplace = 0,
maAppend = 1
} VSMapAppendMode;
typedef struct VSCoreInfo {
const char *versionString;
int core;
int api;
int numThreads;
int64_t maxFramebufferSize;
int64_t usedFramebufferSize;
} VSCoreInfo;
typedef struct VSVideoInfo {
VSVideoFormat format;
int64_t fpsNum;
int64_t fpsDen;
int width;
int height;
int numFrames;
} VSVideoInfo;
typedef struct VSAudioInfo {
VSAudioFormat format;
int sampleRate;
int64_t numSamples;
int numFrames; /* the total number of audio frames needed to hold numSamples, implicit from numSamples when calling createAudioFilter */
} VSAudioInfo;
typedef enum VSActivationReason {
arInitial = 0,
arAllFramesReady = 1,
arError = -1
} VSActivationReason;
typedef enum VSMessageType {
mtDebug = 0,
mtInformation = 1,
mtWarning = 2,
mtCritical = 3,
mtFatal = 4 /* also terminates the process, should generally not be used by normal filters */
} VSMessageType;
typedef enum VSCoreCreationFlags {
ccfEnableGraphInspection = 1,
ccfDisableAutoLoading = 2,
ccfDisableLibraryUnloading = 4
} VSCoreCreationFlags;
typedef enum VSPluginConfigFlags {
pcModifiable = 1
} VSPluginConfigFlags;
typedef enum VSDataTypeHint {
dtUnknown = -1,
dtBinary = 0,
dtUtf8 = 1
} VSDataTypeHint;
typedef enum VSRequestPattern {
rpGeneral = 0, /* General pattern */
rpNoFrameReuse = 1, /* When requesting all output frames from the filter no frame will be requested more than once from this input clip, never requests frames beyond the end of the clip */
rpStrictSpatial = 2 /* Always (and only) requests frame n from input clip when generating output frame n, never requests frames beyond the end of the clip */
} VSRequestPattern;
/* Core entry point */
typedef const VSAPI *(VS_CC *VSGetVapourSynthAPI)(int version);
/* Plugin, function and filter related */
typedef void (VS_CC *VSPublicFunction)(const VSMap *in, VSMap *out, void *userData, VSCore *core, const VSAPI *vsapi);
typedef void (VS_CC *VSInitPlugin)(VSPlugin *plugin, const VSPLUGINAPI *vspapi);
typedef void (VS_CC *VSFreeFunctionData)(void *userData);
typedef const VSFrame *(VS_CC *VSFilterGetFrame)(int n, int activationReason, void *instanceData, void **frameData, VSFrameContext *frameCtx, VSCore *core, const VSAPI *vsapi);
typedef void (VS_CC *VSFilterFree)(void *instanceData, VSCore *core, const VSAPI *vsapi);
/* Other */
typedef void (VS_CC *VSFrameDoneCallback)(void *userData, const VSFrame *f, int n, VSNode *node, const char *errorMsg);
typedef void (VS_CC *VSLogHandler)(int msgType, const char *msg, void *userData);
typedef void (VS_CC *VSLogHandlerFree)(void *userData);
struct VSPLUGINAPI {
int (VS_CC *getAPIVersion)(void) VS_NOEXCEPT; /* returns VAPOURSYNTH_API_VERSION of the library */
int (VS_CC *configPlugin)(const char *identifier, const char *pluginNamespace, const char *name, int pluginVersion, int apiVersion, int flags, VSPlugin *plugin) VS_NOEXCEPT; /* use the VS_MAKE_VERSION macro for pluginVersion */
int (VS_CC *registerFunction)(const char *name, const char *args, const char *returnType, VSPublicFunction argsFunc, void *functionData, VSPlugin *plugin) VS_NOEXCEPT; /* non-zero return value on success */
};
typedef struct VSFilterDependency {
VSNode *source;
int requestPattern; /* VSRequestPattern */
} VSFilterDependency;
struct VSAPI {
/* Audio and video filter related including nodes */
void (VS_CC *createVideoFilter)(VSMap *out, const char *name, const VSVideoInfo *vi, VSFilterGetFrame getFrame, VSFilterFree free, int filterMode, const VSFilterDependency *dependencies, int numDeps, void *instanceData, VSCore *core) VS_NOEXCEPT; /* output nodes are appended to the clip key in the out map */
VSNode *(VS_CC *createVideoFilter2)(const char *name, const VSVideoInfo *vi, VSFilterGetFrame getFrame, VSFilterFree free, int filterMode, const VSFilterDependency *dependencies, int numDeps, void *instanceData, VSCore *core) VS_NOEXCEPT; /* same as createVideoFilter but returns a pointer to the VSNode directly or NULL on failure */
void (VS_CC *createAudioFilter)(VSMap *out, const char *name, const VSAudioInfo *ai, VSFilterGetFrame getFrame, VSFilterFree free, int filterMode, const VSFilterDependency *dependencies, int numDeps, void *instanceData, VSCore *core) VS_NOEXCEPT; /* output nodes are appended to the clip key in the out map */
VSNode *(VS_CC *createAudioFilter2)(const char *name, const VSAudioInfo *ai, VSFilterGetFrame getFrame, VSFilterFree free, int filterMode, const VSFilterDependency *dependencies, int numDeps, void *instanceData, VSCore *core) VS_NOEXCEPT; /* same as createAudioFilter but returns a pointer to the VSNode directly or NULL on failure */
int (VS_CC *setLinearFilter)(VSNode *node) VS_NOEXCEPT; /* Use right after create*Filter*, sets the correct cache mode for using the cacheFrame API and returns the recommended upper number of additional frames to cache per request */
void (VS_CC *setCacheMode)(VSNode *node, int mode) VS_NOEXCEPT; /* -1: default (auto), 0: force disable, 1: force enable, changing the cache mode also resets all options to their default */
void (VS_CC *setCacheOptions)(VSNode *node, int fixedSize, int maxSize, int maxHistorySize) VS_NOEXCEPT; /* passing -1 means no change */
void (VS_CC *freeNode)(VSNode *node) VS_NOEXCEPT;
VSNode *(VS_CC *addNodeRef)(VSNode *node) VS_NOEXCEPT;
int (VS_CC *getNodeType)(VSNode *node) VS_NOEXCEPT; /* returns VSMediaType */
const VSVideoInfo *(VS_CC *getVideoInfo)(VSNode *node) VS_NOEXCEPT;
const VSAudioInfo *(VS_CC *getAudioInfo)(VSNode *node) VS_NOEXCEPT;
/* Frame related functions */
VSFrame *(VS_CC *newVideoFrame)(const VSVideoFormat *format, int width, int height, const VSFrame *propSrc, VSCore *core) VS_NOEXCEPT;
VSFrame *(VS_CC *newVideoFrame2)(const VSVideoFormat *format, int width, int height, const VSFrame **planeSrc, const int *planes, const VSFrame *propSrc, VSCore *core) VS_NOEXCEPT; /* same as newVideoFrame but allows the specified planes to be effectively copied from the source frames */
VSFrame *(VS_CC *newAudioFrame)(const VSAudioFormat *format, int numSamples, const VSFrame *propSrc, VSCore *core) VS_NOEXCEPT;
VSFrame *(VS_CC *newAudioFrame2)(const VSAudioFormat *format, int numSamples, const VSFrame **channelSrc, const int *channels, const VSFrame *propSrc, VSCore *core) VS_NOEXCEPT; /* same as newAudioFrame but allows the specified channels to be effectively copied from the source frames */
void (VS_CC *freeFrame)(const VSFrame *f) VS_NOEXCEPT;
const VSFrame *(VS_CC *addFrameRef)(const VSFrame *f) VS_NOEXCEPT;
VSFrame *(VS_CC *copyFrame)(const VSFrame *f, VSCore *core) VS_NOEXCEPT;
const VSMap *(VS_CC *getFramePropertiesRO)(const VSFrame *f) VS_NOEXCEPT;
VSMap *(VS_CC *getFramePropertiesRW)(VSFrame *f) VS_NOEXCEPT;
ptrdiff_t (VS_CC *getStride)(const VSFrame *f, int plane) VS_NOEXCEPT;
const uint8_t *(VS_CC *getReadPtr)(const VSFrame *f, int plane) VS_NOEXCEPT;
uint8_t *(VS_CC *getWritePtr)(VSFrame *f, int plane) VS_NOEXCEPT; /* calling this function invalidates previously gotten read pointers to the same frame */
const VSVideoFormat *(VS_CC *getVideoFrameFormat)(const VSFrame *f) VS_NOEXCEPT;
const VSAudioFormat *(VS_CC *getAudioFrameFormat)(const VSFrame *f) VS_NOEXCEPT;
int (VS_CC *getFrameType)(const VSFrame *f) VS_NOEXCEPT; /* returns VSMediaType */
int (VS_CC *getFrameWidth)(const VSFrame *f, int plane) VS_NOEXCEPT;
int (VS_CC *getFrameHeight)(const VSFrame *f, int plane) VS_NOEXCEPT;
int (VS_CC *getFrameLength)(const VSFrame *f) VS_NOEXCEPT; /* returns the number of samples for audio frames */
/* General format functions */
int (VS_CC *getVideoFormatName)(const VSVideoFormat *format, char *buffer) VS_NOEXCEPT; /* up to 32 characters including terminating null may be written to the buffer, non-zero return value on success */
int (VS_CC *getAudioFormatName)(const VSAudioFormat *format, char *buffer) VS_NOEXCEPT; /* up to 32 characters including terminating null may be written to the buffer, non-zero return value on success */
int (VS_CC *queryVideoFormat)(VSVideoFormat *format, int colorFamily, int sampleType, int bitsPerSample, int subSamplingW, int subSamplingH, VSCore *core) VS_NOEXCEPT; /* non-zero return value on success */
int (VS_CC *queryAudioFormat)(VSAudioFormat *format, int sampleType, int bitsPerSample, uint64_t channelLayout, VSCore *core) VS_NOEXCEPT; /* non-zero return value on success */
uint32_t (VS_CC *queryVideoFormatID)(int colorFamily, int sampleType, int bitsPerSample, int subSamplingW, int subSamplingH, VSCore *core) VS_NOEXCEPT; /* returns 0 on failure */
int (VS_CC *getVideoFormatByID)(VSVideoFormat *format, uint32_t id, VSCore *core) VS_NOEXCEPT; /* non-zero return value on success */
/* Frame request and filter getframe functions */
const VSFrame *(VS_CC *getFrame)(int n, VSNode *node, char *errorMsg, int bufSize) VS_NOEXCEPT; /* only for external applications using the core as a library or for requesting frames in a filter constructor, do not use inside a filter's getframe function */
void (VS_CC *getFrameAsync)(int n, VSNode *node, VSFrameDoneCallback callback, void *userData) VS_NOEXCEPT; /* only for external applications using the core as a library or for requesting frames in a filter constructor, do not use inside a filter's getframe function */
const VSFrame *(VS_CC *getFrameFilter)(int n, VSNode *node, VSFrameContext *frameCtx) VS_NOEXCEPT; /* only use inside a filter's getframe function */
void (VS_CC *requestFrameFilter)(int n, VSNode *node, VSFrameContext *frameCtx) VS_NOEXCEPT; /* only use inside a filter's getframe function */
void (VS_CC *releaseFrameEarly)(VSNode *node, int n, VSFrameContext *frameCtx) VS_NOEXCEPT; /* only use inside a filter's getframe function, unless this function is called a requested frame is kept in memory until the end of processing the current frame */
void (VS_CC *cacheFrame)(const VSFrame *frame, int n, VSFrameContext *frameCtx) VS_NOEXCEPT; /* used to store intermediate frames in cache, useful for filters where random access is slow, must call setLinearFilter on the node before using or the result is undefined */
void (VS_CC *setFilterError)(const char *errorMessage, VSFrameContext *frameCtx) VS_NOEXCEPT; /* used to signal errors in the filter getframe function */
/* External functions */
VSFunction *(VS_CC *createFunction)(VSPublicFunction func, void *userData, VSFreeFunctionData free, VSCore *core) VS_NOEXCEPT;
void (VS_CC *freeFunction)(VSFunction *f) VS_NOEXCEPT;
VSFunction *(VS_CC *addFunctionRef)(VSFunction *f) VS_NOEXCEPT;
void (VS_CC *callFunction)(VSFunction *func, const VSMap *in, VSMap *out) VS_NOEXCEPT;
/* Map and property access functions */
VSMap *(VS_CC *createMap)(void) VS_NOEXCEPT;
void (VS_CC *freeMap)(VSMap *map) VS_NOEXCEPT;
void (VS_CC *clearMap)(VSMap *map) VS_NOEXCEPT;
void (VS_CC *copyMap)(const VSMap *src, VSMap *dst) VS_NOEXCEPT; /* copies all values in src to dst, if a key already exists in dst it's replaced */
void (VS_CC *mapSetError)(VSMap *map, const char *errorMessage) VS_NOEXCEPT; /* used to signal errors outside filter getframe function */
const char *(VS_CC *mapGetError)(const VSMap *map) VS_NOEXCEPT; /* used to query errors, returns 0 if no error */
int (VS_CC *mapNumKeys)(const VSMap *map) VS_NOEXCEPT;
const char *(VS_CC *mapGetKey)(const VSMap *map, int index) VS_NOEXCEPT;
int (VS_CC *mapDeleteKey)(VSMap *map, const char *key) VS_NOEXCEPT;
int (VS_CC *mapNumElements)(const VSMap *map, const char *key) VS_NOEXCEPT; /* returns -1 if a key doesn't exist */
int (VS_CC *mapGetType)(const VSMap *map, const char *key) VS_NOEXCEPT; /* returns VSPropertyType */
int (VS_CC *mapSetEmpty)(VSMap *map, const char *key, int type) VS_NOEXCEPT;
int64_t (VS_CC *mapGetInt)(const VSMap *map, const char *key, int index, int *error) VS_NOEXCEPT;
int (VS_CC *mapGetIntSaturated)(const VSMap *map, const char *key, int index, int *error) VS_NOEXCEPT;
const int64_t *(VS_CC *mapGetIntArray)(const VSMap *map, const char *key, int *error) VS_NOEXCEPT;
int (VS_CC *mapSetInt)(VSMap *map, const char *key, int64_t i, int append) VS_NOEXCEPT;
int (VS_CC *mapSetIntArray)(VSMap *map, const char *key, const int64_t *i, int size) VS_NOEXCEPT;
double (VS_CC *mapGetFloat)(const VSMap *map, const char *key, int index, int *error) VS_NOEXCEPT;
float (VS_CC *mapGetFloatSaturated)(const VSMap *map, const char *key, int index, int *error) VS_NOEXCEPT;
const double *(VS_CC *mapGetFloatArray)(const VSMap *map, const char *key, int *error) VS_NOEXCEPT;
int (VS_CC *mapSetFloat)(VSMap *map, const char *key, double d, int append) VS_NOEXCEPT;
int (VS_CC *mapSetFloatArray)(VSMap *map, const char *key, const double *d, int size) VS_NOEXCEPT;
const char *(VS_CC *mapGetData)(const VSMap *map, const char *key, int index, int *error) VS_NOEXCEPT;
int (VS_CC *mapGetDataSize)(const VSMap *map, const char *key, int index, int *error) VS_NOEXCEPT;
int (VS_CC *mapGetDataTypeHint)(const VSMap *map, const char *key, int index, int *error) VS_NOEXCEPT; /* returns VSDataTypeHint */
int (VS_CC *mapSetData)(VSMap *map, const char *key, const char *data, int size, int type, int append) VS_NOEXCEPT;
VSNode *(VS_CC *mapGetNode)(const VSMap *map, const char *key, int index, int *error) VS_NOEXCEPT;
int (VS_CC *mapSetNode)(VSMap *map, const char *key, VSNode *node, int append) VS_NOEXCEPT; /* returns 0 on success */
int (VS_CC *mapConsumeNode)(VSMap *map, const char *key, VSNode *node, int append) VS_NOEXCEPT; /* always consumes the reference, even on error */
const VSFrame *(VS_CC *mapGetFrame)(const VSMap *map, const char *key, int index, int *error) VS_NOEXCEPT;
int (VS_CC *mapSetFrame)(VSMap *map, const char *key, const VSFrame *f, int append) VS_NOEXCEPT; /* returns 0 on success */
int (VS_CC *mapConsumeFrame)(VSMap *map, const char *key, const VSFrame *f, int append) VS_NOEXCEPT; /* always consumes the reference, even on error */
VSFunction *(VS_CC *mapGetFunction)(const VSMap *map, const char *key, int index, int *error) VS_NOEXCEPT;
int (VS_CC *mapSetFunction)(VSMap *map, const char *key, VSFunction *func, int append) VS_NOEXCEPT; /* returns 0 on success */
int (VS_CC *mapConsumeFunction)(VSMap *map, const char *key, VSFunction *func, int append) VS_NOEXCEPT; /* always consumes the reference, even on error */
/* Plugin and plugin function related */
int (VS_CC *registerFunction)(const char *name, const char *args, const char *returnType, VSPublicFunction argsFunc, void *functionData, VSPlugin *plugin) VS_NOEXCEPT; /* non-zero return value on success */
VSPlugin *(VS_CC *getPluginByID)(const char *identifier, VSCore *core) VS_NOEXCEPT;
VSPlugin *(VS_CC *getPluginByNamespace)(const char *ns, VSCore *core) VS_NOEXCEPT;
VSPlugin *(VS_CC *getNextPlugin)(VSPlugin *plugin, VSCore *core) VS_NOEXCEPT; /* pass NULL to get the first plugin */
const char *(VS_CC *getPluginName)(VSPlugin *plugin) VS_NOEXCEPT;
const char *(VS_CC *getPluginID)(VSPlugin *plugin) VS_NOEXCEPT;
const char *(VS_CC *getPluginNamespace)(VSPlugin *plugin) VS_NOEXCEPT;
VSPluginFunction *(VS_CC *getNextPluginFunction)(VSPluginFunction *func, VSPlugin *plugin) VS_NOEXCEPT; /* pass NULL to get the first plugin function */
VSPluginFunction *(VS_CC *getPluginFunctionByName)(const char *name, VSPlugin *plugin) VS_NOEXCEPT;
const char *(VS_CC *getPluginFunctionName)(VSPluginFunction *func) VS_NOEXCEPT;
const char *(VS_CC *getPluginFunctionArguments)(VSPluginFunction *func) VS_NOEXCEPT; /* returns an argument format string */
const char *(VS_CC *getPluginFunctionReturnType)(VSPluginFunction *func) VS_NOEXCEPT; /* returns an argument format string */
const char *(VS_CC *getPluginPath)(const VSPlugin *plugin) VS_NOEXCEPT; /* the full path to the loaded library file containing the plugin entry point */
int (VS_CC *getPluginVersion)(const VSPlugin *plugin) VS_NOEXCEPT;
VSMap *(VS_CC *invoke)(VSPlugin *plugin, const char *name, const VSMap *args) VS_NOEXCEPT; /* user must free the returned VSMap */
/* Core and information */
VSCore *(VS_CC *createCore)(int flags) VS_NOEXCEPT; /* flags uses the VSCoreCreationFlags enum */
void (VS_CC *freeCore)(VSCore *core) VS_NOEXCEPT; /* only call this function after all node, frame and function references belonging to the core have been freed */
int64_t(VS_CC *setMaxCacheSize)(int64_t bytes, VSCore *core) VS_NOEXCEPT; /* the total cache size at which vapoursynth more aggressively tries to reclaim memory, it is not a hard limit */
int (VS_CC *setThreadCount)(int threads, VSCore *core) VS_NOEXCEPT; /* setting threads to 0 means automatic detection */
void (VS_CC *getCoreInfo)(VSCore *core, VSCoreInfo *info) VS_NOEXCEPT;
int (VS_CC *getAPIVersion)(void) VS_NOEXCEPT;
/* Message handler */
void (VS_CC *logMessage)(int msgType, const char *msg, VSCore *core) VS_NOEXCEPT;
VSLogHandle *(VS_CC *addLogHandler)(VSLogHandler handler, VSLogHandlerFree free, void *userData, VSCore *core) VS_NOEXCEPT; /* free and userData can be NULL, returns a handle that can be passed to removeLogHandler */
int (VS_CC *removeLogHandler)(VSLogHandle *handle, VSCore *core) VS_NOEXCEPT; /* returns non-zero if successfully removed */
#ifdef VS_GRAPH_API
/* Graph information */
/*
* NOT PART OF THE STABLE API!
* These functions only exist to retrieve internal details for debug purposes and graph visualization
* They will only only work properly when used on a core created with ccfEnableGraphInspection and are
* not safe to use concurrently with frame requests or other API functions
* NOT PART OF THE STABLE API!
*/
const char *(VS_CC *getNodeCreationFunctionName)(VSNode *node, int level) VS_NOEXCEPT; /* level=0 returns the name of the function that created the filter, specifying a higher level will retrieve the function above that invoked it or NULL if a non-existent level is requested */
const VSMap *(VS_CC *getNodeCreationFunctionArguments)(VSNode *node, int level) VS_NOEXCEPT; /* level=0 returns a copy of the arguments passed to the function that created the filter, returns NULL if a non-existent level is requested */
const char *(VS_CC *getNodeName)(VSNode *node) VS_NOEXCEPT; /* the name passed to create*Filter */
int (VS_CC *getNodeFilterMode)(VSNode *node) VS_NOEXCEPT; /* VSFilterMode */
int64_t (VS_CC *getNodeFilterTime)(VSNode *node) VS_NOEXCEPT; /* time spent processing frames in nanoseconds */
const VSFilterDependency *(VS_CC *getNodeDependencies)(VSNode *node) VS_NOEXCEPT;
int (VS_CC *getNumNodeDependencies)(VSNode *node) VS_NOEXCEPT;
#endif
};
VS_API(const VSAPI *) getVapourSynthAPI(int version) VS_NOEXCEPT;
#endif /* VAPOURSYNTH4_H */

Binary file not shown.