mirror of
https://github.com/game-stop/veejay.git
synced 2025-12-19 22:30:06 +01:00
GMIC plugin pack for veejay
This commit is contained in:
0
veejay-current/plugin-packs/lvdgmic/ChangeLog
Normal file
0
veejay-current/plugin-packs/lvdgmic/ChangeLog
Normal file
370
veejay-current/plugin-packs/lvdgmic/INSTALL
Normal file
370
veejay-current/plugin-packs/lvdgmic/INSTALL
Normal file
@@ -0,0 +1,370 @@
|
||||
Installation Instructions
|
||||
*************************
|
||||
|
||||
Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
Copying and distribution of this file, with or without modification,
|
||||
are permitted in any medium without royalty provided the copyright
|
||||
notice and this notice are preserved. This file is offered as-is,
|
||||
without warranty of any kind.
|
||||
|
||||
Basic Installation
|
||||
==================
|
||||
|
||||
Briefly, the shell commands `./configure; make; make install' should
|
||||
configure, build, and install this package. The following
|
||||
more-detailed instructions are generic; see the `README' file for
|
||||
instructions specific to this package. Some packages provide this
|
||||
`INSTALL' file but do not implement all of the features documented
|
||||
below. The lack of an optional feature in a given package is not
|
||||
necessarily a bug. More recommendations for GNU packages can be found
|
||||
in *note Makefile Conventions: (standards)Makefile Conventions.
|
||||
|
||||
The `configure' shell script attempts to guess correct values for
|
||||
various system-dependent variables used during compilation. It uses
|
||||
those values to create a `Makefile' in each directory of the package.
|
||||
It may also create one or more `.h' files containing system-dependent
|
||||
definitions. Finally, it creates a shell script `config.status' that
|
||||
you can run in the future to recreate the current configuration, and a
|
||||
file `config.log' containing compiler output (useful mainly for
|
||||
debugging `configure').
|
||||
|
||||
It can also use an optional file (typically called `config.cache'
|
||||
and enabled with `--cache-file=config.cache' or simply `-C') that saves
|
||||
the results of its tests to speed up reconfiguring. Caching is
|
||||
disabled by default to prevent problems with accidental use of stale
|
||||
cache files.
|
||||
|
||||
If you need to do unusual things to compile the package, please try
|
||||
to figure out how `configure' could check whether to do them, and mail
|
||||
diffs or instructions to the address given in the `README' so they can
|
||||
be considered for the next release. If you are using the cache, and at
|
||||
some point `config.cache' contains results you don't want to keep, you
|
||||
may remove or edit it.
|
||||
|
||||
The file `configure.ac' (or `configure.in') is used to create
|
||||
`configure' by a program called `autoconf'. You need `configure.ac' if
|
||||
you want to change it or regenerate `configure' using a newer version
|
||||
of `autoconf'.
|
||||
|
||||
The simplest way to compile this package is:
|
||||
|
||||
1. `cd' to the directory containing the package's source code and type
|
||||
`./configure' to configure the package for your system.
|
||||
|
||||
Running `configure' might take a while. While running, it prints
|
||||
some messages telling which features it is checking for.
|
||||
|
||||
2. Type `make' to compile the package.
|
||||
|
||||
3. Optionally, type `make check' to run any self-tests that come with
|
||||
the package, generally using the just-built uninstalled binaries.
|
||||
|
||||
4. Type `make install' to install the programs and any data files and
|
||||
documentation. When installing into a prefix owned by root, it is
|
||||
recommended that the package be configured and built as a regular
|
||||
user, and only the `make install' phase executed with root
|
||||
privileges.
|
||||
|
||||
5. Optionally, type `make installcheck' to repeat any self-tests, but
|
||||
this time using the binaries in their final installed location.
|
||||
This target does not install anything. Running this target as a
|
||||
regular user, particularly if the prior `make install' required
|
||||
root privileges, verifies that the installation completed
|
||||
correctly.
|
||||
|
||||
6. You can remove the program binaries and object files from the
|
||||
source code directory by typing `make clean'. To also remove the
|
||||
files that `configure' created (so you can compile the package for
|
||||
a different kind of computer), type `make distclean'. There is
|
||||
also a `make maintainer-clean' target, but that is intended mainly
|
||||
for the package's developers. If you use it, you may have to get
|
||||
all sorts of other programs in order to regenerate files that came
|
||||
with the distribution.
|
||||
|
||||
7. Often, you can also type `make uninstall' to remove the installed
|
||||
files again. In practice, not all packages have tested that
|
||||
uninstallation works correctly, even though it is required by the
|
||||
GNU Coding Standards.
|
||||
|
||||
8. Some packages, particularly those that use Automake, provide `make
|
||||
distcheck', which can by used by developers to test that all other
|
||||
targets like `make install' and `make uninstall' work correctly.
|
||||
This target is generally not run by end users.
|
||||
|
||||
Compilers and Options
|
||||
=====================
|
||||
|
||||
Some systems require unusual options for compilation or linking that
|
||||
the `configure' script does not know about. Run `./configure --help'
|
||||
for details on some of the pertinent environment variables.
|
||||
|
||||
You can give `configure' initial values for configuration parameters
|
||||
by setting variables in the command line or in the environment. Here
|
||||
is an example:
|
||||
|
||||
./configure CC=c99 CFLAGS=-g LIBS=-lposix
|
||||
|
||||
*Note Defining Variables::, for more details.
|
||||
|
||||
Compiling For Multiple Architectures
|
||||
====================================
|
||||
|
||||
You can compile the package for more than one kind of computer at the
|
||||
same time, by placing the object files for each architecture in their
|
||||
own directory. To do this, you can use GNU `make'. `cd' to the
|
||||
directory where you want the object files and executables to go and run
|
||||
the `configure' script. `configure' automatically checks for the
|
||||
source code in the directory that `configure' is in and in `..'. This
|
||||
is known as a "VPATH" build.
|
||||
|
||||
With a non-GNU `make', it is safer to compile the package for one
|
||||
architecture at a time in the source code directory. After you have
|
||||
installed the package for one architecture, use `make distclean' before
|
||||
reconfiguring for another architecture.
|
||||
|
||||
On MacOS X 10.5 and later systems, you can create libraries and
|
||||
executables that work on multiple system types--known as "fat" or
|
||||
"universal" binaries--by specifying multiple `-arch' options to the
|
||||
compiler but only a single `-arch' option to the preprocessor. Like
|
||||
this:
|
||||
|
||||
./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
|
||||
CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
|
||||
CPP="gcc -E" CXXCPP="g++ -E"
|
||||
|
||||
This is not guaranteed to produce working output in all cases, you
|
||||
may have to build one architecture at a time and combine the results
|
||||
using the `lipo' tool if you have problems.
|
||||
|
||||
Installation Names
|
||||
==================
|
||||
|
||||
By default, `make install' installs the package's commands under
|
||||
`/usr/local/bin', include files under `/usr/local/include', etc. You
|
||||
can specify an installation prefix other than `/usr/local' by giving
|
||||
`configure' the option `--prefix=PREFIX', where PREFIX must be an
|
||||
absolute file name.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
|
||||
PREFIX as the prefix for installing programs and libraries.
|
||||
Documentation and other data files still use the regular prefix.
|
||||
|
||||
In addition, if you use an unusual directory layout you can give
|
||||
options like `--bindir=DIR' to specify different values for particular
|
||||
kinds of files. Run `configure --help' for a list of the directories
|
||||
you can set and what kinds of files go in them. In general, the
|
||||
default for these options is expressed in terms of `${prefix}', so that
|
||||
specifying just `--prefix' will affect all of the other directory
|
||||
specifications that were not explicitly provided.
|
||||
|
||||
The most portable way to affect installation locations is to pass the
|
||||
correct locations to `configure'; however, many packages provide one or
|
||||
both of the following shortcuts of passing variable assignments to the
|
||||
`make install' command line to change installation locations without
|
||||
having to reconfigure or recompile.
|
||||
|
||||
The first method involves providing an override variable for each
|
||||
affected directory. For example, `make install
|
||||
prefix=/alternate/directory' will choose an alternate location for all
|
||||
directory configuration variables that were expressed in terms of
|
||||
`${prefix}'. Any directories that were specified during `configure',
|
||||
but not in terms of `${prefix}', must each be overridden at install
|
||||
time for the entire installation to be relocated. The approach of
|
||||
makefile variable overrides for each directory variable is required by
|
||||
the GNU Coding Standards, and ideally causes no recompilation.
|
||||
However, some platforms have known limitations with the semantics of
|
||||
shared libraries that end up requiring recompilation when using this
|
||||
method, particularly noticeable in packages that use GNU Libtool.
|
||||
|
||||
The second method involves providing the `DESTDIR' variable. For
|
||||
example, `make install DESTDIR=/alternate/directory' will prepend
|
||||
`/alternate/directory' before all installation names. The approach of
|
||||
`DESTDIR' overrides is not required by the GNU Coding Standards, and
|
||||
does not work on platforms that have drive letters. On the other hand,
|
||||
it does better at avoiding recompilation issues, and works well even
|
||||
when some directory options were not specified in terms of `${prefix}'
|
||||
at `configure' time.
|
||||
|
||||
Optional Features
|
||||
=================
|
||||
|
||||
If the package supports it, you can cause programs to be installed
|
||||
with an extra prefix or suffix on their names by giving `configure' the
|
||||
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||
|
||||
Some packages pay attention to `--enable-FEATURE' options to
|
||||
`configure', where FEATURE indicates an optional part of the package.
|
||||
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||
is something like `gnu-as' or `x' (for the X Window System). The
|
||||
`README' should mention any `--enable-' and `--with-' options that the
|
||||
package recognizes.
|
||||
|
||||
For packages that use the X Window System, `configure' can usually
|
||||
find the X include and library files automatically, but if it doesn't,
|
||||
you can use the `configure' options `--x-includes=DIR' and
|
||||
`--x-libraries=DIR' to specify their locations.
|
||||
|
||||
Some packages offer the ability to configure how verbose the
|
||||
execution of `make' will be. For these packages, running `./configure
|
||||
--enable-silent-rules' sets the default to minimal output, which can be
|
||||
overridden with `make V=1'; while running `./configure
|
||||
--disable-silent-rules' sets the default to verbose, which can be
|
||||
overridden with `make V=0'.
|
||||
|
||||
Particular systems
|
||||
==================
|
||||
|
||||
On HP-UX, the default C compiler is not ANSI C compatible. If GNU
|
||||
CC is not installed, it is recommended to use the following options in
|
||||
order to use an ANSI C compiler:
|
||||
|
||||
./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
|
||||
|
||||
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
|
||||
|
||||
HP-UX `make' updates targets which have the same time stamps as
|
||||
their prerequisites, which makes it generally unusable when shipped
|
||||
generated files such as `configure' are involved. Use GNU `make'
|
||||
instead.
|
||||
|
||||
On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
|
||||
parse its `<wchar.h>' header file. The option `-nodtk' can be used as
|
||||
a workaround. If GNU CC is not installed, it is therefore recommended
|
||||
to try
|
||||
|
||||
./configure CC="cc"
|
||||
|
||||
and if that doesn't work, try
|
||||
|
||||
./configure CC="cc -nodtk"
|
||||
|
||||
On Solaris, don't put `/usr/ucb' early in your `PATH'. This
|
||||
directory contains several dysfunctional programs; working variants of
|
||||
these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
|
||||
in your `PATH', put it _after_ `/usr/bin'.
|
||||
|
||||
On Haiku, software installed for all users goes in `/boot/common',
|
||||
not `/usr/local'. It is recommended to use the following options:
|
||||
|
||||
./configure --prefix=/boot/common
|
||||
|
||||
Specifying the System Type
|
||||
==========================
|
||||
|
||||
There may be some features `configure' cannot figure out
|
||||
automatically, but needs to determine by the type of machine the package
|
||||
will run on. Usually, assuming the package is built to be run on the
|
||||
_same_ architectures, `configure' can figure that out, but if it prints
|
||||
a message saying it cannot guess the machine type, give it the
|
||||
`--build=TYPE' option. TYPE can either be a short name for the system
|
||||
type, such as `sun4', or a canonical name which has the form:
|
||||
|
||||
CPU-COMPANY-SYSTEM
|
||||
|
||||
where SYSTEM can have one of these forms:
|
||||
|
||||
OS
|
||||
KERNEL-OS
|
||||
|
||||
See the file `config.sub' for the possible values of each field. If
|
||||
`config.sub' isn't included in this package, then this package doesn't
|
||||
need to know the machine type.
|
||||
|
||||
If you are _building_ compiler tools for cross-compiling, you should
|
||||
use the option `--target=TYPE' to select the type of system they will
|
||||
produce code for.
|
||||
|
||||
If you want to _use_ a cross compiler, that generates code for a
|
||||
platform different from the build platform, you should specify the
|
||||
"host" platform (i.e., that on which the generated programs will
|
||||
eventually be run) with `--host=TYPE'.
|
||||
|
||||
Sharing Defaults
|
||||
================
|
||||
|
||||
If you want to set default values for `configure' scripts to share,
|
||||
you can create a site shell script called `config.site' that gives
|
||||
default values for variables like `CC', `cache_file', and `prefix'.
|
||||
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||
`CONFIG_SITE' environment variable to the location of the site script.
|
||||
A warning: not all `configure' scripts look for a site script.
|
||||
|
||||
Defining Variables
|
||||
==================
|
||||
|
||||
Variables not defined in a site shell script can be set in the
|
||||
environment passed to `configure'. However, some packages may run
|
||||
configure again during the build, and the customized values of these
|
||||
variables may be lost. In order to avoid this problem, you should set
|
||||
them in the `configure' command line, using `VAR=value'. For example:
|
||||
|
||||
./configure CC=/usr/local2/bin/gcc
|
||||
|
||||
causes the specified `gcc' to be used as the C compiler (unless it is
|
||||
overridden in the site shell script).
|
||||
|
||||
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
|
||||
an Autoconf bug. Until the bug is fixed you can use this workaround:
|
||||
|
||||
CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
|
||||
|
||||
`configure' Invocation
|
||||
======================
|
||||
|
||||
`configure' recognizes the following options to control how it
|
||||
operates.
|
||||
|
||||
`--help'
|
||||
`-h'
|
||||
Print a summary of all of the options to `configure', and exit.
|
||||
|
||||
`--help=short'
|
||||
`--help=recursive'
|
||||
Print a summary of the options unique to this package's
|
||||
`configure', and exit. The `short' variant lists options used
|
||||
only in the top level, while the `recursive' variant lists options
|
||||
also present in any nested packages.
|
||||
|
||||
`--version'
|
||||
`-V'
|
||||
Print the version of Autoconf used to generate the `configure'
|
||||
script, and exit.
|
||||
|
||||
`--cache-file=FILE'
|
||||
Enable the cache: use and save the results of the tests in FILE,
|
||||
traditionally `config.cache'. FILE defaults to `/dev/null' to
|
||||
disable caching.
|
||||
|
||||
`--config-cache'
|
||||
`-C'
|
||||
Alias for `--cache-file=config.cache'.
|
||||
|
||||
`--quiet'
|
||||
`--silent'
|
||||
`-q'
|
||||
Do not print messages saying which checks are being made. To
|
||||
suppress all normal output, redirect it to `/dev/null' (any error
|
||||
messages will still be shown).
|
||||
|
||||
`--srcdir=DIR'
|
||||
Look for the package's source code in directory DIR. Usually
|
||||
`configure' can determine that directory automatically.
|
||||
|
||||
`--prefix=DIR'
|
||||
Use DIR as the installation prefix. *note Installation Names::
|
||||
for more details, including other options available for fine-tuning
|
||||
the installation locations.
|
||||
|
||||
`--no-create'
|
||||
`-n'
|
||||
Run the configure checks, but stop before creating any output
|
||||
files.
|
||||
|
||||
`configure' also accepts some other, not widely useful, options. Run
|
||||
`configure --help' for more details.
|
||||
|
||||
46
veejay-current/plugin-packs/lvdgmic/Makefile.am
Normal file
46
veejay-current/plugin-packs/lvdgmic/Makefile.am
Normal file
@@ -0,0 +1,46 @@
|
||||
# Process with automake to produce Makefile.in
|
||||
|
||||
SUBDIRS = liblvdgmic plugins
|
||||
|
||||
#
|
||||
# Add any non autoconf'd files here, extra readmes and other misc
|
||||
# info to be copied into the dist
|
||||
#
|
||||
EXTRA_DIST = \
|
||||
autogen.sh\
|
||||
depcomp \
|
||||
autogen.sh
|
||||
|
||||
DISTCLEANFILES = \
|
||||
confdefs.h \
|
||||
config.cache \
|
||||
config.status \
|
||||
config.log
|
||||
|
||||
|
||||
MAINTAINERCLEANFILES = \
|
||||
compile \
|
||||
depcomp \
|
||||
install-sh \
|
||||
missing \
|
||||
mkinstalldirs \
|
||||
Makefile.in \
|
||||
aclocal.m4 \
|
||||
config.guess \
|
||||
config.h.in \
|
||||
config.sub \
|
||||
configure \
|
||||
ltmain.sh \
|
||||
stamp-h.in
|
||||
|
||||
## make rpms
|
||||
rpm: Makefile
|
||||
$(MAKE) dist
|
||||
rpmbuild -ta --clean $(PACKAGE)-$(VERSION).tar.gz
|
||||
|
||||
## make debs
|
||||
deb: Makefile dist
|
||||
-chmod -R +w $(PACKAGE)-$(VERSION)
|
||||
rm -rf $(PACKAGE)-$(VERSION)
|
||||
tar xzf $(PACKAGE)-$(VERSION).tar.gz
|
||||
cd $(PACKAGE)-$(VERSION); dpkg-buildpackage -rfakeroot
|
||||
0
veejay-current/plugin-packs/lvdgmic/NEWS
Normal file
0
veejay-current/plugin-packs/lvdgmic/NEWS
Normal file
26
veejay-current/plugin-packs/lvdgmic/autogen.sh
Executable file
26
veejay-current/plugin-packs/lvdgmic/autogen.sh
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
# Run this to generate all the initial makefiles, etc.
|
||||
|
||||
# if you use autoconf 2.64 or earlier,
|
||||
# you may have to create the m4 directory yourself
|
||||
#
|
||||
|
||||
|
||||
|
||||
## remove the '#' in front of the line for 'autoreconf'
|
||||
|
||||
########################################
|
||||
## newer distributions, ubuntu 11. etc
|
||||
########################################
|
||||
|
||||
if [ ! -d m4 ]; then
|
||||
mkdir m4
|
||||
fi
|
||||
|
||||
autoreconf -v -fi -I m4
|
||||
|
||||
#########################################
|
||||
## slackware 13.1 and older
|
||||
#########################################
|
||||
|
||||
#autoreconf -v -fi
|
||||
331
veejay-current/plugin-packs/lvdgmic/configure.ac
Normal file
331
veejay-current/plugin-packs/lvdgmic/configure.ac
Normal file
@@ -0,0 +1,331 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
dnl AC_INIT
|
||||
AC_INIT([lvdgmic-plugins],[0.0.1],[veejay-users@lists.sourceforge.net])
|
||||
AC_PREREQ(2.57)
|
||||
AC_CONFIG_SRCDIR([liblvdgmic/lvdgmic.cc])
|
||||
|
||||
LVDGMICMAJOR_VERSION=0
|
||||
LVDGMICMINOR_VERSION=0
|
||||
LVDGMICMICRO_VERSION=1
|
||||
LVDGMICVERSION=$LVDGMICMAJOR_VERSION.$LVDGMICMINOR_VERSION.$LVDGMICMICRO_VERSION
|
||||
LVDGMICCODENAME="Livido GMIC filters - build $LVDGMICMINOR_VERSION $LVDGMICMICRO_VERSION"
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
dnl AX_CONFIG_PREFIXED_HEADER([veejay-config.h], [VEEJAY], [config.h])
|
||||
|
||||
AC_CANONICAL_HOST
|
||||
AC_CANONICAL_TARGET
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AM_INIT_AUTOMAKE([1.7])
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
AC_DEFINE(VEEJAYUTIL,1,[Building Livido GMIC filters])
|
||||
AC_DEFINE(HAVE_CONFIG_H,1,[Include config.h])
|
||||
# libtool versioning
|
||||
LT_RELEASE=$LVDGMICMAJOR_VERSION.$LVDGMICMINOR_VERSION
|
||||
LT_CURRENT=$LVDGMICMICRO_VERSION
|
||||
LT_REVISION=$LVDGMICMICRO_VERSION
|
||||
LT_AGE=$LVDGMICMICRO_VERSION
|
||||
AC_SUBST(LT_RELEASE)
|
||||
AC_SUBST(LT_CURRENT)
|
||||
AC_SUBST(LT_REVISION)
|
||||
AC_SUBST(LT_AGE)
|
||||
dnl **********************************************************************
|
||||
dnl Options
|
||||
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
dnl kill CFLAGS
|
||||
CFLAGS=""
|
||||
AC_ARG_ENABLE(strict,
|
||||
AC_HELP_STRING([--enable-strict],
|
||||
[Compile in paranoia assertion checking]))
|
||||
AC_ARG_ENABLE(debug,
|
||||
AC_HELP_STRING([--enable-debug],
|
||||
[Compile in debugging information]))
|
||||
AC_ARG_ENABLE(profile,
|
||||
AC_HELP_STRING([--enable-profiling],
|
||||
[Compile in profiling information]))
|
||||
AC_ARG_ENABLE(compile-warnings,
|
||||
AC_HELP_STRING([--enable-compile-warnings],
|
||||
[Turn on compiler warnings.]))
|
||||
AC_ARG_ENABLE(warnings_as_errors,
|
||||
AC_HELP_STRING([--enable-warnings_as_errors],
|
||||
[Compiler warnings are errors.]))
|
||||
AC_ARG_ENABLE(simd-accel,
|
||||
AC_HELP_STRING([--enable-simd-accel],
|
||||
[use SIMD multimedia instructions such as MMX, AltiVec, etc.if possible]))
|
||||
AC_ARG_WITH(extra-cflags,
|
||||
AC_HELP_STRING([--with-extra-cflags=flags],
|
||||
[Options to be added to CFLAGS (optional)]))
|
||||
|
||||
|
||||
user_specified_target=
|
||||
AC_ARG_WITH(arch-target, AS_HELP_STRING( [--with-arch-target=CPU_TYPE],
|
||||
[Set a specific sub-architecture (defaults to native)]),
|
||||
[ user_specified_target="$withval" ])
|
||||
|
||||
|
||||
|
||||
AC_GNU_SOURCE
|
||||
|
||||
dnl Initialize libtool
|
||||
AC_PROG_LIBTOOL
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_AWK
|
||||
AC_PROG_CC
|
||||
AM_PROG_CC_STDC
|
||||
AC_PROG_YACC
|
||||
AM_PROG_LEX
|
||||
AC_PROG_CXX
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LN_S
|
||||
AC_C_BIGENDIAN
|
||||
AC_C_CONST
|
||||
AC_C_INLINE
|
||||
AC_SYS_LARGEFILE
|
||||
|
||||
dnl configure AS and ASFLAGS...
|
||||
AM_PROG_AS
|
||||
|
||||
AC_CHECK_HEADERS([fenv.h stdint.h inttypes.h sys/types.h alloca.h])
|
||||
|
||||
dnl AX_PREFIXED_DEFINE([VEEJAY], [HAVE_STDINT_H])
|
||||
dnl AX_PREFIXED_DEFINE([VEEJAY], [HAVE_INTTYPES_H])
|
||||
|
||||
AC_CHECK_FUNCS([posix_memalign memalign fmax lround pow bzero gettimeofday memset mmap strndup strstr strncasecmp])
|
||||
AC_CHECK_FUNCS([sched_get_priority_max])
|
||||
AC_CHECK_FUNCS([select socket getpagesize memcpy])
|
||||
|
||||
AC_CHECK_FUNC(getopt_long,
|
||||
[AC_DEFINE(HAVE_GETOPT_LONG, 1, [long getopt support])],
|
||||
[ # FreeBSD and BSD/OS have a gnugetopt library for this:
|
||||
AC_CHECK_LIB([gnugetopt], [getopt_long],
|
||||
[AC_DEFINE(HAVE_GETOPT_LONG, 1,
|
||||
[long getopt support])
|
||||
LIBGETOPT_LIB="-lgnugetopt"])
|
||||
])
|
||||
|
||||
AC_CHECK_SIZEOF([int])
|
||||
AC_CHECK_SIZEOF([long int])
|
||||
AC_CHECK_SIZEOF([size_t])
|
||||
AC_CHECK_SIZEOF([float])
|
||||
|
||||
|
||||
PKG_CHECK_MODULES(LIBAVUTIL, [libavutil >= 49.7.0],have_avutil=true,have_avutil=false)
|
||||
|
||||
if test x$have_avutil = xtrue;
|
||||
then
|
||||
AC_DEFINE( BASE64_AVUTIL,1,[Use avutil base64])
|
||||
fi
|
||||
|
||||
AC_SUBST(LIBAVUTIL_CFLAGS)
|
||||
AC_SUBST(LIBAVUTIL_LIBS)
|
||||
|
||||
AC_SUBST(LIBGETOPT_LIB)
|
||||
|
||||
AC_TYPE_SIGNAL
|
||||
|
||||
AC_MSG_NOTICE([The host is $host $host_cpu $host_vendor $host_os .])
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl Test whether we're linux or not. If so, define HAVE_V4L and build the
|
||||
dnl video4linux/hardware dependent tools. Else, undefine HAVE_V4L
|
||||
have_v4l=false
|
||||
have_linux=false
|
||||
have_darwin=false
|
||||
case $host in
|
||||
*-*-linux*)
|
||||
AC_CHECK_HEADER(linux/version.h,
|
||||
[have_linux=true
|
||||
AC_DEFINE(HAVE_LINUX,,[Linux platform])
|
||||
],
|
||||
[AC_MSG_ERROR([version.h not found - please install the linux kernel headers])
|
||||
])
|
||||
LIBM_LIBS="-lm"
|
||||
;;
|
||||
*-apple-darwin*)
|
||||
AC_DEFINE(HAVE_DARWIN,1,[MAC OS X Darin])
|
||||
dnl OS-X/Darwin needs no-cpp-precomp
|
||||
CFLAGS="$CFLAGS -no-cpp-precomp"
|
||||
have_darwin=true
|
||||
LIBM_LIBS=""
|
||||
;;
|
||||
*)
|
||||
AC_MSG_WARN([Alien platform - Good Luck!])
|
||||
LIBM_LIBS=""
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
dnl ====== check for PKG_CONFIG_PATH
|
||||
if test x"$PKG_CONFIG_PATH" = x ; then
|
||||
AC_MSG_NOTICE([The PKG_CONFIG_PATH variable was not set])
|
||||
AC_MSG_NOTICE([You should set it to the directories that contain the .pc files])
|
||||
PKG_CONFIG_PATH=/usr/lib/pkgconfig
|
||||
fi
|
||||
|
||||
|
||||
AC_SUBST(LIBM_LIBS)
|
||||
|
||||
have_dl_dlopen=false
|
||||
AC_CHECK_LIB(dl,dlopen)
|
||||
if test "$ac_cv_lib_dl_dlopen" = "yes"; then
|
||||
AC_DEFINE(HAVE_DL_DLOPEN,,[Compile with dlopen support])
|
||||
have_dl_dlopen=true
|
||||
fi
|
||||
|
||||
|
||||
AC_MSG_CHECKING(whether to compile in debugging information)
|
||||
debugCFLAGS=""
|
||||
if test "x$enable_debug" = "xyes" ; then
|
||||
debugCFLAGS="-g"
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
AC_MSG_CHECKING(whether to compile in profiling information)
|
||||
if test "x$enable_profiling" = "xyes" ; then
|
||||
debugCFLAGS="$debugCFLAGS -fprofile-arcs -ftest-coverage"
|
||||
DEBUGLIBS="-lgcov"
|
||||
AC_SUBST(DEBUGLIBS)
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([Architecture])
|
||||
case $host_cpu in
|
||||
i[[3-7]]86)
|
||||
AC_DEFINE(HAVE_X86CPU,1, [Compiling for x86 architecture CPU])
|
||||
AC_DEFINE(ARCH_X86,1,[Compiling for x86 architecture])
|
||||
have_x86cpu=true
|
||||
|
||||
PROGRAM_NOPIC="-fno-PIC"
|
||||
|
||||
dnl If the host is pentium, align on double word boundary
|
||||
case $host_cpu in
|
||||
i686)
|
||||
CFLAGS="-ffast-math -O3 -ftree-vectorize"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
;;
|
||||
x86_64*|k8-*)
|
||||
AC_DEFINE(HAVE_X86_CPU,1, [Compiling for x86-64 architecture CPU])
|
||||
AC_DEFINE(ARCH_X86_64,1, [Compiling for x86-64 architecture CPU])
|
||||
have_x86cpu=true
|
||||
have_x86_64cpu=true
|
||||
CFLAGS="-m64 -fPIC -DPIC -ftree-vectorize -O3 -ffast-math"
|
||||
;;
|
||||
powerpc | powerpc64)
|
||||
AC_DEFINE(HAVE_PPCCPU,1, [Compiling for PowerPC CPU])
|
||||
AC_DEFINE(ARCH_PPC,1,[Compiling for PowerPC])
|
||||
have_ppccpu=true
|
||||
|
||||
case $host in
|
||||
*-apple-darwin*)
|
||||
PROGRAM_NOPIC="-mdynamic-no-pic" # dynamic-no-pic is an Apple gcc option
|
||||
|
||||
;;
|
||||
*)
|
||||
PROGRAM_NOPIC=""
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
mips | mipsel)
|
||||
AC_DEFINE(ARCH_MIPS,,[Compiling for MIPS CPU])
|
||||
AC_DEFINE(HAVE_MIPS,,[Compiling for MIPS CPU])
|
||||
have_mips=true
|
||||
AC_MSG_CHECKING([if we are compiling on playstation2 hardware])
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],
|
||||
[[#include <linux/ps2/dev.h>
|
||||
#include <linux/ps2/gs.h>
|
||||
]])],
|
||||
[have_ps2=true],
|
||||
[have_ps2=false])
|
||||
|
||||
if test x$have_ps2 = xtrue ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_PS2,1,[Compile for playstation2])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT([unknown])
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_SUBST(PROGRAM_NOPIC)
|
||||
|
||||
|
||||
|
||||
AC_MSG_RESULT($CFLAGS)
|
||||
|
||||
CFLAGS="$ARCHFLAGS $CFLAGS"
|
||||
CXXFLAGS="$ARCHFLAGS $CXXFLAGS"
|
||||
|
||||
|
||||
if test "x${GCC}" != "xyes" ; then
|
||||
enable_compile_warnings=no
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(what warning flags to pass to the C compiler)
|
||||
warnCFLAGS=
|
||||
warnCXXFLAGS=
|
||||
if test "x$enable_compile_warnings" != "xno" ; then
|
||||
if test "x$GCC" = "xyes" ; then
|
||||
case "$CFLAGS" in
|
||||
*-Wall*) ;;
|
||||
*) warnCFLAGS="-Wall -Wunused " ;;
|
||||
esac
|
||||
if test "x$enable_compile_warnings" = "xyes" ; then
|
||||
warnCFLAGS="$warnCFLAGS -Wmissing-prototypes -Wundef -Wshadow -Wbad-function-cast -Wconversion -Wpadded -Wunreachable-code -Wmissing-declarations -Wpointer-arith -Wcast-align -Wwrite-strings -Wcast-qual"
|
||||
warnCXXFLAGS="$warnCXXFLAGS -Wmissing-prototypes -Wpointer-arith -Wcast-align -Wwrite-strings -Wcast-qual"
|
||||
fi
|
||||
if test "x$enable_warnings_as_errors" = "xyes" ; then
|
||||
warnCFLAGS="$warnCFLAGS -Werror"
|
||||
warnCXXFLAGS="$warnCXXFLAGS -Werror"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$cflags_set" != "xyes" ; then
|
||||
if test "x$enable_debug" = "xyes" ; then
|
||||
CFLAGS="$debugCFLAGS $warnCFLAGS $CFLAGS"
|
||||
else
|
||||
CFLAGS="$CFLAGS $warnCFLAGS -DSILENT"
|
||||
fi
|
||||
CXXFLAGS="$CXXFLAGS $warnCXXFLAGS"
|
||||
cflags_set=yes
|
||||
fi
|
||||
|
||||
|
||||
if test x"$with_extra_cflags" != "x"; then
|
||||
CFLAGS="$CFLAGS $with_extra_cflags"
|
||||
CXXFLAGS="$CXXFLAGS $with_extra_cflags"
|
||||
fi
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
Makefile
|
||||
liblvdgmic/Makefile
|
||||
plugins/Makefile
|
||||
])
|
||||
AC_OUTPUT
|
||||
|
||||
AC_DEFINE(VERSION, ${VERSION})
|
||||
|
||||
AC_MSG_NOTICE([])
|
||||
AC_MSG_NOTICE([ Veejay GMIC filters ${VERSION} build configuration :])
|
||||
AC_MSG_NOTICE([])
|
||||
AC_MSG_NOTICE([ Compiler flags: $CFLAGS])
|
||||
AC_MSG_NOTICE([])
|
||||
AC_MSG_NOTICE([ Architecture: ${host_cpu} ])
|
||||
AC_MSG_NOTICE([])
|
||||
if test "$have_linux" = "true" ; then
|
||||
AC_MSG_NOTICE([ Platform: Linux])
|
||||
fi
|
||||
@@ -0,0 +1,6 @@
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
INCLUDES = $(CFLAGS)
|
||||
LIBLVDGMIC = liblvdgmic.la
|
||||
noinst_LTLIBRARIES = $(LIBLVDGMIC)
|
||||
|
||||
liblvdgmic_la_SOURCES = lvdgmic.cc lvdgmicglue.cc
|
||||
72
veejay-current/plugin-packs/lvdgmic/liblvdgmic/lvdgmic.cc
Normal file
72
veejay-current/plugin-packs/lvdgmic/liblvdgmic/lvdgmic.cc
Normal file
@@ -0,0 +1,72 @@
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <cmath>
|
||||
#include <gmic.h>
|
||||
#include "lvdgmic.hh"
|
||||
|
||||
lvdgmic::lvdgmic(int n)
|
||||
{
|
||||
images.assign(n);
|
||||
buf = (char*) malloc( sizeof(char) * LGDMIC_CMD_LEN );
|
||||
}
|
||||
|
||||
lvdgmic::~lvdgmic()
|
||||
{
|
||||
images.assign(0U);
|
||||
free(buf);
|
||||
}
|
||||
|
||||
static inline int get_n_planes(int fmt) {
|
||||
if(fmt < 516 )
|
||||
return 1;
|
||||
return 3; //FIXME
|
||||
}
|
||||
|
||||
void lvdgmic::push( int w, int h, int fmt, unsigned char **data, int n )
|
||||
{
|
||||
int n_planes = get_n_planes(fmt);
|
||||
gmic_image<float> &img = images._data[n];
|
||||
img.assign(w,h, 1, n_planes );
|
||||
|
||||
/* convert data in src to float */
|
||||
float *in = img._data;
|
||||
unsigned char *src = data[0];
|
||||
unsigned int len = images._data[n]._width * images._data[n]._height * images._data[n]._depth;
|
||||
unsigned int i,j;
|
||||
|
||||
for( j = 0; j < n_planes; j ++ ) {
|
||||
float *in = img._data + (j * len);
|
||||
unsigned char *src = data[j];
|
||||
for( i = 0; i < len; i ++ ) {
|
||||
in[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
format = fmt;
|
||||
}
|
||||
|
||||
void lvdgmic::gmic_command( char const *str )
|
||||
{
|
||||
try {
|
||||
gmic_instance.run( str, images, image_names );
|
||||
} catch(gmic_exception &e) {
|
||||
fprintf(stderr,"GMIC error: %s\n", e.what());
|
||||
}
|
||||
}
|
||||
|
||||
void lvdgmic::pull(int n, unsigned char **frame)
|
||||
{
|
||||
unsigned int i,j;
|
||||
unsigned int len = images._data[n]._width * images._data[n]._height * images._data[n]._depth;
|
||||
|
||||
int n_planes = get_n_planes(format);
|
||||
|
||||
for( j = 0; j < n_planes; j ++ ) {
|
||||
/* convert data from float to output */
|
||||
unsigned char *dst = frame[j];
|
||||
float *out = images._data[n]._data + (j * len);
|
||||
for( i = 0; i < len; i ++ ) {
|
||||
dst[i] = (unsigned char) out[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
22
veejay-current/plugin-packs/lvdgmic/liblvdgmic/lvdgmic.hh
Normal file
22
veejay-current/plugin-packs/lvdgmic/liblvdgmic/lvdgmic.hh
Normal file
@@ -0,0 +1,22 @@
|
||||
#define LGDMIC_CMD_LEN 1024
|
||||
|
||||
|
||||
class lvdgmic
|
||||
{
|
||||
private:
|
||||
gmic_list<float> images;
|
||||
gmic_list<char> image_names;
|
||||
gmic gmic_instance;
|
||||
int format;
|
||||
|
||||
public:
|
||||
lvdgmic( int n );
|
||||
~lvdgmic();
|
||||
|
||||
char *buf;
|
||||
|
||||
void push( int w, int h, int fmt, unsigned char **data, int n );
|
||||
void gmic_command( char const *str );
|
||||
void pull(int n, unsigned char **data);
|
||||
};
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <gmic.h>
|
||||
#include "lvdgmicglue.h"
|
||||
#include "lvdgmic.hh"
|
||||
|
||||
extern "C" {
|
||||
|
||||
Clvdgmic *lvdgmic_new(int n) {
|
||||
lvdgmic *l = new lvdgmic(n);
|
||||
return (Clvdgmic*)l;
|
||||
}
|
||||
|
||||
void lvdgmic_delete(Clvdgmic *ptr)
|
||||
{
|
||||
lvdgmic *l = (lvdgmic*) ptr;
|
||||
delete l;
|
||||
}
|
||||
|
||||
void lvdgmic_push(Clvdgmic *ptr, int w, int h, int fmt, uint8_t **data, int n )
|
||||
{
|
||||
lvdgmic *l = (lvdgmic*) ptr;
|
||||
l->push( w,h,fmt, data, n );
|
||||
}
|
||||
|
||||
void lvdgmic_pull(Clvdgmic *ptr, int n, uint8_t **data)
|
||||
{
|
||||
lvdgmic *l = (lvdgmic*)ptr;
|
||||
l->pull(n,data);
|
||||
}
|
||||
|
||||
void lvdgmic_gmic(Clvdgmic *ptr, const char *str)
|
||||
{
|
||||
lvdgmic *l = (lvdgmic*) ptr;
|
||||
#ifdef SILENT
|
||||
snprintf(l->buf,LGDMIC_CMD_LEN,"-verbose -1 %s", str );
|
||||
l->gmic_command( l->buf );
|
||||
#else
|
||||
l->gmic_command( str );
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
13
veejay-current/plugin-packs/lvdgmic/liblvdgmic/lvdgmicglue.h
Normal file
13
veejay-current/plugin-packs/lvdgmic/liblvdgmic/lvdgmicglue.h
Normal file
@@ -0,0 +1,13 @@
|
||||
typedef void Clvdgmic;
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
Clvdgmic *lvdgmic_new(int n);
|
||||
void lvdgmic_delete(Clvdgmic *ptr);
|
||||
void lvdgmic_push(Clvdgmic *ptr, int w,int h, int fmt, uint8_t **data, int n);
|
||||
void lvdgmic_pull(Clvdgmic *ptr, int n, uint8_t **data);
|
||||
void lvdgmic_gmic(Clvdgmic *ptr, const char *gmic_command);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
137
veejay-current/plugin-packs/lvdgmic/plugins/Makefile.am
Normal file
137
veejay-current/plugin-packs/lvdgmic/plugins/Makefile.am
Normal file
@@ -0,0 +1,137 @@
|
||||
lividoplugin_LTLIBRARIES = gmic_cartoon.la \
|
||||
gmic_cracks.la \
|
||||
gmic_bokeh.la \
|
||||
gmic_pencilbw.la \
|
||||
gmic_arrayfade.la \
|
||||
gmic_rodilius.la \
|
||||
gmic_water.la \
|
||||
gmic_wave.la \
|
||||
gmic_wind.la \
|
||||
gmic_lightpatch.la \
|
||||
gmic_noisehurl.la \
|
||||
gmic_crystal.la \
|
||||
gmic_lava.la \
|
||||
gmic_marble.la \
|
||||
gmic_shockwaves.la \
|
||||
gmic_spread.la \
|
||||
gmic_texturizepaper.la \
|
||||
gmic_vignette.la \
|
||||
gmic_abstraction.la \
|
||||
gmic_dices.la \
|
||||
gmic_whirl.la \
|
||||
gmic_posteredges.la \
|
||||
gmic_posterhope.la \
|
||||
gmic_kuwahara.la \
|
||||
gmic_pendrawing.la \
|
||||
gmic_oldscool8bits.la \
|
||||
gmic_sponge.la \
|
||||
gmic_tetris.la
|
||||
|
||||
gmic_cartoon_la_SOURCES = gmic_cartoon.c
|
||||
gmic_cartoon_la_LIBADD = -L$(top_builddir)/liblvdgmic -llvdgmic
|
||||
|
||||
gmic_cracks_la_SOURCES = gmic_cracks.c
|
||||
gmic_cracks_la_LIBADD = -L$(top_builddir)/liblvdgmic -llvdgmic
|
||||
|
||||
gmic_bokeh_la_SOURCES = gmic_bokeh.c
|
||||
gmic_bokeh_la_LIBADD = -L$(top_builddir)/liblvdgmic -llvdgmic
|
||||
|
||||
gmic_pencilbw_la_SOURCES = gmic_pencilbw.c
|
||||
gmic_pencilbw_la_LIBADD = -L$(top_builddir)/liblvdgmic -llvdgmic
|
||||
|
||||
gmic_arrayfade_la_SOURCES = gmic_arrayfade.c
|
||||
gmic_arrayfade_la_LIBADD = -L$(top_builddir)/liblvdgmic -llvdgmic
|
||||
|
||||
gmic_rodilius_la_SOURCES = gmic_rodilius.c
|
||||
gmic_rodilius_la_LIBADD = -L$(top_builddir)/liblvdgmic -llvdgmic
|
||||
|
||||
gmic_water_la_SOURCES = gmic_water.c
|
||||
gmic_water_la_LIBADD = -L$(top_builddir)/liblvdgmic -llvdgmic
|
||||
|
||||
gmic_wave_la_SOURCES = gmic_wave.c
|
||||
gmic_wave_la_LIBADD = -L$(top_builddir)/liblvdgmic -llvdgmic
|
||||
|
||||
gmic_wind_la_SOURCES = gmic_wind.c
|
||||
gmic_wind_la_LIBADD = -L$(top_builddir)/liblvdgmic -llvdgmic
|
||||
|
||||
gmic_lightpatch_la_SOURCES = gmic_lightpatch.c
|
||||
gmic_lightpatch_la_LIBADD = -L$(top_builddir)/liblvdgmic -llvdgmic
|
||||
|
||||
gmic_noisehurl_la_SOURCES = gmic_noisehurl.c
|
||||
gmic_noisehurl_la_LIBADD = -L$(top_builddir)/liblvdgmic -llvdgmic
|
||||
|
||||
gmic_crystal_la_SOURCES = gmic_crystal.c
|
||||
gmic_crystal_la_LIBADD = -L$(top_builddir)/liblvdgmic -llvdgmic
|
||||
|
||||
gmic_lava_la_SOURCES = gmic_lava.c
|
||||
gmic_lava_la_LIBADD = -L$(top_builddir)/liblvdgmic -llvdgmic
|
||||
|
||||
gmic_marble_la_SOURCES = gmic_marble.c
|
||||
gmic_marble_la_LIBADD = -L$(top_builddir)/liblvdgmic -llvdgmic
|
||||
|
||||
gmic_shockwaves_la_SOURCES = gmic_shockwaves.c
|
||||
gmic_shockwaves_la_LIBADD = -L$(top_builddir)/liblvdgmic -llvdgmic
|
||||
|
||||
gmic_spread_la_SOURCES = gmic_spread.c
|
||||
gmic_spread_la_LIBADD = -L$(top_builddir)/liblvdgmic -llvdgmic
|
||||
|
||||
gmic_texturizepaper_la_SOURCES = gmic_texturizepaper.c
|
||||
gmic_texturizepaper_la_LIBADD = -L$(top_builddir)/liblvdgmic -llvdgmic
|
||||
|
||||
gmic_vignette_la_SOURCES = gmic_vignette.c
|
||||
gmic_vignette_la_LIBADD = -L$(top_builddir)/liblvdgmic -llvdgmic
|
||||
|
||||
gmic_abstraction_la_SOURCES = gmic_abstraction.c
|
||||
gmic_abstraction_la_LIBADD = -L$(top_builddir)/liblvdgmic -llvdgmic
|
||||
|
||||
gmic_dices_la_SOURCES = gmic_dices.c
|
||||
gmic_dices_la_LIBADD = -L$(top_builddir)/liblvdgmic -llvdgmic
|
||||
|
||||
gmic_whirl_la_SOURCES = gmic_whirl.c
|
||||
gmic_whirl_la_LIBADD = -L$(top_builddir)/liblvdgmic -llvdgmic
|
||||
|
||||
gmic_posteredges_la_SOURCES = gmic_posteredges.c
|
||||
gmic_posteredges_la_LIBADD = -L$(top_builddir)/liblvdgmic -llvdgmic
|
||||
|
||||
gmic_posterhope_la_SOURCES = gmic_posterhope.c
|
||||
gmic_posterhope_la_LIBADD = -L$(top_builddir)/liblvdgmic -llvdgmic
|
||||
|
||||
gmic_kuwahara_la_SOURCES = gmic_kuwahara.c
|
||||
gmic_kuwahara_la_LIBADD = -L$(top_builddir)/liblvdgmic -llvdgmic
|
||||
|
||||
gmic_pendrawing_la_SOURCES = gmic_pendrawing.c
|
||||
gmic_pendrawing_la_LIBADD = -L$(top_builddir)/liblvdgmic -llvdgmic
|
||||
|
||||
gmic_oldscool8bits_la_SOURCES = gmic_oldscool8bits.c
|
||||
gmic_oldscool8bits_la_LIBADD = -L$(top_builddir)/liblvdgmic -llvdgmic
|
||||
|
||||
gmic_sponge_la_SOURCES = gmic_sponge.c
|
||||
gmic_sponge_la_LIBADD = -L$(top_builddir)/liblvdgmic -llvdgmic
|
||||
|
||||
gmic_tetris_la_SOURCES = gmic_tetris.c
|
||||
gmic_tetris_la_LIBADD = -L$(top_builddir)/liblvdgmic -llvdgmic
|
||||
|
||||
|
||||
INCLUDES=$(FFMPEG_CFLAGS) -I$(top_srcdir)/liblvdgmic
|
||||
AM_CFLAGS=-I@top_srcdir@/include $(OPTCFLAGS) -DSILENT
|
||||
AM_LDFLAGS=-module -avoid-version -lm -export-dynamic -lgmic -lstdc++ -DDYNAMIC -rdynamic
|
||||
AM_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
lividoplugindir = @libdir@/livido-plugins
|
||||
liblvdgmicdir= @libdir@/livido-plugins
|
||||
|
||||
install-lividopluginLTLIBRARIES:$(lividoplugin_LTLIBRARIES)
|
||||
mkdir -p $(DESTDIR)/$(lividoplugindir)
|
||||
list='$(lividoplugin_LTLIBRARIES)'; \
|
||||
for file in $$list; do \
|
||||
sofile=`basename $$file .la`.so; \
|
||||
$(INSTALL_PROGRAM) .libs/$$sofile $(DESTDIR)/$(lividoplugindir);\
|
||||
done
|
||||
|
||||
uninstall-lividopluginLTLIBRARIES:
|
||||
list='$(lividoplugin_LTLIBRARIES)'; \
|
||||
for file in $$list; do \
|
||||
sofile=`basename $$file .la`.so; \
|
||||
rm -f $(DESTDIR)/$(lividoplugindir)/$$sofile; \
|
||||
done
|
||||
|
||||
167
veejay-current/plugin-packs/lvdgmic/plugins/gmic_abstraction.c
Normal file
167
veejay-current/plugin-packs/lvdgmic/plugins/gmic_abstraction.c
Normal file
@@ -0,0 +1,167 @@
|
||||
/*
|
||||
* LIBVJE - veejay fx library
|
||||
*
|
||||
* Copyright(C)2015 Niels Elburg <nwelburg@gmail.com>
|
||||
* See COPYING for software license and distribution details
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef IS_LIVIDO_PLUGIN
|
||||
#define IS_LIVIDO_PLUGIN
|
||||
#endif
|
||||
|
||||
#include "livido.h"
|
||||
LIVIDO_PLUGIN
|
||||
#include "utils.h"
|
||||
#include "livido-utils.c"
|
||||
#include "lvd_common.h"
|
||||
#include "lvdgmicglue.h"
|
||||
|
||||
livido_init_f init_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = lvdgmic_new(1);
|
||||
|
||||
livido_property_set( my_instance, "PLUGIN_private",
|
||||
LIVIDO_ATOM_TYPE_VOIDPTR,1,&gmic );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_deinit_f deinit_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
lvdgmic_delete(gmic);
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_process_f process_instance( livido_port_t *my_instance, double timecode )
|
||||
{
|
||||
uint8_t *A[4] = {NULL,NULL,NULL,NULL};
|
||||
uint8_t *O[4]= {NULL,NULL,NULL,NULL};
|
||||
char cmd[256];
|
||||
int palette;
|
||||
int w;
|
||||
int h;
|
||||
|
||||
int error = lvd_extract_channel_values( my_instance, "out_channels", 0, &w,&h, O,&palette );
|
||||
if( error != LIVIDO_NO_ERROR )
|
||||
return LIVIDO_ERROR_HARDWARE;
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
|
||||
lvd_extract_channel_values( my_instance, "in_channels" , 0, &w, &h, A, &palette );
|
||||
|
||||
int smoothness = lvd_extract_param_index( my_instance,"in_parameters", 0 );
|
||||
int levels = lvd_extract_param_index( my_instance,"in_parameters", 1 );
|
||||
int contrast = lvd_extract_param_index(my_instance, "in_parameters",2);
|
||||
|
||||
snprintf(cmd,sizeof(cmd),"-gimp_color_abstraction %d,%d,%f",smoothness,levels,(float)contrast/100.0f );
|
||||
|
||||
lvdgmic_push( gmic, w, h, 0, A, 0);
|
||||
|
||||
lvdgmic_gmic( gmic, cmd );
|
||||
|
||||
lvdgmic_pull( gmic, 0, O );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
livido_port_t *livido_setup(livido_setup_t list[], int version)
|
||||
|
||||
{
|
||||
LIVIDO_IMPORT(list);
|
||||
|
||||
livido_port_t *port = NULL;
|
||||
livido_port_t *in_params[3];
|
||||
livido_port_t *in_chans[3];
|
||||
livido_port_t *out_chans[1];
|
||||
livido_port_t *info = NULL;
|
||||
livido_port_t *filter = NULL;
|
||||
|
||||
//@ setup root node, plugin info
|
||||
info = livido_port_new( LIVIDO_PORT_TYPE_PLUGIN_INFO );
|
||||
port = info;
|
||||
|
||||
livido_set_string_value( port, "maintainer", "Niels");
|
||||
livido_set_string_value( port, "version","1");
|
||||
|
||||
filter = livido_port_new( LIVIDO_PORT_TYPE_FILTER_CLASS );
|
||||
livido_set_int_value( filter, "api_version", LIVIDO_API_VERSION );
|
||||
|
||||
//@ setup function pointers
|
||||
livido_set_voidptr_value( filter, "deinit_func", &deinit_instance );
|
||||
livido_set_voidptr_value( filter, "init_func", &init_instance );
|
||||
livido_set_voidptr_value( filter, "process_func", &process_instance );
|
||||
port = filter;
|
||||
|
||||
//@ meta information
|
||||
livido_set_string_value( port, "name", "G'MIC/GREYs Abstraction");
|
||||
livido_set_string_value( port, "description", "Apply Abstract painting effect on image");
|
||||
livido_set_string_value( port, "author", "GREYC's Magic for Image Computing");
|
||||
|
||||
livido_set_int_value( port, "flags", LIVIDO_FILTER_NON_REALTIME);
|
||||
livido_set_string_value( port, "license", "GPL2");
|
||||
livido_set_int_value( port, "version", 1);
|
||||
|
||||
//@ some palettes veejay-classic uses
|
||||
int palettes0[] = {
|
||||
LIVIDO_PALETTE_YUV422P,
|
||||
0,
|
||||
};
|
||||
|
||||
//@ setup output channel
|
||||
out_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = out_chans[0];
|
||||
|
||||
livido_set_string_value( port, "name", "Output Channel");
|
||||
livido_set_int_array( port, "palette_list", 3, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = in_chans[0];
|
||||
livido_set_string_value( port, "name", "Input Channel");
|
||||
livido_set_int_array( port, "palette_list", 4, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_params[0] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[0];
|
||||
|
||||
livido_set_string_value(port, "name", "Smoothness" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 10 );
|
||||
livido_set_int_value( port, "default", 1 );
|
||||
livido_set_string_value( port, "description" ,"Smoothness");
|
||||
|
||||
|
||||
in_params[1] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[1];
|
||||
|
||||
livido_set_string_value(port, "name", "Levels" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 2 );
|
||||
livido_set_int_value( port, "max", 255 );
|
||||
livido_set_int_value( port, "default", 10 );
|
||||
livido_set_string_value( port, "description" ,"Levels");
|
||||
|
||||
in_params[2] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[2];
|
||||
|
||||
livido_set_string_value(port, "name", "Contrast" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 100 );
|
||||
livido_set_int_value( port, "default", 20 );
|
||||
livido_set_string_value( port, "description" ,"Contrast");
|
||||
|
||||
livido_set_portptr_array( filter, "in_parameter_templates",3, in_params );
|
||||
livido_set_portptr_array( filter, "out_channel_templates", 1, out_chans );
|
||||
livido_set_portptr_array( filter, "in_channel_templates",1, in_chans );
|
||||
|
||||
livido_set_portptr_value(info, "filters", filter);
|
||||
return info;
|
||||
}
|
||||
235
veejay-current/plugin-packs/lvdgmic/plugins/gmic_arrayfade.c
Normal file
235
veejay-current/plugin-packs/lvdgmic/plugins/gmic_arrayfade.c
Normal file
@@ -0,0 +1,235 @@
|
||||
/*
|
||||
* LIBVJE - veejay fx library
|
||||
*
|
||||
* Copyright(C)2015 Niels Elburg <nwelburg@gmail.com>
|
||||
* See COPYING for software license and distribution details
|
||||
*/
|
||||
|
||||
#ifndef IS_LIVIDO_PLUGIN
|
||||
#define IS_LIVIDO_PLUGIN
|
||||
#endif
|
||||
|
||||
#include "livido.h"
|
||||
LIVIDO_PLUGIN
|
||||
#include "utils.h"
|
||||
#include "livido-utils.c"
|
||||
#include "lvd_common.h"
|
||||
#include "lvdgmicglue.h"
|
||||
|
||||
livido_init_f init_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = lvdgmic_new(1);
|
||||
|
||||
livido_property_set( my_instance, "PLUGIN_private",
|
||||
LIVIDO_ATOM_TYPE_VOIDPTR,1,&gmic );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_deinit_f deinit_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
lvdgmic_delete(gmic);
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_process_f process_instance( livido_port_t *my_instance, double timecode )
|
||||
{
|
||||
uint8_t *A[4] = {NULL,NULL,NULL,NULL};
|
||||
uint8_t *O[4]= {NULL,NULL,NULL,NULL};
|
||||
char cmd[256];
|
||||
int palette;
|
||||
int w;
|
||||
int h;
|
||||
|
||||
int error = lvd_extract_channel_values( my_instance, "out_channels", 0, &w,&h, O,&palette );
|
||||
if( error != LIVIDO_NO_ERROR )
|
||||
return LIVIDO_ERROR_HARDWARE;
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
|
||||
lvd_extract_channel_values( my_instance, "in_channels" , 0, &w, &h, A, &palette );
|
||||
|
||||
int x_tiles = lvd_extract_param_index( my_instance,"in_parameters", 0 );
|
||||
int y_tiles = lvd_extract_param_index( my_instance,"in_parameters", 1 );
|
||||
int x_offset = lvd_extract_param_index( my_instance,"in_parameters", 2 );
|
||||
int y_offset = lvd_extract_param_index( my_instance,"in_parameters", 3 );
|
||||
int fade_start = lvd_extract_param_index( my_instance,"in_parameters", 4 );
|
||||
int fade_end = lvd_extract_param_index( my_instance,"in_parameters", 5 );
|
||||
int mirror = lvd_extract_param_index( my_instance,"in_parameters", 6 );
|
||||
int size = lvd_extract_param_index( my_instance,"in_parameters", 7 );
|
||||
|
||||
snprintf(cmd,sizeof(cmd),"-array_fade %d,%d,%d,%d,%d,%d,%d,%d",
|
||||
x_tiles,y_tiles,x_offset,y_offset,fade_start,fade_end,mirror,size);
|
||||
|
||||
lvdgmic_push( gmic, w, h, palette, A, 0);
|
||||
|
||||
lvdgmic_gmic( gmic, cmd );
|
||||
|
||||
lvdgmic_pull( gmic, 0, O );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
livido_port_t *livido_setup(livido_setup_t list[], int version)
|
||||
|
||||
{
|
||||
LIVIDO_IMPORT(list);
|
||||
|
||||
livido_port_t *port = NULL;
|
||||
livido_port_t *in_params[8];
|
||||
livido_port_t *in_chans[3];
|
||||
livido_port_t *out_chans[1];
|
||||
livido_port_t *info = NULL;
|
||||
livido_port_t *filter = NULL;
|
||||
|
||||
//@ setup root node, plugin info
|
||||
info = livido_port_new( LIVIDO_PORT_TYPE_PLUGIN_INFO );
|
||||
port = info;
|
||||
|
||||
livido_set_string_value( port, "maintainer", "Niels");
|
||||
livido_set_string_value( port, "version","1");
|
||||
|
||||
filter = livido_port_new( LIVIDO_PORT_TYPE_FILTER_CLASS );
|
||||
livido_set_int_value( filter, "api_version", LIVIDO_API_VERSION );
|
||||
|
||||
//@ setup function pointers
|
||||
livido_set_voidptr_value( filter, "deinit_func", &deinit_instance );
|
||||
livido_set_voidptr_value( filter, "init_func", &init_instance );
|
||||
livido_set_voidptr_value( filter, "process_func", &process_instance );
|
||||
port = filter;
|
||||
|
||||
//@ meta information
|
||||
livido_set_string_value( port, "name", "G'MIC/GREYs Array fade");
|
||||
livido_set_string_value( port, "description", "Create MxN array from selected images");
|
||||
livido_set_string_value( port, "author", "GREYC's Magic for Image Computing");
|
||||
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
livido_set_string_value( port, "license", "GPL2");
|
||||
livido_set_int_value( port, "version", 1);
|
||||
|
||||
//@ some palettes veejay-classic uses
|
||||
int palettes0[] = {
|
||||
LIVIDO_PALETTE_YUV422P,
|
||||
LIVIDO_PALETTE_YUV444P,
|
||||
LIVIDO_PALETTE_RGBFLOAT,
|
||||
LIVIDO_PALETTE_A8,
|
||||
0,
|
||||
};
|
||||
|
||||
//@ setup output channel
|
||||
out_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = out_chans[0];
|
||||
|
||||
livido_set_string_value( port, "name", "Output Channel");
|
||||
livido_set_int_array( port, "palette_list", 3, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = in_chans[0];
|
||||
livido_set_string_value( port, "name", "Input Channel");
|
||||
livido_set_int_array( port, "palette_list", 4, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
//@ setup parameters (INDEX type, 0-255)
|
||||
in_params[0] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[0];
|
||||
|
||||
livido_set_string_value(port, "name", "X-tiles" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 1 );
|
||||
livido_set_int_value( port, "max", 10 );
|
||||
livido_set_int_value( port, "default", 2 );
|
||||
livido_set_string_value( port, "description" ,"X-tiles");
|
||||
|
||||
|
||||
in_params[1] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[1];
|
||||
|
||||
livido_set_string_value(port, "name", "Y-tiles" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 1 );
|
||||
livido_set_int_value( port, "max", 10 );
|
||||
livido_set_int_value( port, "default", 2 );
|
||||
livido_set_string_value( port, "description" ,"Y-tiles");
|
||||
|
||||
|
||||
|
||||
in_params[2] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[2];
|
||||
|
||||
livido_set_string_value(port, "name", "X-offset" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0);
|
||||
livido_set_int_value( port, "max", 100 );
|
||||
livido_set_int_value( port, "default", 0 );
|
||||
livido_set_string_value( port, "description" ,"X-offset");
|
||||
|
||||
|
||||
in_params[3] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[3];
|
||||
|
||||
livido_set_string_value(port, "name", "Y-offset" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0);
|
||||
livido_set_int_value( port, "max", 100 );
|
||||
livido_set_int_value( port, "default", 0);
|
||||
livido_set_string_value( port, "description" ,"Y-offset");
|
||||
|
||||
|
||||
in_params[4] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[4];
|
||||
|
||||
livido_set_string_value(port, "name", "Fade start" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 1);
|
||||
livido_set_int_value( port, "max", 100 );
|
||||
livido_set_int_value( port, "default", 80 );
|
||||
livido_set_string_value( port, "description" ,"Fade start");
|
||||
|
||||
|
||||
|
||||
in_params[5] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[5];
|
||||
|
||||
livido_set_string_value(port, "name", "Fade end" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 1);
|
||||
livido_set_int_value( port, "max", 100 );
|
||||
livido_set_int_value( port, "default", 90 );
|
||||
livido_set_string_value( port, "description" ,"Fade end");
|
||||
|
||||
in_params[6] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[6];
|
||||
|
||||
livido_set_string_value(port, "name", "Mirror" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 1);
|
||||
livido_set_int_value( port, "max",3 );
|
||||
livido_set_int_value( port, "default", 1 );
|
||||
livido_set_string_value( port, "description" ,"Mirror");
|
||||
|
||||
in_params[7] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[7];
|
||||
|
||||
livido_set_string_value(port, "name", "Size" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 1);
|
||||
livido_set_int_value( port, "max",3 );
|
||||
livido_set_int_value( port, "default", 1 );
|
||||
livido_set_string_value( port, "description" ,"Size");
|
||||
|
||||
|
||||
|
||||
//@ setup the nodes
|
||||
livido_set_portptr_array( filter, "in_parameter_templates",8, in_params );
|
||||
livido_set_portptr_array( filter, "out_channel_templates", 1, out_chans );
|
||||
livido_set_portptr_array( filter, "in_channel_templates",1, in_chans );
|
||||
|
||||
livido_set_portptr_value(info, "filters", filter);
|
||||
return info;
|
||||
}
|
||||
222
veejay-current/plugin-packs/lvdgmic/plugins/gmic_bokeh.c
Normal file
222
veejay-current/plugin-packs/lvdgmic/plugins/gmic_bokeh.c
Normal file
@@ -0,0 +1,222 @@
|
||||
/*
|
||||
* LIBVJE - veejay fx library
|
||||
*
|
||||
* Copyright(C)2015 Niels Elburg <nwelburg@gmail.com>
|
||||
* See COPYING for software license and distribution details
|
||||
*/
|
||||
|
||||
#ifndef IS_LIVIDO_PLUGIN
|
||||
#define IS_LIVIDO_PLUGIN
|
||||
#endif
|
||||
|
||||
#include "livido.h"
|
||||
LIVIDO_PLUGIN
|
||||
#include "utils.h"
|
||||
#include "livido-utils.c"
|
||||
#include "lvd_common.h"
|
||||
#include "lvdgmicglue.h"
|
||||
|
||||
livido_init_f init_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = lvdgmic_new(1);
|
||||
|
||||
livido_property_set( my_instance, "PLUGIN_private",
|
||||
LIVIDO_ATOM_TYPE_VOIDPTR,1,&gmic );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_deinit_f deinit_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
lvdgmic_delete(gmic);
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_process_f process_instance( livido_port_t *my_instance, double timecode )
|
||||
{
|
||||
uint8_t *A[4] = {NULL,NULL,NULL,NULL};
|
||||
uint8_t *O[4]= {NULL,NULL,NULL,NULL};
|
||||
char cmd[256];
|
||||
int palette;
|
||||
int w;
|
||||
int h;
|
||||
|
||||
int error = lvd_extract_channel_values( my_instance, "out_channels", 0, &w,&h, O,&palette );
|
||||
if( error != LIVIDO_NO_ERROR )
|
||||
return LIVIDO_ERROR_HARDWARE;
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
|
||||
lvd_extract_channel_values( my_instance, "in_channels" , 0, &w, &h, A, &palette );
|
||||
|
||||
int amplitude = lvd_extract_param_index( my_instance,"in_parameters", 0 );
|
||||
int smoothness = lvd_extract_param_index( my_instance,"in_parameters", 1 );
|
||||
int density = lvd_extract_param_index( my_instance,"in_parameters", 2 );
|
||||
int bsize = lvd_extract_param_index( my_instance,"in_parameters", 3 );
|
||||
int bosize = lvd_extract_param_index( my_instance,"in_parameters", 4 );
|
||||
int boa = lvd_extract_param_index( my_instance,"in_parameters", 5 );
|
||||
int bos = lvd_extract_param_index( my_instance,"in_parameters", 6 );
|
||||
|
||||
snprintf(cmd,sizeof(cmd),"-bokeh %d,%d,%f,%d,%d,%d,%f",
|
||||
amplitude,smoothness,(float)density/100.0f,bsize,bosize,boa,bos/100.0f);
|
||||
|
||||
lvdgmic_push( gmic, w, h, 0, A, 0);
|
||||
|
||||
lvdgmic_gmic( gmic, cmd );
|
||||
|
||||
lvdgmic_pull( gmic, 0, O );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
livido_port_t *livido_setup(livido_setup_t list[], int version)
|
||||
|
||||
{
|
||||
LIVIDO_IMPORT(list);
|
||||
|
||||
livido_port_t *port = NULL;
|
||||
livido_port_t *in_params[7];
|
||||
livido_port_t *in_chans[3];
|
||||
livido_port_t *out_chans[1];
|
||||
livido_port_t *info = NULL;
|
||||
livido_port_t *filter = NULL;
|
||||
|
||||
//@ setup root node, plugin info
|
||||
info = livido_port_new( LIVIDO_PORT_TYPE_PLUGIN_INFO );
|
||||
port = info;
|
||||
|
||||
livido_set_string_value( port, "maintainer", "Niels");
|
||||
livido_set_string_value( port, "version","1");
|
||||
|
||||
filter = livido_port_new( LIVIDO_PORT_TYPE_FILTER_CLASS );
|
||||
livido_set_int_value( filter, "api_version", LIVIDO_API_VERSION );
|
||||
|
||||
//@ setup function pointers
|
||||
livido_set_voidptr_value( filter, "deinit_func", &deinit_instance );
|
||||
livido_set_voidptr_value( filter, "init_func", &init_instance );
|
||||
livido_set_voidptr_value( filter, "process_func", &process_instance );
|
||||
port = filter;
|
||||
|
||||
//@ meta information
|
||||
livido_set_string_value( port, "name", "G'MIC/GREYs Bokeh");
|
||||
livido_set_string_value( port, "description", "Create a Bokey effect from the image");
|
||||
livido_set_string_value( port, "author", "GREYC's Magic for Image Computing");
|
||||
|
||||
livido_set_int_value( port, "flags", LIVIDO_FILTER_NON_REALTIME);
|
||||
livido_set_string_value( port, "license", "GPL2");
|
||||
livido_set_int_value( port, "version", 1);
|
||||
|
||||
//@ some palettes veejay-classic uses
|
||||
int palettes0[] = {
|
||||
LIVIDO_PALETTE_YUV422P,
|
||||
0,
|
||||
};
|
||||
|
||||
//@ setup output channel
|
||||
out_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = out_chans[0];
|
||||
|
||||
livido_set_string_value( port, "name", "Output Channel");
|
||||
livido_set_int_array( port, "palette_list", 3, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = in_chans[0];
|
||||
livido_set_string_value( port, "name", "Input Channel");
|
||||
livido_set_int_array( port, "palette_list", 4, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
//@ setup parameters (INDEX type, 0-255)
|
||||
in_params[0] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[0];
|
||||
|
||||
livido_set_string_value(port, "name", "Amplitude" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 600 );
|
||||
livido_set_int_value( port, "default", 250 );
|
||||
livido_set_string_value( port, "description" ,"Amplitude");
|
||||
|
||||
|
||||
in_params[1] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[1];
|
||||
|
||||
livido_set_string_value(port, "name", "Smoothness" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 20 );
|
||||
livido_set_int_value( port, "default", 2 );
|
||||
livido_set_string_value( port, "description" ,"Smoothness");
|
||||
|
||||
|
||||
|
||||
in_params[2] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[2];
|
||||
|
||||
livido_set_string_value(port, "name", "Density" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0);
|
||||
livido_set_int_value( port, "max", 500 );
|
||||
livido_set_int_value( port, "default", 50 );
|
||||
livido_set_string_value( port, "description" ,"Density");
|
||||
|
||||
|
||||
in_params[3] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[3];
|
||||
|
||||
livido_set_string_value(port, "name", "Bokeh-size" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0);
|
||||
livido_set_int_value( port, "max", 64 );
|
||||
livido_set_int_value( port, "default", 24);
|
||||
livido_set_string_value( port, "description" ,"Bokeh-size");
|
||||
|
||||
|
||||
in_params[4] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[4];
|
||||
|
||||
livido_set_string_value(port, "name", "Bokeh-outline-size" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0);
|
||||
livido_set_int_value( port, "max", 100 );
|
||||
livido_set_int_value( port, "default", 10 );
|
||||
livido_set_string_value( port, "description" ,"Bokeh-outline-size");
|
||||
|
||||
|
||||
|
||||
in_params[5] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[5];
|
||||
|
||||
livido_set_string_value(port, "name", "Bokeh-outline-amplitude" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0);
|
||||
livido_set_int_value( port, "max", 10 );
|
||||
livido_set_int_value( port, "default", 2 );
|
||||
livido_set_string_value( port, "description" ,"Bokeh-outline-amplitude");
|
||||
|
||||
in_params[6] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[6];
|
||||
|
||||
livido_set_string_value(port, "name", "Bokeh-smoothness" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0);
|
||||
livido_set_int_value( port, "max", 500 );
|
||||
livido_set_int_value( port, "default", 70 );
|
||||
livido_set_string_value( port, "description" ,"Bokeh-smoothness");
|
||||
|
||||
|
||||
|
||||
|
||||
//@ setup the nodes
|
||||
livido_set_portptr_array( filter, "in_parameter_templates",7, in_params );
|
||||
livido_set_portptr_array( filter, "out_channel_templates", 1, out_chans );
|
||||
livido_set_portptr_array( filter, "in_channel_templates",1, in_chans );
|
||||
|
||||
livido_set_portptr_value(info, "filters", filter);
|
||||
return info;
|
||||
}
|
||||
209
veejay-current/plugin-packs/lvdgmic/plugins/gmic_cartoon.c
Normal file
209
veejay-current/plugin-packs/lvdgmic/plugins/gmic_cartoon.c
Normal file
@@ -0,0 +1,209 @@
|
||||
/*
|
||||
* LIBVJE - veejay fx library
|
||||
*
|
||||
* Copyright(C)2015 Niels Elburg <nwelburg@gmail.com>
|
||||
* See COPYING for software license and distribution details
|
||||
*/
|
||||
|
||||
#ifndef IS_LIVIDO_PLUGIN
|
||||
#define IS_LIVIDO_PLUGIN
|
||||
#endif
|
||||
|
||||
#include "livido.h"
|
||||
LIVIDO_PLUGIN
|
||||
#include "utils.h"
|
||||
#include "livido-utils.c"
|
||||
#include "lvd_common.h"
|
||||
#include "lvdgmicglue.h"
|
||||
|
||||
livido_init_f init_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = lvdgmic_new(1);
|
||||
|
||||
livido_property_set( my_instance, "PLUGIN_private",
|
||||
LIVIDO_ATOM_TYPE_VOIDPTR,1,&gmic );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_deinit_f deinit_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
lvdgmic_delete(gmic);
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_process_f process_instance( livido_port_t *my_instance, double timecode )
|
||||
{
|
||||
uint8_t *A[4] = {NULL,NULL,NULL,NULL};
|
||||
uint8_t *O[4]= {NULL,NULL,NULL,NULL};
|
||||
char cmd[256];
|
||||
int palette;
|
||||
int w;
|
||||
int h;
|
||||
|
||||
int error = lvd_extract_channel_values( my_instance, "out_channels", 0, &w,&h, O,&palette );
|
||||
if( error != LIVIDO_NO_ERROR )
|
||||
return LIVIDO_ERROR_HARDWARE;
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
|
||||
lvd_extract_channel_values( my_instance, "in_channels" , 0, &w, &h, A, &palette );
|
||||
|
||||
int smoothness = lvd_extract_param_index( my_instance,"in_parameters", 0 );
|
||||
int sharpening = lvd_extract_param_index( my_instance,"in_parameters", 1 );
|
||||
int threshold = lvd_extract_param_index( my_instance,"in_parameters", 2 );
|
||||
int thickness = lvd_extract_param_index( my_instance,"in_parameters", 3 );
|
||||
int color = lvd_extract_param_index( my_instance,"in_parameters", 4 );
|
||||
int quant = lvd_extract_param_index( my_instance,"in_parameters", 5 );
|
||||
|
||||
snprintf(cmd,sizeof(cmd),"-cartoon %d,%d,%d,%f,%f,%d",
|
||||
smoothness,sharpening,threshold,(float)thickness/100.0f, (float)color/100.0f,quant);
|
||||
|
||||
lvdgmic_push( gmic, w, h, 0, A, 0);
|
||||
|
||||
lvdgmic_gmic( gmic, cmd );
|
||||
|
||||
lvdgmic_pull( gmic, 0, O );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
livido_port_t *livido_setup(livido_setup_t list[], int version)
|
||||
|
||||
{
|
||||
LIVIDO_IMPORT(list);
|
||||
|
||||
livido_port_t *port = NULL;
|
||||
livido_port_t *in_params[6];
|
||||
livido_port_t *in_chans[3];
|
||||
livido_port_t *out_chans[1];
|
||||
livido_port_t *info = NULL;
|
||||
livido_port_t *filter = NULL;
|
||||
|
||||
//@ setup root node, plugin info
|
||||
info = livido_port_new( LIVIDO_PORT_TYPE_PLUGIN_INFO );
|
||||
port = info;
|
||||
|
||||
livido_set_string_value( port, "maintainer", "Niels");
|
||||
livido_set_string_value( port, "version","1");
|
||||
|
||||
filter = livido_port_new( LIVIDO_PORT_TYPE_FILTER_CLASS );
|
||||
livido_set_int_value( filter, "api_version", LIVIDO_API_VERSION );
|
||||
|
||||
//@ setup function pointers
|
||||
livido_set_voidptr_value( filter, "deinit_func", &deinit_instance );
|
||||
livido_set_voidptr_value( filter, "init_func", &init_instance );
|
||||
livido_set_voidptr_value( filter, "process_func", &process_instance );
|
||||
port = filter;
|
||||
|
||||
//@ meta information
|
||||
livido_set_string_value( port, "name", "G'MIC/GREYs Cartoon");
|
||||
livido_set_string_value( port, "description", "Apply cartoon effect on image");
|
||||
livido_set_string_value( port, "author", "GREYC's Magic for Image Computing");
|
||||
|
||||
livido_set_int_value( port, "flags", LIVIDO_FILTER_NON_REALTIME);
|
||||
livido_set_string_value( port, "license", "GPL2");
|
||||
livido_set_int_value( port, "version", 1);
|
||||
|
||||
//@ some palettes veejay-classic uses
|
||||
int palettes0[] = {
|
||||
LIVIDO_PALETTE_YUV422P,
|
||||
0,
|
||||
};
|
||||
|
||||
//@ setup output channel
|
||||
out_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = out_chans[0];
|
||||
|
||||
livido_set_string_value( port, "name", "Output Channel");
|
||||
livido_set_int_array( port, "palette_list", 3, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = in_chans[0];
|
||||
livido_set_string_value( port, "name", "Input Channel");
|
||||
livido_set_int_array( port, "palette_list", 4, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
//@ setup parameters (INDEX type, 0-255)
|
||||
in_params[0] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[0];
|
||||
|
||||
livido_set_string_value(port, "name", "Smoothness" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 10 );
|
||||
livido_set_int_value( port, "default", 3 );
|
||||
livido_set_string_value( port, "description" ,"Smoothness");
|
||||
|
||||
|
||||
in_params[1] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[1];
|
||||
|
||||
livido_set_string_value(port, "name", "Sharpening" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 400 );
|
||||
livido_set_int_value( port, "default", 200 );
|
||||
livido_set_string_value( port, "description" ,"Sharpening");
|
||||
|
||||
|
||||
|
||||
in_params[2] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[2];
|
||||
|
||||
livido_set_string_value(port, "name", "Edge threshold" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0);
|
||||
livido_set_int_value( port, "max", 30);
|
||||
livido_set_int_value( port, "default", 20 );
|
||||
livido_set_string_value( port, "description" ,"Edge Threshold");
|
||||
|
||||
|
||||
in_params[3] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[3];
|
||||
|
||||
livido_set_string_value(port, "name", "Edge thickness" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0);
|
||||
livido_set_int_value( port, "max", 100 );
|
||||
livido_set_int_value( port, "default", 25);
|
||||
livido_set_string_value( port, "description" ,"Edge thickness");
|
||||
|
||||
|
||||
in_params[4] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[4];
|
||||
|
||||
livido_set_string_value(port, "name", "Color strength" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0);
|
||||
livido_set_int_value( port, "max", 300 );
|
||||
livido_set_int_value( port, "default", 15 );
|
||||
livido_set_string_value( port, "description" ,"Color");
|
||||
|
||||
|
||||
|
||||
in_params[5] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[5];
|
||||
|
||||
livido_set_string_value(port, "name", "Quantization" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0);
|
||||
livido_set_int_value( port, "max", 255 );
|
||||
livido_set_int_value( port, "default", 8 );
|
||||
livido_set_string_value( port, "description" ,"Quantization");
|
||||
|
||||
|
||||
//@ setup the nodes
|
||||
livido_set_portptr_array( filter, "in_parameter_templates",6, in_params );
|
||||
livido_set_portptr_array( filter, "out_channel_templates", 1, out_chans );
|
||||
livido_set_portptr_array( filter, "in_channel_templates",1, in_chans );
|
||||
|
||||
livido_set_portptr_value(info, "filters", filter);
|
||||
return info;
|
||||
}
|
||||
170
veejay-current/plugin-packs/lvdgmic/plugins/gmic_cracks.c
Normal file
170
veejay-current/plugin-packs/lvdgmic/plugins/gmic_cracks.c
Normal file
@@ -0,0 +1,170 @@
|
||||
/*
|
||||
* LIBVJE - veejay fx library
|
||||
*
|
||||
* Copyright(C)2015 Niels Elburg <nwelburg@gmail.com>
|
||||
* See COPYING for software license and distribution details
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef IS_LIVIDO_PLUGIN
|
||||
#define IS_LIVIDO_PLUGIN
|
||||
#endif
|
||||
|
||||
#include "livido.h"
|
||||
LIVIDO_PLUGIN
|
||||
#include "utils.h"
|
||||
#include "livido-utils.c"
|
||||
#include "lvd_common.h"
|
||||
#include "lvdgmicglue.h"
|
||||
|
||||
livido_init_f init_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = lvdgmic_new(1);
|
||||
|
||||
livido_property_set( my_instance, "PLUGIN_private",
|
||||
LIVIDO_ATOM_TYPE_VOIDPTR,1,&gmic );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_deinit_f deinit_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
lvdgmic_delete(gmic);
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_process_f process_instance( livido_port_t *my_instance, double timecode )
|
||||
{
|
||||
uint8_t *A[4] = {NULL,NULL,NULL,NULL};
|
||||
uint8_t *O[4]= {NULL,NULL,NULL,NULL};
|
||||
char cmd[256];
|
||||
int palette;
|
||||
int w;
|
||||
int h;
|
||||
|
||||
int error = lvd_extract_channel_values( my_instance, "out_channels", 0, &w,&h, O,&palette );
|
||||
if( error != LIVIDO_NO_ERROR )
|
||||
return LIVIDO_ERROR_HARDWARE;
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
|
||||
lvd_extract_channel_values( my_instance, "in_channels" , 0, &w, &h, A, &palette );
|
||||
|
||||
int density = lvd_extract_param_index( my_instance,"in_parameters", 0 );
|
||||
int amplitude = lvd_extract_param_index( my_instance,"in_parameters", 1 );
|
||||
int relief = lvd_extract_param_index( my_instance, "in_parameters",2);
|
||||
|
||||
snprintf(cmd,sizeof(cmd),"-cracks %f,%d,%d", (float)density/10.0f,amplitude, relief );
|
||||
|
||||
lvdgmic_push( gmic, w, h, 0, A, 0);
|
||||
|
||||
lvdgmic_gmic( gmic, cmd );
|
||||
|
||||
lvdgmic_pull( gmic, 0, O );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
livido_port_t *livido_setup(livido_setup_t list[], int version)
|
||||
|
||||
{
|
||||
LIVIDO_IMPORT(list);
|
||||
|
||||
livido_port_t *port = NULL;
|
||||
livido_port_t *in_params[3];
|
||||
livido_port_t *in_chans[3];
|
||||
livido_port_t *out_chans[1];
|
||||
livido_port_t *info = NULL;
|
||||
livido_port_t *filter = NULL;
|
||||
|
||||
//@ setup root node, plugin info
|
||||
info = livido_port_new( LIVIDO_PORT_TYPE_PLUGIN_INFO );
|
||||
port = info;
|
||||
|
||||
livido_set_string_value( port, "maintainer", "Niels");
|
||||
livido_set_string_value( port, "version","1");
|
||||
|
||||
filter = livido_port_new( LIVIDO_PORT_TYPE_FILTER_CLASS );
|
||||
livido_set_int_value( filter, "api_version", LIVIDO_API_VERSION );
|
||||
|
||||
//@ setup function pointers
|
||||
livido_set_voidptr_value( filter, "deinit_func", &deinit_instance );
|
||||
livido_set_voidptr_value( filter, "init_func", &init_instance );
|
||||
livido_set_voidptr_value( filter, "process_func", &process_instance );
|
||||
port = filter;
|
||||
|
||||
//@ meta information
|
||||
livido_set_string_value( port, "name", "G'MIC/GREYs Cracks");
|
||||
livido_set_string_value( port, "description", "Apply random cracks on image");
|
||||
livido_set_string_value( port, "author", "GREYC's Magic for Image Computing");
|
||||
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
livido_set_string_value( port, "license", "GPL2");
|
||||
livido_set_int_value( port, "version", 1);
|
||||
|
||||
//@ some palettes veejay-classic uses
|
||||
int palettes0[] = {
|
||||
LIVIDO_PALETTE_YUV422P,
|
||||
0,
|
||||
};
|
||||
|
||||
//@ setup output channel
|
||||
out_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = out_chans[0];
|
||||
|
||||
livido_set_string_value( port, "name", "Output Channel");
|
||||
livido_set_int_array( port, "palette_list", 3, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = in_chans[0];
|
||||
livido_set_string_value( port, "name", "Input Channel");
|
||||
livido_set_int_array( port, "palette_list", 4, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
|
||||
in_params[0] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[0];
|
||||
|
||||
livido_set_string_value(port, "name", "Density" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 100 );
|
||||
livido_set_int_value( port, "default", 1 );
|
||||
livido_set_string_value( port, "description" ,"Density");
|
||||
|
||||
in_params[1] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[1];
|
||||
|
||||
livido_set_string_value(port, "name", "Amplitude" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", -255 );
|
||||
livido_set_int_value( port, "max", 255 );
|
||||
livido_set_int_value( port, "default", -80 );
|
||||
livido_set_string_value( port, "description" ,"Amplitude");
|
||||
|
||||
|
||||
in_params[2] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[2];
|
||||
|
||||
livido_set_string_value(port, "name", "Relief" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 1 );
|
||||
livido_set_int_value( port, "default", 1 );
|
||||
livido_set_string_value( port, "description" ,"Relief");
|
||||
|
||||
|
||||
//@ setup the nodes
|
||||
livido_set_portptr_array( filter, "in_parameter_templates",3, in_params );
|
||||
livido_set_portptr_array( filter, "out_channel_templates", 1, out_chans );
|
||||
livido_set_portptr_array( filter, "in_channel_templates",1, in_chans );
|
||||
|
||||
livido_set_portptr_value(info, "filters", filter);
|
||||
return info;
|
||||
}
|
||||
171
veejay-current/plugin-packs/lvdgmic/plugins/gmic_crystal.c
Normal file
171
veejay-current/plugin-packs/lvdgmic/plugins/gmic_crystal.c
Normal file
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* LIBVJE - veejay fx library
|
||||
*
|
||||
* Copyright(C)2015 Niels Elburg <nwelburg@gmail.com>
|
||||
* See COPYING for software license and distribution details
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef IS_LIVIDO_PLUGIN
|
||||
#define IS_LIVIDO_PLUGIN
|
||||
#endif
|
||||
|
||||
#include "livido.h"
|
||||
LIVIDO_PLUGIN
|
||||
#include "utils.h"
|
||||
#include "livido-utils.c"
|
||||
#include "lvd_common.h"
|
||||
#include "lvdgmicglue.h"
|
||||
|
||||
livido_init_f init_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = lvdgmic_new(1);
|
||||
|
||||
livido_property_set( my_instance, "PLUGIN_private",
|
||||
LIVIDO_ATOM_TYPE_VOIDPTR,1,&gmic );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_deinit_f deinit_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
lvdgmic_delete(gmic);
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_process_f process_instance( livido_port_t *my_instance, double timecode )
|
||||
{
|
||||
uint8_t *A[4] = {NULL,NULL,NULL,NULL};
|
||||
uint8_t *O[4]= {NULL,NULL,NULL,NULL};
|
||||
char cmd[256];
|
||||
int palette;
|
||||
int w;
|
||||
int h;
|
||||
|
||||
int error = lvd_extract_channel_values( my_instance, "out_channels", 0, &w,&h, O,&palette );
|
||||
if( error != LIVIDO_NO_ERROR )
|
||||
return LIVIDO_ERROR_HARDWARE;
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
|
||||
lvd_extract_channel_values( my_instance, "in_channels" , 0, &w, &h, A, &palette );
|
||||
|
||||
int density = lvd_extract_param_index( my_instance,"in_parameters", 0 );
|
||||
int smoothness = lvd_extract_param_index( my_instance,"in_parameters", 1 );
|
||||
int edges = lvd_extract_param_index(my_instance, "in_parameters",2);
|
||||
|
||||
snprintf(cmd,sizeof(cmd),"-gimp_crystal %d,%f,%d", density, (float)smoothness/100.0f, edges );
|
||||
|
||||
lvdgmic_push( gmic, w, h, 0, A, 0);
|
||||
|
||||
lvdgmic_gmic( gmic, cmd );
|
||||
|
||||
lvdgmic_pull( gmic, 0, O );
|
||||
|
||||
livido_memset( O[1], 128, (w*h)/2);
|
||||
livido_memset( O[2], 128, (w*h)/2);
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
livido_port_t *livido_setup(livido_setup_t list[], int version)
|
||||
|
||||
{
|
||||
LIVIDO_IMPORT(list);
|
||||
|
||||
livido_port_t *port = NULL;
|
||||
livido_port_t *in_params[3];
|
||||
livido_port_t *in_chans[3];
|
||||
livido_port_t *out_chans[1];
|
||||
livido_port_t *info = NULL;
|
||||
livido_port_t *filter = NULL;
|
||||
|
||||
//@ setup root node, plugin info
|
||||
info = livido_port_new( LIVIDO_PORT_TYPE_PLUGIN_INFO );
|
||||
port = info;
|
||||
|
||||
livido_set_string_value( port, "maintainer", "Niels");
|
||||
livido_set_string_value( port, "version","1");
|
||||
|
||||
filter = livido_port_new( LIVIDO_PORT_TYPE_FILTER_CLASS );
|
||||
livido_set_int_value( filter, "api_version", LIVIDO_API_VERSION );
|
||||
|
||||
//@ setup function pointers
|
||||
livido_set_voidptr_value( filter, "deinit_func", &deinit_instance );
|
||||
livido_set_voidptr_value( filter, "init_func", &init_instance );
|
||||
livido_set_voidptr_value( filter, "process_func", &process_instance );
|
||||
port = filter;
|
||||
|
||||
//@ meta information
|
||||
livido_set_string_value( port, "name", "G'MIC/GREYs Crystal");
|
||||
livido_set_string_value( port, "description", "Apply wave deformation on image");
|
||||
livido_set_string_value( port, "author", "GREYC's Magic for Image Computing");
|
||||
|
||||
livido_set_int_value( port, "flags", LIVIDO_FILTER_NON_REALTIME);
|
||||
livido_set_string_value( port, "license", "GPL2");
|
||||
livido_set_int_value( port, "version", 1);
|
||||
|
||||
//@ some palettes veejay-classic uses
|
||||
int palettes0[] = {
|
||||
LIVIDO_PALETTE_YUV422P,
|
||||
0,
|
||||
};
|
||||
|
||||
//@ setup output channel
|
||||
out_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = out_chans[0];
|
||||
|
||||
livido_set_string_value( port, "name", "Output Channel");
|
||||
livido_set_int_array( port, "palette_list", 3, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = in_chans[0];
|
||||
livido_set_string_value( port, "name", "Input Channel");
|
||||
livido_set_int_array( port, "palette_list", 4, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_params[0] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[0];
|
||||
|
||||
livido_set_string_value(port, "name", "Density" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 100 );
|
||||
livido_set_int_value( port, "default", 10 );
|
||||
livido_set_string_value( port, "description" ,"Density");
|
||||
|
||||
|
||||
in_params[1] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[1];
|
||||
|
||||
livido_set_string_value(port, "name", "Smoothness" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 200 );
|
||||
livido_set_int_value( port, "default", 40 );
|
||||
livido_set_string_value( port, "description" ,"Smoothness");
|
||||
|
||||
in_params[2] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[2];
|
||||
|
||||
livido_set_string_value(port, "name", "Edges" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 100 );
|
||||
livido_set_int_value( port, "default", 10 );
|
||||
livido_set_string_value( port, "description" ,"Edges");
|
||||
|
||||
//@ setup the nodes
|
||||
livido_set_portptr_array( filter, "in_parameter_templates",3, in_params );
|
||||
livido_set_portptr_array( filter, "out_channel_templates", 1, out_chans );
|
||||
livido_set_portptr_array( filter, "in_channel_templates",1, in_chans );
|
||||
|
||||
livido_set_portptr_value(info, "filters", filter);
|
||||
return info;
|
||||
}
|
||||
166
veejay-current/plugin-packs/lvdgmic/plugins/gmic_dices.c
Normal file
166
veejay-current/plugin-packs/lvdgmic/plugins/gmic_dices.c
Normal file
@@ -0,0 +1,166 @@
|
||||
/*
|
||||
* LIBVJE - veejay fx library
|
||||
*
|
||||
* Copyright(C)2015 Niels Elburg <nwelburg@gmail.com>
|
||||
* See COPYING for software license and distribution details
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef IS_LIVIDO_PLUGIN
|
||||
#define IS_LIVIDO_PLUGIN
|
||||
#endif
|
||||
|
||||
#include "livido.h"
|
||||
LIVIDO_PLUGIN
|
||||
#include "utils.h"
|
||||
#include "livido-utils.c"
|
||||
#include "lvd_common.h"
|
||||
#include "lvdgmicglue.h"
|
||||
|
||||
livido_init_f init_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = lvdgmic_new(1);
|
||||
|
||||
livido_property_set( my_instance, "PLUGIN_private",
|
||||
LIVIDO_ATOM_TYPE_VOIDPTR,1,&gmic );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_deinit_f deinit_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
lvdgmic_delete(gmic);
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_process_f process_instance( livido_port_t *my_instance, double timecode )
|
||||
{
|
||||
uint8_t *A[4] = {NULL,NULL,NULL,NULL};
|
||||
uint8_t *O[4]= {NULL,NULL,NULL,NULL};
|
||||
char cmd[256];
|
||||
int palette;
|
||||
int w;
|
||||
int h;
|
||||
|
||||
int error = lvd_extract_channel_values( my_instance, "out_channels", 0, &w,&h, O,&palette );
|
||||
if( error != LIVIDO_NO_ERROR )
|
||||
return LIVIDO_ERROR_HARDWARE;
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
|
||||
lvd_extract_channel_values( my_instance, "in_channels" , 0, &w, &h, A, &palette );
|
||||
|
||||
int resolution = lvd_extract_param_index( my_instance,"in_parameters", 0 );
|
||||
int size = lvd_extract_param_index( my_instance,"in_parameters", 1 );
|
||||
int colormodel = lvd_extract_param_index(my_instance, "in_parameters",2);
|
||||
|
||||
snprintf(cmd,sizeof(cmd),"-gimp_dices %d,%d,%d", resolution, size, colormodel );
|
||||
|
||||
lvdgmic_push( gmic, w, h, palette, A, 0);
|
||||
|
||||
lvdgmic_gmic( gmic, cmd );
|
||||
|
||||
lvdgmic_pull( gmic, 0, O );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
livido_port_t *livido_setup(livido_setup_t list[], int version)
|
||||
|
||||
{
|
||||
LIVIDO_IMPORT(list);
|
||||
|
||||
livido_port_t *port = NULL;
|
||||
livido_port_t *in_params[3];
|
||||
livido_port_t *in_chans[3];
|
||||
livido_port_t *out_chans[1];
|
||||
livido_port_t *info = NULL;
|
||||
livido_port_t *filter = NULL;
|
||||
|
||||
//@ setup root node, plugin info
|
||||
info = livido_port_new( LIVIDO_PORT_TYPE_PLUGIN_INFO );
|
||||
port = info;
|
||||
|
||||
livido_set_string_value( port, "maintainer", "Niels");
|
||||
livido_set_string_value( port, "version","1");
|
||||
|
||||
filter = livido_port_new( LIVIDO_PORT_TYPE_FILTER_CLASS );
|
||||
livido_set_int_value( filter, "api_version", LIVIDO_API_VERSION );
|
||||
|
||||
//@ setup function pointers
|
||||
livido_set_voidptr_value( filter, "deinit_func", &deinit_instance );
|
||||
livido_set_voidptr_value( filter, "init_func", &init_instance );
|
||||
livido_set_voidptr_value( filter, "process_func", &process_instance );
|
||||
port = filter;
|
||||
|
||||
//@ meta information
|
||||
livido_set_string_value( port, "name", "G'MIC/GREYs Dices");
|
||||
livido_set_string_value( port, "description", "Apply dices effect on image");
|
||||
livido_set_string_value( port, "author", "GREYC's Magic for Image Computing");
|
||||
|
||||
livido_set_int_value( port, "flags", LIVIDO_FILTER_NON_REALTIME);
|
||||
livido_set_string_value( port, "license", "GPL2");
|
||||
livido_set_int_value( port, "version", 1);
|
||||
|
||||
//@ some palettes veejay-classic uses
|
||||
int palettes0[] = {
|
||||
LIVIDO_PALETTE_YUV422P,
|
||||
0,
|
||||
};
|
||||
|
||||
//@ setup output channel
|
||||
out_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = out_chans[0];
|
||||
|
||||
livido_set_string_value( port, "name", "Output Channel");
|
||||
livido_set_int_array( port, "palette_list", 3, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = in_chans[0];
|
||||
livido_set_string_value( port, "name", "Input Channel");
|
||||
livido_set_int_array( port, "palette_list", 4, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_params[0] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[0];
|
||||
|
||||
livido_set_string_value(port, "name", "Resolution" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 1 );
|
||||
livido_set_int_value( port, "max", 10 );
|
||||
livido_set_int_value( port, "default", 2 );
|
||||
livido_set_string_value( port, "description" ,"Resolution");
|
||||
|
||||
in_params[1] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[1];
|
||||
|
||||
livido_set_string_value(port, "name", "Size" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 8 );
|
||||
livido_set_int_value( port, "max", 64 );
|
||||
livido_set_int_value( port, "default", 24 );
|
||||
livido_set_string_value( port, "description" ,"Size");
|
||||
|
||||
in_params[2] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[2];
|
||||
|
||||
livido_set_string_value(port, "name", "Color_Model" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 3 );
|
||||
livido_set_int_value( port, "default", 1 );
|
||||
livido_set_string_value( port, "description" ,"Color_Model");
|
||||
|
||||
livido_set_portptr_array( filter, "in_parameter_templates",3,in_params );
|
||||
livido_set_portptr_array( filter, "out_channel_templates",1,out_chans );
|
||||
livido_set_portptr_array( filter, "in_channel_templates",1,in_chans );
|
||||
|
||||
livido_set_portptr_value(info, "filters", filter);
|
||||
return info;
|
||||
}
|
||||
156
veejay-current/plugin-packs/lvdgmic/plugins/gmic_kuwahara.c
Normal file
156
veejay-current/plugin-packs/lvdgmic/plugins/gmic_kuwahara.c
Normal file
@@ -0,0 +1,156 @@
|
||||
/*
|
||||
* LIBVJE - veejay fx library
|
||||
*
|
||||
* Copyright(C)2015 Niels Elburg <nwelburg@gmail.com>
|
||||
* See COPYING for software license and distribution details
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef IS_LIVIDO_PLUGIN
|
||||
#define IS_LIVIDO_PLUGIN
|
||||
#endif
|
||||
|
||||
#include "livido.h"
|
||||
LIVIDO_PLUGIN
|
||||
#include "utils.h"
|
||||
#include "livido-utils.c"
|
||||
#include "lvd_common.h"
|
||||
#include "lvdgmicglue.h"
|
||||
|
||||
livido_init_f init_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = lvdgmic_new(1);
|
||||
|
||||
livido_property_set( my_instance, "PLUGIN_private",
|
||||
LIVIDO_ATOM_TYPE_VOIDPTR,1,&gmic );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_deinit_f deinit_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
lvdgmic_delete(gmic);
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_process_f process_instance( livido_port_t *my_instance, double timecode )
|
||||
{
|
||||
uint8_t *A[4] = {NULL,NULL,NULL,NULL};
|
||||
uint8_t *O[4]= {NULL,NULL,NULL,NULL};
|
||||
char cmd[256];
|
||||
int palette;
|
||||
int w;
|
||||
int h;
|
||||
|
||||
int error = lvd_extract_channel_values( my_instance, "out_channels", 0, &w,&h, O,&palette );
|
||||
if( error != LIVIDO_NO_ERROR )
|
||||
return LIVIDO_ERROR_HARDWARE;
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
|
||||
lvd_extract_channel_values( my_instance, "in_channels" , 0, &w, &h, A, &palette );
|
||||
|
||||
int iterations = lvd_extract_param_index( my_instance,"in_parameters", 0 );
|
||||
int radius = lvd_extract_param_index( my_instance,"in_parameters", 1 );
|
||||
|
||||
snprintf(cmd,sizeof(cmd),"-kuwahara %d,%d", iterations, radius );
|
||||
|
||||
lvdgmic_push( gmic, w, h, palette, A, 0);
|
||||
|
||||
lvdgmic_gmic( gmic, cmd );
|
||||
|
||||
lvdgmic_pull( gmic, 0, O );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
livido_port_t *livido_setup(livido_setup_t list[], int version)
|
||||
|
||||
{
|
||||
LIVIDO_IMPORT(list);
|
||||
|
||||
livido_port_t *port = NULL;
|
||||
livido_port_t *in_params[2];
|
||||
livido_port_t *in_chans[3];
|
||||
livido_port_t *out_chans[1];
|
||||
livido_port_t *info = NULL;
|
||||
livido_port_t *filter = NULL;
|
||||
|
||||
//@ setup root node, plugin info
|
||||
info = livido_port_new( LIVIDO_PORT_TYPE_PLUGIN_INFO );
|
||||
port = info;
|
||||
|
||||
livido_set_string_value( port, "maintainer", "Niels");
|
||||
livido_set_string_value( port, "version","1");
|
||||
|
||||
filter = livido_port_new( LIVIDO_PORT_TYPE_FILTER_CLASS );
|
||||
livido_set_int_value( filter, "api_version", LIVIDO_API_VERSION );
|
||||
|
||||
//@ setup function pointers
|
||||
livido_set_voidptr_value( filter, "deinit_func", &deinit_instance );
|
||||
livido_set_voidptr_value( filter, "init_func", &init_instance );
|
||||
livido_set_voidptr_value( filter, "process_func", &process_instance );
|
||||
port = filter;
|
||||
|
||||
//@ meta information
|
||||
livido_set_string_value( port, "name", "G'MIC/GREYs Kuwahara");
|
||||
livido_set_string_value( port, "description", "Apply kuwahara effect on image");
|
||||
livido_set_string_value( port, "author", "GREYC's Magic for Image Computing");
|
||||
|
||||
livido_set_int_value( port, "flags", LIVIDO_FILTER_NON_REALTIME);
|
||||
livido_set_string_value( port, "license", "GPL2");
|
||||
livido_set_int_value( port, "version", 1);
|
||||
|
||||
//@ some palettes veejay-classic uses
|
||||
int palettes0[] = {
|
||||
LIVIDO_PALETTE_YUV422P,
|
||||
0,
|
||||
};
|
||||
|
||||
//@ setup output channel
|
||||
out_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = out_chans[0];
|
||||
|
||||
livido_set_string_value( port, "name", "Output Channel");
|
||||
livido_set_int_array( port, "palette_list", 3, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = in_chans[0];
|
||||
livido_set_string_value( port, "name", "Input Channel");
|
||||
livido_set_int_array( port, "palette_list", 4, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_params[0] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[0];
|
||||
|
||||
livido_set_string_value(port, "name", "Iterations" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 1 );
|
||||
livido_set_int_value( port, "max", 20 );
|
||||
livido_set_int_value( port, "default", 2 );
|
||||
livido_set_string_value( port, "description" ,"Iterations");
|
||||
|
||||
|
||||
in_params[1] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[1];
|
||||
|
||||
livido_set_string_value(port, "name", "Radius" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 1 );
|
||||
livido_set_int_value( port, "max", 30 );
|
||||
livido_set_int_value( port, "default", 5 );
|
||||
livido_set_string_value( port, "description" ,"Radius");
|
||||
|
||||
livido_set_portptr_array( filter, "in_parameter_templates",2, in_params );
|
||||
livido_set_portptr_array( filter, "out_channel_templates",1, out_chans );
|
||||
livido_set_portptr_array( filter, "in_channel_templates",1, in_chans );
|
||||
|
||||
livido_set_portptr_value(info, "filters", filter);
|
||||
return info;
|
||||
}
|
||||
178
veejay-current/plugin-packs/lvdgmic/plugins/gmic_lava.c
Normal file
178
veejay-current/plugin-packs/lvdgmic/plugins/gmic_lava.c
Normal file
@@ -0,0 +1,178 @@
|
||||
/*
|
||||
* LIBVJE - veejay fx library
|
||||
*
|
||||
* Copyright(C)2015 Niels Elburg <nwelburg@gmail.com>
|
||||
* See COPYING for software license and distribution details
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef IS_LIVIDO_PLUGIN
|
||||
#define IS_LIVIDO_PLUGIN
|
||||
#endif
|
||||
|
||||
#include "livido.h"
|
||||
LIVIDO_PLUGIN
|
||||
#include "utils.h"
|
||||
#include "livido-utils.c"
|
||||
#include "lvd_common.h"
|
||||
#include "lvdgmicglue.h"
|
||||
|
||||
livido_init_f init_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = lvdgmic_new(1);
|
||||
|
||||
livido_property_set( my_instance, "PLUGIN_private",
|
||||
LIVIDO_ATOM_TYPE_VOIDPTR,1,&gmic );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_deinit_f deinit_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
lvdgmic_delete(gmic);
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_process_f process_instance( livido_port_t *my_instance, double timecode )
|
||||
{
|
||||
uint8_t *A[4] = {NULL,NULL,NULL,NULL};
|
||||
uint8_t *O[4]= {NULL,NULL,NULL,NULL};
|
||||
char cmd[256];
|
||||
int palette;
|
||||
int w;
|
||||
int h;
|
||||
|
||||
int error = lvd_extract_channel_values( my_instance, "out_channels", 0, &w,&h, O,&palette );
|
||||
if( error != LIVIDO_NO_ERROR )
|
||||
return LIVIDO_ERROR_HARDWARE;
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
|
||||
lvd_extract_channel_values( my_instance, "in_channels" , 0, &w, &h, A, &palette );
|
||||
|
||||
int perturbation = lvd_extract_param_index( my_instance,"in_parameters", 0 );
|
||||
int smoothness = lvd_extract_param_index( my_instance,"in_parameters", 1 );
|
||||
int sharpness = lvd_extract_param_index(my_instance, "in_parameters",2);
|
||||
|
||||
snprintf(cmd,sizeof(cmd),"-gimp_lava %d,%d,%d,%d", perturbation, smoothness, sharpness );
|
||||
|
||||
lvdgmic_push( gmic, w, h, 0, A, 0);
|
||||
|
||||
lvdgmic_gmic( gmic, cmd );
|
||||
|
||||
lvdgmic_pull( gmic, 0, O );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
livido_port_t *livido_setup(livido_setup_t list[], int version)
|
||||
|
||||
{
|
||||
LIVIDO_IMPORT(list);
|
||||
|
||||
livido_port_t *port = NULL;
|
||||
livido_port_t *in_params[4];
|
||||
livido_port_t *in_chans[3];
|
||||
livido_port_t *out_chans[1];
|
||||
livido_port_t *info = NULL;
|
||||
livido_port_t *filter = NULL;
|
||||
|
||||
//@ setup root node, plugin info
|
||||
info = livido_port_new( LIVIDO_PORT_TYPE_PLUGIN_INFO );
|
||||
port = info;
|
||||
|
||||
livido_set_string_value( port, "maintainer", "Niels");
|
||||
livido_set_string_value( port, "version","1");
|
||||
|
||||
filter = livido_port_new( LIVIDO_PORT_TYPE_FILTER_CLASS );
|
||||
livido_set_int_value( filter, "api_version", LIVIDO_API_VERSION );
|
||||
|
||||
//@ setup function pointers
|
||||
livido_set_voidptr_value( filter, "deinit_func", &deinit_instance );
|
||||
livido_set_voidptr_value( filter, "init_func", &init_instance );
|
||||
livido_set_voidptr_value( filter, "process_func", &process_instance );
|
||||
port = filter;
|
||||
|
||||
//@ meta information
|
||||
livido_set_string_value( port, "name", "G'MIC/GREYs Lava");
|
||||
livido_set_string_value( port, "description", "Apply Lava");
|
||||
livido_set_string_value( port, "author", "GREYC's Magic for Image Computing");
|
||||
|
||||
livido_set_int_value( port, "flags", LIVIDO_FILTER_NON_REALTIME);
|
||||
livido_set_string_value( port, "license", "GPL2");
|
||||
livido_set_int_value( port, "version", 1);
|
||||
|
||||
//@ some palettes veejay-classic uses
|
||||
int palettes0[] = {
|
||||
LIVIDO_PALETTE_YUV422P,
|
||||
0,
|
||||
};
|
||||
|
||||
//@ setup output channel
|
||||
out_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = out_chans[0];
|
||||
|
||||
livido_set_string_value( port, "name", "Output Channel");
|
||||
livido_set_int_array( port, "palette_list", 3, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = in_chans[0];
|
||||
livido_set_string_value( port, "name", "Input Channel");
|
||||
livido_set_int_array( port, "palette_list", 4, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_params[0] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[0];
|
||||
|
||||
livido_set_string_value(port, "name", "Perturbation" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 15 );
|
||||
livido_set_int_value( port, "default", 8 );
|
||||
livido_set_string_value( port, "description" ,"Perturbation");
|
||||
|
||||
|
||||
in_params[1] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[1];
|
||||
|
||||
livido_set_string_value(port, "name", "Smoothness" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 100 );
|
||||
livido_set_int_value( port, "default", 5 );
|
||||
livido_set_string_value( port, "description" ,"Smoothness");
|
||||
|
||||
in_params[2] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[2];
|
||||
|
||||
livido_set_string_value(port, "name", "Scale" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 20 );
|
||||
livido_set_int_value( port, "default", 3 );
|
||||
livido_set_string_value( port, "description" ,"Scale");
|
||||
|
||||
in_params[3] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[3];
|
||||
|
||||
livido_set_string_value(port, "name", "Sharpness" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 1000 );
|
||||
livido_set_int_value( port, "default",0 );
|
||||
livido_set_string_value( port, "description" ,"Sharpness");
|
||||
|
||||
//@ setup the nodes
|
||||
livido_set_portptr_array( filter, "in_parameter_templates",4, in_params );
|
||||
livido_set_portptr_array( filter, "out_channel_templates", 1, out_chans );
|
||||
livido_set_portptr_array( filter, "in_channel_templates",1, in_chans );
|
||||
|
||||
livido_set_portptr_value(info, "filters", filter);
|
||||
return info;
|
||||
}
|
||||
170
veejay-current/plugin-packs/lvdgmic/plugins/gmic_lightpatch.c
Normal file
170
veejay-current/plugin-packs/lvdgmic/plugins/gmic_lightpatch.c
Normal file
@@ -0,0 +1,170 @@
|
||||
/*
|
||||
* LIBVJE - veejay fx library
|
||||
*
|
||||
* Copyright(C)2015 Niels Elburg <nwelburg@gmail.com>
|
||||
* See COPYING for software license and distribution details
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef IS_LIVIDO_PLUGIN
|
||||
#define IS_LIVIDO_PLUGIN
|
||||
#endif
|
||||
|
||||
#include "livido.h"
|
||||
LIVIDO_PLUGIN
|
||||
#include "utils.h"
|
||||
#include "livido-utils.c"
|
||||
#include "lvd_common.h"
|
||||
#include "lvdgmicglue.h"
|
||||
|
||||
livido_init_f init_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = lvdgmic_new(1);
|
||||
|
||||
livido_property_set( my_instance, "PLUGIN_private",
|
||||
LIVIDO_ATOM_TYPE_VOIDPTR,1,&gmic );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_deinit_f deinit_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
lvdgmic_delete(gmic);
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_process_f process_instance( livido_port_t *my_instance, double timecode )
|
||||
{
|
||||
uint8_t *A[4] = {NULL,NULL,NULL,NULL};
|
||||
uint8_t *O[4]= {NULL,NULL,NULL,NULL};
|
||||
char cmd[256];
|
||||
int palette;
|
||||
int w;
|
||||
int h;
|
||||
|
||||
int error = lvd_extract_channel_values( my_instance, "out_channels", 0, &w,&h, O,&palette );
|
||||
if( error != LIVIDO_NO_ERROR )
|
||||
return LIVIDO_ERROR_HARDWARE;
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
|
||||
lvd_extract_channel_values( my_instance, "in_channels" , 0, &w, &h, A, &palette );
|
||||
|
||||
int density = lvd_extract_param_index( my_instance,"in_parameters", 0 );
|
||||
int darkness = lvd_extract_param_index( my_instance,"in_parameters", 1 );
|
||||
int lightness = lvd_extract_param_index( my_instance, "in_parameters",2);
|
||||
|
||||
snprintf(cmd,sizeof(cmd),"-light_patch %d,%f,%f", density,(float)darkness/100.0f,(float)lightness/100.0f );
|
||||
|
||||
lvdgmic_push( gmic, w, h, 0, A, 0);
|
||||
|
||||
lvdgmic_gmic( gmic, cmd );
|
||||
|
||||
lvdgmic_pull( gmic, 0, O );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
livido_port_t *livido_setup(livido_setup_t list[], int version)
|
||||
|
||||
{
|
||||
LIVIDO_IMPORT(list);
|
||||
|
||||
livido_port_t *port = NULL;
|
||||
livido_port_t *in_params[3];
|
||||
livido_port_t *in_chans[3];
|
||||
livido_port_t *out_chans[1];
|
||||
livido_port_t *info = NULL;
|
||||
livido_port_t *filter = NULL;
|
||||
|
||||
//@ setup root node, plugin info
|
||||
info = livido_port_new( LIVIDO_PORT_TYPE_PLUGIN_INFO );
|
||||
port = info;
|
||||
|
||||
livido_set_string_value( port, "maintainer", "Niels");
|
||||
livido_set_string_value( port, "version","1");
|
||||
|
||||
filter = livido_port_new( LIVIDO_PORT_TYPE_FILTER_CLASS );
|
||||
livido_set_int_value( filter, "api_version", LIVIDO_API_VERSION );
|
||||
|
||||
//@ setup function pointers
|
||||
livido_set_voidptr_value( filter, "deinit_func", &deinit_instance );
|
||||
livido_set_voidptr_value( filter, "init_func", &init_instance );
|
||||
livido_set_voidptr_value( filter, "process_func", &process_instance );
|
||||
port = filter;
|
||||
|
||||
//@ meta information
|
||||
livido_set_string_value( port, "name", "G'MIC/GREYs Light Patch");
|
||||
livido_set_string_value( port, "description", "Apply light patches on image");
|
||||
livido_set_string_value( port, "author", "GREYC's Magic for Image Computing");
|
||||
|
||||
livido_set_int_value( port, "flags", LIVIDO_FILTER_NON_REALTIME);
|
||||
livido_set_string_value( port, "license", "GPL2");
|
||||
livido_set_int_value( port, "version", 1);
|
||||
|
||||
//@ some palettes veejay-classic uses
|
||||
int palettes0[] = {
|
||||
LIVIDO_PALETTE_YUV422P,
|
||||
0,
|
||||
};
|
||||
|
||||
//@ setup output channel
|
||||
out_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = out_chans[0];
|
||||
|
||||
livido_set_string_value( port, "name", "Output Channel");
|
||||
livido_set_int_array( port, "palette_list", 3, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = in_chans[0];
|
||||
livido_set_string_value( port, "name", "Input Channel");
|
||||
livido_set_int_array( port, "palette_list", 4, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
|
||||
in_params[0] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[0];
|
||||
|
||||
livido_set_string_value(port, "name", "Density" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 2 );
|
||||
livido_set_int_value( port, "max", 30 );
|
||||
livido_set_int_value( port, "default", 5 );
|
||||
livido_set_string_value( port, "description" ,"Density");
|
||||
|
||||
in_params[1] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[1];
|
||||
|
||||
livido_set_string_value(port, "name", "Darkness" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 100 );
|
||||
livido_set_int_value( port, "default", 70 );
|
||||
livido_set_string_value( port, "description" ,"Darkness");
|
||||
|
||||
|
||||
in_params[2] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[2];
|
||||
|
||||
livido_set_string_value(port, "name", "Lightness" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 400 );
|
||||
livido_set_int_value( port, "default", 250 );
|
||||
livido_set_string_value( port, "description" ,"Lightness");
|
||||
|
||||
|
||||
//@ setup the nodes
|
||||
livido_set_portptr_array( filter, "in_parameter_templates",3, in_params );
|
||||
livido_set_portptr_array( filter, "out_channel_templates", 1, out_chans );
|
||||
livido_set_portptr_array( filter, "in_channel_templates",1, in_chans );
|
||||
|
||||
livido_set_portptr_value(info, "filters", filter);
|
||||
return info;
|
||||
}
|
||||
256
veejay-current/plugin-packs/lvdgmic/plugins/gmic_marble.c
Normal file
256
veejay-current/plugin-packs/lvdgmic/plugins/gmic_marble.c
Normal file
@@ -0,0 +1,256 @@
|
||||
/*
|
||||
* LIBVJE - veejay fx library
|
||||
*
|
||||
* Copyright(C)2015 Niels Elburg <nwelburg@gmail.com>
|
||||
* See COPYING for software license and distribution details
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef IS_LIVIDO_PLUGIN
|
||||
#define IS_LIVIDO_PLUGIN
|
||||
#endif
|
||||
|
||||
#include "livido.h"
|
||||
LIVIDO_PLUGIN
|
||||
#include "utils.h"
|
||||
#include "livido-utils.c"
|
||||
#include "lvd_common.h"
|
||||
#include "lvdgmicglue.h"
|
||||
|
||||
livido_init_f init_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = lvdgmic_new(1);
|
||||
|
||||
livido_property_set( my_instance, "PLUGIN_private",
|
||||
LIVIDO_ATOM_TYPE_VOIDPTR,1,&gmic );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_deinit_f deinit_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
lvdgmic_delete(gmic);
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_process_f process_instance( livido_port_t *my_instance, double timecode )
|
||||
{
|
||||
uint8_t *A[4] = {NULL,NULL,NULL,NULL};
|
||||
uint8_t *O[4]= {NULL,NULL,NULL,NULL};
|
||||
char cmd[256];
|
||||
int palette;
|
||||
int w;
|
||||
int h;
|
||||
|
||||
int error = lvd_extract_channel_values( my_instance, "out_channels", 0, &w,&h, O,&palette );
|
||||
if( error != LIVIDO_NO_ERROR )
|
||||
return LIVIDO_ERROR_HARDWARE;
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
|
||||
lvd_extract_channel_values( my_instance, "in_channels" , 0, &w, &h, A, &palette );
|
||||
|
||||
int imageweight = lvd_extract_param_index( my_instance,"in_parameters", 0 );
|
||||
int patternweight = lvd_extract_param_index( my_instance,"in_parameters", 1 );
|
||||
int patternangle = lvd_extract_param_index(my_instance, "in_parameters",2);
|
||||
int amplitude = lvd_extract_param_index(my_instance, "in_parameters",3);
|
||||
int sharpness = lvd_extract_param_index(my_instance, "in_parameters",4);
|
||||
int anisotropy = lvd_extract_param_index(my_instance, "in_parameters",5);
|
||||
int alpha = lvd_extract_param_index(my_instance, "in_parameters",6);
|
||||
int sigma = lvd_extract_param_index(my_instance, "in_parameters",7);
|
||||
int cutlow = lvd_extract_param_index(my_instance, "in_parameters",8);
|
||||
int cuthigh = lvd_extract_param_index(my_instance, "in_parameters",9);
|
||||
|
||||
snprintf(cmd,sizeof(cmd),"-gimp_marble %f,%d,%d,%d,%f,%f,%f,%f,%d,%d",
|
||||
(float) imageweight/10.0f, patternweight, patternangle, amplitude,(float)sharpness/100.0f,
|
||||
(float) anisotropy/100.0f, (float) alpha/10.0f, (float) sigma / 10.0f,
|
||||
cutlow, cuthigh
|
||||
);
|
||||
|
||||
lvdgmic_push( gmic, w, h, palette, A, 0);
|
||||
|
||||
lvdgmic_gmic( gmic, cmd );
|
||||
|
||||
lvdgmic_pull( gmic, 0, O );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
livido_port_t *livido_setup(livido_setup_t list[], int version)
|
||||
|
||||
{
|
||||
LIVIDO_IMPORT(list);
|
||||
|
||||
livido_port_t *port = NULL;
|
||||
livido_port_t *in_params[10];
|
||||
livido_port_t *in_chans[3];
|
||||
livido_port_t *out_chans[1];
|
||||
livido_port_t *info = NULL;
|
||||
livido_port_t *filter = NULL;
|
||||
|
||||
//@ setup root node, plugin info
|
||||
info = livido_port_new( LIVIDO_PORT_TYPE_PLUGIN_INFO );
|
||||
port = info;
|
||||
|
||||
livido_set_string_value( port, "maintainer", "Niels");
|
||||
livido_set_string_value( port, "version","1");
|
||||
|
||||
filter = livido_port_new( LIVIDO_PORT_TYPE_FILTER_CLASS );
|
||||
livido_set_int_value( filter, "api_version", LIVIDO_API_VERSION );
|
||||
|
||||
//@ setup function pointers
|
||||
livido_set_voidptr_value( filter, "deinit_func", &deinit_instance );
|
||||
livido_set_voidptr_value( filter, "init_func", &init_instance );
|
||||
livido_set_voidptr_value( filter, "process_func", &process_instance );
|
||||
port = filter;
|
||||
|
||||
//@ meta information
|
||||
livido_set_string_value( port, "name", "G'MIC/GREYs Marble");
|
||||
livido_set_string_value( port, "description", "Apply Marble");
|
||||
livido_set_string_value( port, "author", "GREYC's Magic for Image Computing");
|
||||
|
||||
livido_set_int_value( port, "flags", LIVIDO_FILTER_NON_REALTIME);
|
||||
livido_set_string_value( port, "license", "GPL2");
|
||||
livido_set_int_value( port, "version", 1);
|
||||
|
||||
//@ some palettes veejay-classic uses
|
||||
int palettes0[] = {
|
||||
LIVIDO_PALETTE_YUV422P,
|
||||
0,
|
||||
};
|
||||
|
||||
//@ setup output channel
|
||||
out_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = out_chans[0];
|
||||
|
||||
livido_set_string_value( port, "name", "Output Channel");
|
||||
livido_set_int_array( port, "palette_list", 3, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = in_chans[0];
|
||||
livido_set_string_value( port, "name", "Input Channel");
|
||||
livido_set_int_array( port, "palette_list", 4, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_params[0] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[0];
|
||||
|
||||
livido_set_string_value(port, "name", "Image weight" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 300 );
|
||||
livido_set_int_value( port, "default", 5 );
|
||||
livido_set_string_value( port, "description" ,"Image weight");
|
||||
|
||||
|
||||
in_params[1] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[1];
|
||||
|
||||
livido_set_string_value(port, "name", "Pattern weight" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 30 );
|
||||
livido_set_int_value( port, "default", 1 );
|
||||
livido_set_string_value( port, "description" ,"Pattern weight");
|
||||
|
||||
in_params[2] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[2];
|
||||
|
||||
livido_set_string_value(port, "name", "Pattern angle" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 360 );
|
||||
livido_set_int_value( port, "default", 0 );
|
||||
livido_set_string_value( port, "description" ,"Pattern angle");
|
||||
|
||||
in_params[3] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[3];
|
||||
|
||||
livido_set_string_value(port, "name", "Amplitude" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 1000 );
|
||||
livido_set_int_value( port, "default",0 );
|
||||
livido_set_string_value( port, "description" ,"Amplitude");
|
||||
|
||||
in_params[4] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[4];
|
||||
|
||||
livido_set_string_value(port, "name", "Sharpness" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 500 );
|
||||
livido_set_int_value( port, "default",40 );
|
||||
livido_set_string_value( port, "description" ,"Sharpness");
|
||||
|
||||
in_params[5] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[5];
|
||||
|
||||
livido_set_string_value(port, "name", "Anisotropy" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 100 );
|
||||
livido_set_int_value( port, "default",60 );
|
||||
livido_set_string_value( port, "description" ,"Anisotropy");
|
||||
|
||||
|
||||
in_params[6] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[6];
|
||||
|
||||
livido_set_string_value(port, "name", "Alpha" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 200 );
|
||||
livido_set_int_value( port, "default",60 );
|
||||
livido_set_string_value( port, "description" ,"Alpha");
|
||||
|
||||
|
||||
|
||||
in_params[7] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[7];
|
||||
|
||||
livido_set_string_value(port, "name", "Sigma" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 200 );
|
||||
livido_set_int_value( port, "default",6 );
|
||||
livido_set_string_value( port, "description" ,"Sigma");
|
||||
|
||||
|
||||
in_params[8] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[8];
|
||||
|
||||
livido_set_string_value(port, "name", "Cut low" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 100 );
|
||||
livido_set_int_value( port, "default",0 );
|
||||
livido_set_string_value( port, "description" ,"Cut low");
|
||||
|
||||
|
||||
|
||||
in_params[9] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[9];
|
||||
|
||||
livido_set_string_value(port, "name", "Cut high" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max",100 );
|
||||
livido_set_int_value( port, "default",100 );
|
||||
livido_set_string_value( port, "description" ,"Cut high");
|
||||
|
||||
|
||||
//@ setup the nodes
|
||||
livido_set_portptr_array( filter, "in_parameter_templates",10, in_params );
|
||||
livido_set_portptr_array( filter, "out_channel_templates", 1, out_chans );
|
||||
livido_set_portptr_array( filter, "in_channel_templates",1, in_chans );
|
||||
|
||||
livido_set_portptr_value(info, "filters", filter);
|
||||
return info;
|
||||
}
|
||||
146
veejay-current/plugin-packs/lvdgmic/plugins/gmic_noisehurl.c
Normal file
146
veejay-current/plugin-packs/lvdgmic/plugins/gmic_noisehurl.c
Normal file
@@ -0,0 +1,146 @@
|
||||
/*
|
||||
* LIBVJE - veejay fx library
|
||||
*
|
||||
* Copyright(C)2015 Niels Elburg <nwelburg@gmail.com>
|
||||
* See COPYING for software license and distribution details
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef IS_LIVIDO_PLUGIN
|
||||
#define IS_LIVIDO_PLUGIN
|
||||
#endif
|
||||
|
||||
#include "livido.h"
|
||||
LIVIDO_PLUGIN
|
||||
#include "utils.h"
|
||||
#include "livido-utils.c"
|
||||
#include "lvd_common.h"
|
||||
#include "lvdgmicglue.h"
|
||||
|
||||
livido_init_f init_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = lvdgmic_new(1);
|
||||
|
||||
livido_property_set( my_instance, "PLUGIN_private",
|
||||
LIVIDO_ATOM_TYPE_VOIDPTR,1,&gmic );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_deinit_f deinit_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
lvdgmic_delete(gmic);
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_process_f process_instance( livido_port_t *my_instance, double timecode )
|
||||
{
|
||||
uint8_t *A[4] = {NULL,NULL,NULL,NULL};
|
||||
uint8_t *O[4]= {NULL,NULL,NULL,NULL};
|
||||
char cmd[256];
|
||||
int palette;
|
||||
int w;
|
||||
int h;
|
||||
|
||||
int error = lvd_extract_channel_values( my_instance, "out_channels", 0, &w,&h, O,&palette );
|
||||
if( error != LIVIDO_NO_ERROR )
|
||||
return LIVIDO_ERROR_HARDWARE;
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
|
||||
lvd_extract_channel_values( my_instance, "in_channels" , 0, &w, &h, A, &palette );
|
||||
|
||||
int amplitude = lvd_extract_param_index( my_instance,"in_parameters", 0 );
|
||||
|
||||
snprintf(cmd,sizeof(cmd),"-noise_hurl %d", amplitude );
|
||||
|
||||
lvdgmic_push( gmic, w, h, 0, A, 0);
|
||||
|
||||
lvdgmic_gmic( gmic, cmd );
|
||||
|
||||
lvdgmic_pull( gmic, 0, O );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
livido_port_t *livido_setup(livido_setup_t list[], int version)
|
||||
|
||||
{
|
||||
LIVIDO_IMPORT(list);
|
||||
|
||||
livido_port_t *port = NULL;
|
||||
livido_port_t *in_params[1];
|
||||
livido_port_t *in_chans[3];
|
||||
livido_port_t *out_chans[1];
|
||||
livido_port_t *info = NULL;
|
||||
livido_port_t *filter = NULL;
|
||||
|
||||
//@ setup root node, plugin info
|
||||
info = livido_port_new( LIVIDO_PORT_TYPE_PLUGIN_INFO );
|
||||
port = info;
|
||||
|
||||
livido_set_string_value( port, "maintainer", "Niels");
|
||||
livido_set_string_value( port, "version","1");
|
||||
|
||||
filter = livido_port_new( LIVIDO_PORT_TYPE_FILTER_CLASS );
|
||||
livido_set_int_value( filter, "api_version", LIVIDO_API_VERSION );
|
||||
|
||||
//@ setup function pointers
|
||||
livido_set_voidptr_value( filter, "deinit_func", &deinit_instance );
|
||||
livido_set_voidptr_value( filter, "init_func", &init_instance );
|
||||
livido_set_voidptr_value( filter, "process_func", &process_instance );
|
||||
port = filter;
|
||||
|
||||
//@ meta information
|
||||
livido_set_string_value( port, "name", "G'MIC/GREYs Noise Hurl");
|
||||
livido_set_string_value( port, "description", "Apply hurl noise on image");
|
||||
livido_set_string_value( port, "author", "GREYC's Magic for Image Computing");
|
||||
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
livido_set_string_value( port, "license", "GPL2");
|
||||
livido_set_int_value( port, "version", 1);
|
||||
|
||||
//@ some palettes veejay-classic uses
|
||||
int palettes0[] = {
|
||||
LIVIDO_PALETTE_YUV422P,
|
||||
0,
|
||||
};
|
||||
|
||||
//@ setup output channel
|
||||
out_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = out_chans[0];
|
||||
|
||||
livido_set_string_value( port, "name", "Output Channel");
|
||||
livido_set_int_array( port, "palette_list", 3, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = in_chans[0];
|
||||
livido_set_string_value( port, "name", "Input Channel");
|
||||
livido_set_int_array( port, "palette_list", 4, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
|
||||
in_params[0] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[0];
|
||||
|
||||
livido_set_string_value(port, "name", "Amplitude" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 400 );
|
||||
livido_set_int_value( port, "default", 5 );
|
||||
livido_set_string_value( port, "description" ,"Amplitude");
|
||||
|
||||
//@ setup the nodes
|
||||
livido_set_portptr_array( filter, "in_parameter_templates",1, in_params );
|
||||
livido_set_portptr_array( filter, "out_channel_templates", 1, out_chans );
|
||||
livido_set_portptr_array( filter, "in_channel_templates",1, in_chans );
|
||||
|
||||
livido_set_portptr_value(info, "filters", filter);
|
||||
return info;
|
||||
}
|
||||
167
veejay-current/plugin-packs/lvdgmic/plugins/gmic_oldscool8bits.c
Normal file
167
veejay-current/plugin-packs/lvdgmic/plugins/gmic_oldscool8bits.c
Normal file
@@ -0,0 +1,167 @@
|
||||
/*
|
||||
* LIBVJE - veejay fx library
|
||||
*
|
||||
* Copyright(C)2015 Niels Elburg <nwelburg@gmail.com>
|
||||
* See COPYING for software license and distribution details
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef IS_LIVIDO_PLUGIN
|
||||
#define IS_LIVIDO_PLUGIN
|
||||
#endif
|
||||
|
||||
#include "livido.h"
|
||||
LIVIDO_PLUGIN
|
||||
#include "utils.h"
|
||||
#include "livido-utils.c"
|
||||
#include "lvd_common.h"
|
||||
#include "lvdgmicglue.h"
|
||||
|
||||
livido_init_f init_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = lvdgmic_new(1);
|
||||
|
||||
livido_property_set( my_instance, "PLUGIN_private",
|
||||
LIVIDO_ATOM_TYPE_VOIDPTR,1,&gmic );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_deinit_f deinit_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
lvdgmic_delete(gmic);
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_process_f process_instance( livido_port_t *my_instance, double timecode )
|
||||
{
|
||||
uint8_t *A[4] = {NULL,NULL,NULL,NULL};
|
||||
uint8_t *O[4]= {NULL,NULL,NULL,NULL};
|
||||
char cmd[256];
|
||||
int palette;
|
||||
int w;
|
||||
int h;
|
||||
|
||||
int error = lvd_extract_channel_values( my_instance, "out_channels", 0, &w,&h, O,&palette );
|
||||
if( error != LIVIDO_NO_ERROR )
|
||||
return LIVIDO_ERROR_HARDWARE;
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
|
||||
lvd_extract_channel_values( my_instance, "in_channels" , 0, &w, &h, A, &palette );
|
||||
|
||||
int scale = lvd_extract_param_index( my_instance,"in_parameters", 0 );
|
||||
int dithering = lvd_extract_param_index( my_instance,"in_parameters", 1 );
|
||||
int levels = lvd_extract_param_index(my_instance, "in_parameters",2);
|
||||
|
||||
snprintf(cmd,sizeof(cmd),"-gimp_8bits %d,%d,%d", scale, dithering, levels );
|
||||
|
||||
lvdgmic_push( gmic, w, h, palette, A, 0);
|
||||
|
||||
lvdgmic_gmic( gmic, cmd );
|
||||
|
||||
lvdgmic_pull( gmic, 0, O );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
livido_port_t *livido_setup(livido_setup_t list[], int version)
|
||||
|
||||
{
|
||||
LIVIDO_IMPORT(list);
|
||||
|
||||
livido_port_t *port = NULL;
|
||||
livido_port_t *in_params[5];
|
||||
livido_port_t *in_chans[3];
|
||||
livido_port_t *out_chans[1];
|
||||
livido_port_t *info = NULL;
|
||||
livido_port_t *filter = NULL;
|
||||
|
||||
//@ setup root node, plugin info
|
||||
info = livido_port_new( LIVIDO_PORT_TYPE_PLUGIN_INFO );
|
||||
port = info;
|
||||
|
||||
livido_set_string_value( port, "maintainer", "Niels");
|
||||
livido_set_string_value( port, "version","1");
|
||||
|
||||
filter = livido_port_new( LIVIDO_PORT_TYPE_FILTER_CLASS );
|
||||
livido_set_int_value( filter, "api_version", LIVIDO_API_VERSION );
|
||||
|
||||
//@ setup function pointers
|
||||
livido_set_voidptr_value( filter, "deinit_func", &deinit_instance );
|
||||
livido_set_voidptr_value( filter, "init_func", &init_instance );
|
||||
livido_set_voidptr_value( filter, "process_func", &process_instance );
|
||||
port = filter;
|
||||
|
||||
//@ meta information
|
||||
livido_set_string_value( port, "name", "G'MIC/GREYs Oldschool 8bits");
|
||||
livido_set_string_value( port, "description", "Apply oldschool 8bits effect on image");
|
||||
livido_set_string_value( port, "author", "GREYC's Magic for Image Computing");
|
||||
|
||||
livido_set_int_value( port, "flags", LIVIDO_FILTER_NON_REALTIME);
|
||||
livido_set_string_value( port, "license", "GPL2");
|
||||
livido_set_int_value( port, "version", 1);
|
||||
|
||||
//@ some palettes veejay-classic uses
|
||||
int palettes0[] = {
|
||||
LIVIDO_PALETTE_YUV422P,
|
||||
0,
|
||||
};
|
||||
|
||||
//@ setup output channel
|
||||
out_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = out_chans[0];
|
||||
|
||||
livido_set_string_value( port, "name", "Output Channel");
|
||||
livido_set_int_array( port, "palette_list", 3, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = in_chans[0];
|
||||
livido_set_string_value( port, "name", "Input Channel");
|
||||
livido_set_int_array( port, "palette_list", 4, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_params[0] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[0];
|
||||
|
||||
livido_set_string_value(port, "name", "Scale" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 1 );
|
||||
livido_set_int_value( port, "max", 100 );
|
||||
livido_set_int_value( port, "default", 25 );
|
||||
livido_set_string_value( port, "description" ,"Scale");
|
||||
|
||||
|
||||
in_params[1] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[1];
|
||||
|
||||
livido_set_string_value(port, "name", "Dithering" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 10000 );
|
||||
livido_set_int_value( port, "default", 800 );
|
||||
livido_set_string_value( port, "description" ,"Dithering");
|
||||
|
||||
in_params[2] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[2];
|
||||
|
||||
livido_set_string_value(port, "name", "Levels" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 2 );
|
||||
livido_set_int_value( port, "max", 256 );
|
||||
livido_set_int_value( port, "default", 16 );
|
||||
livido_set_string_value( port, "description" ,"Levels");
|
||||
|
||||
livido_set_portptr_array( filter, "in_parameter_templates",3, in_params );
|
||||
livido_set_portptr_array( filter, "out_channel_templates",1, out_chans );
|
||||
livido_set_portptr_array( filter, "in_channel_templates",1, in_chans );
|
||||
|
||||
livido_set_portptr_value(info, "filters", filter);
|
||||
return info;
|
||||
}
|
||||
157
veejay-current/plugin-packs/lvdgmic/plugins/gmic_pencilbw.c
Normal file
157
veejay-current/plugin-packs/lvdgmic/plugins/gmic_pencilbw.c
Normal file
@@ -0,0 +1,157 @@
|
||||
/*
|
||||
* LIBVJE - veejay fx library
|
||||
*
|
||||
* Copyright(C)2015 Niels Elburg <nwelburg@gmail.com>
|
||||
* See COPYING for software license and distribution details
|
||||
*/
|
||||
|
||||
#ifndef IS_LIVIDO_PLUGIN
|
||||
#define IS_LIVIDO_PLUGIN
|
||||
#endif
|
||||
|
||||
#include "livido.h"
|
||||
LIVIDO_PLUGIN
|
||||
#include "utils.h"
|
||||
#include "livido-utils.c"
|
||||
#include "lvd_common.h"
|
||||
#include "lvdgmicglue.h"
|
||||
|
||||
livido_init_f init_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = lvdgmic_new(1);
|
||||
|
||||
livido_property_set( my_instance, "PLUGIN_private",
|
||||
LIVIDO_ATOM_TYPE_VOIDPTR,1,&gmic );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_deinit_f deinit_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
lvdgmic_delete(gmic);
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_process_f process_instance( livido_port_t *my_instance, double timecode )
|
||||
{
|
||||
uint8_t *A[4] = {NULL,NULL,NULL,NULL};
|
||||
uint8_t *O[4]= {NULL,NULL,NULL,NULL};
|
||||
char cmd[256];
|
||||
int palette;
|
||||
int w;
|
||||
int h;
|
||||
|
||||
int error = lvd_extract_channel_values( my_instance, "out_channels", 0, &w,&h, O,&palette );
|
||||
if( error != LIVIDO_NO_ERROR )
|
||||
return LIVIDO_ERROR_HARDWARE;
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
|
||||
lvd_extract_channel_values( my_instance, "in_channels" , 0, &w, &h, A, &palette );
|
||||
|
||||
int size = lvd_extract_param_index( my_instance,"in_parameters", 0 );
|
||||
int amplitude = lvd_extract_param_index( my_instance,"in_parameters", 1 );
|
||||
|
||||
snprintf(cmd,sizeof(cmd),"-pencilbw %f,%d", (float)size/100.0f,amplitude);
|
||||
|
||||
lvdgmic_push( gmic, w, h, 0, A, 0);
|
||||
|
||||
lvdgmic_gmic( gmic, cmd );
|
||||
|
||||
lvdgmic_pull( gmic, 0, O );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
livido_port_t *livido_setup(livido_setup_t list[], int version)
|
||||
|
||||
{
|
||||
LIVIDO_IMPORT(list);
|
||||
|
||||
livido_port_t *port = NULL;
|
||||
livido_port_t *in_params[2];
|
||||
livido_port_t *in_chans[3];
|
||||
livido_port_t *out_chans[1];
|
||||
livido_port_t *info = NULL;
|
||||
livido_port_t *filter = NULL;
|
||||
|
||||
//@ setup root node, plugin info
|
||||
info = livido_port_new( LIVIDO_PORT_TYPE_PLUGIN_INFO );
|
||||
port = info;
|
||||
|
||||
livido_set_string_value( port, "maintainer", "Niels");
|
||||
livido_set_string_value( port, "version","1");
|
||||
|
||||
filter = livido_port_new( LIVIDO_PORT_TYPE_FILTER_CLASS );
|
||||
livido_set_int_value( filter, "api_version", LIVIDO_API_VERSION );
|
||||
|
||||
//@ setup function pointers
|
||||
livido_set_voidptr_value( filter, "deinit_func", &deinit_instance );
|
||||
livido_set_voidptr_value( filter, "init_func", &init_instance );
|
||||
livido_set_voidptr_value( filter, "process_func", &process_instance );
|
||||
port = filter;
|
||||
|
||||
//@ meta information
|
||||
livido_set_string_value( port, "name", "G'MIC/GREYs Pencil");
|
||||
livido_set_string_value( port, "description", "Apply B&W pencil effect on image");
|
||||
livido_set_string_value( port, "author", "GREYC's Magic for Image Computing");
|
||||
|
||||
livido_set_int_value( port, "flags", LIVIDO_FILTER_NON_REALTIME);
|
||||
livido_set_string_value( port, "license", "GPL2");
|
||||
livido_set_int_value( port, "version", 1);
|
||||
|
||||
//@ some palettes veejay-classic uses
|
||||
int palettes0[] = {
|
||||
LIVIDO_PALETTE_YUV422P,
|
||||
0,
|
||||
};
|
||||
|
||||
//@ setup output channel
|
||||
out_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = out_chans[0];
|
||||
|
||||
livido_set_string_value( port, "name", "Output Channel");
|
||||
livido_set_int_array( port, "palette_list", 3, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = in_chans[0];
|
||||
livido_set_string_value( port, "name", "Input Channel");
|
||||
livido_set_int_array( port, "palette_list", 4, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_params[0] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[0];
|
||||
|
||||
livido_set_string_value(port, "name", "Size" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 500 );
|
||||
livido_set_int_value( port, "default", 30 );
|
||||
livido_set_string_value( port, "description" ,"Size");
|
||||
|
||||
|
||||
in_params[1] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[1];
|
||||
|
||||
livido_set_string_value(port, "name", "Amplitude" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 200 );
|
||||
livido_set_int_value( port, "default", 60 );
|
||||
livido_set_string_value( port, "description" ,"Amplitude");
|
||||
|
||||
|
||||
//@ setup the nodes
|
||||
livido_set_portptr_array( filter, "in_parameter_templates",2, in_params );
|
||||
livido_set_portptr_array( filter, "out_channel_templates", 1, out_chans );
|
||||
livido_set_portptr_array( filter, "in_channel_templates",1, in_chans );
|
||||
|
||||
livido_set_portptr_value(info, "filters", filter);
|
||||
return info;
|
||||
}
|
||||
144
veejay-current/plugin-packs/lvdgmic/plugins/gmic_pendrawing.c
Normal file
144
veejay-current/plugin-packs/lvdgmic/plugins/gmic_pendrawing.c
Normal file
@@ -0,0 +1,144 @@
|
||||
/*
|
||||
* LIBVJE - veejay fx library
|
||||
*
|
||||
* Copyright(C)2015 Niels Elburg <nwelburg@gmail.com>
|
||||
* See COPYING for software license and distribution details
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef IS_LIVIDO_PLUGIN
|
||||
#define IS_LIVIDO_PLUGIN
|
||||
#endif
|
||||
|
||||
#include "livido.h"
|
||||
LIVIDO_PLUGIN
|
||||
#include "utils.h"
|
||||
#include "livido-utils.c"
|
||||
#include "lvd_common.h"
|
||||
#include "lvdgmicglue.h"
|
||||
|
||||
livido_init_f init_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = lvdgmic_new(1);
|
||||
|
||||
livido_property_set( my_instance, "PLUGIN_private",
|
||||
LIVIDO_ATOM_TYPE_VOIDPTR,1,&gmic );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_deinit_f deinit_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
lvdgmic_delete(gmic);
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_process_f process_instance( livido_port_t *my_instance, double timecode )
|
||||
{
|
||||
uint8_t *A[4] = {NULL,NULL,NULL,NULL};
|
||||
uint8_t *O[4]= {NULL,NULL,NULL,NULL};
|
||||
char cmd[256];
|
||||
int palette;
|
||||
int w;
|
||||
int h;
|
||||
|
||||
int error = lvd_extract_channel_values( my_instance, "out_channels", 0, &w,&h, O,&palette );
|
||||
if( error != LIVIDO_NO_ERROR )
|
||||
return LIVIDO_ERROR_HARDWARE;
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
|
||||
lvd_extract_channel_values( my_instance, "in_channels" , 0, &w, &h, A, &palette );
|
||||
|
||||
int amplitude = lvd_extract_param_index( my_instance,"in_parameters", 0 );
|
||||
|
||||
snprintf(cmd,sizeof(cmd),"-drawing %d",amplitude );
|
||||
|
||||
lvdgmic_push( gmic, w, h, palette, A, 0);
|
||||
|
||||
lvdgmic_gmic( gmic, cmd );
|
||||
|
||||
lvdgmic_pull( gmic, 0, O );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
livido_port_t *livido_setup(livido_setup_t list[], int version)
|
||||
|
||||
{
|
||||
LIVIDO_IMPORT(list);
|
||||
|
||||
livido_port_t *port = NULL;
|
||||
livido_port_t *in_params[1];
|
||||
livido_port_t *in_chans[3];
|
||||
livido_port_t *out_chans[1];
|
||||
livido_port_t *info = NULL;
|
||||
livido_port_t *filter = NULL;
|
||||
|
||||
//@ setup root node, plugin info
|
||||
info = livido_port_new( LIVIDO_PORT_TYPE_PLUGIN_INFO );
|
||||
port = info;
|
||||
|
||||
livido_set_string_value( port, "maintainer", "Niels");
|
||||
livido_set_string_value( port, "version","1");
|
||||
|
||||
filter = livido_port_new( LIVIDO_PORT_TYPE_FILTER_CLASS );
|
||||
livido_set_int_value( filter, "api_version", LIVIDO_API_VERSION );
|
||||
|
||||
//@ setup function pointers
|
||||
livido_set_voidptr_value( filter, "deinit_func", &deinit_instance );
|
||||
livido_set_voidptr_value( filter, "init_func", &init_instance );
|
||||
livido_set_voidptr_value( filter, "process_func", &process_instance );
|
||||
port = filter;
|
||||
|
||||
//@ meta information
|
||||
livido_set_string_value( port, "name", "G'MIC/GREYs Pen drawing");
|
||||
livido_set_string_value( port, "description", "Apply drawing effect on image");
|
||||
livido_set_string_value( port, "author", "GREYC's Magic for Image Computing");
|
||||
|
||||
livido_set_int_value( port, "flags", LIVIDO_FILTER_NON_REALTIME);
|
||||
livido_set_string_value( port, "license", "GPL2");
|
||||
livido_set_int_value( port, "version", 1);
|
||||
|
||||
//@ some palettes veejay-classic uses
|
||||
int palettes0[] = {
|
||||
LIVIDO_PALETTE_YUV422P,
|
||||
0,
|
||||
};
|
||||
|
||||
//@ setup output channel
|
||||
out_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = out_chans[0];
|
||||
|
||||
livido_set_string_value( port, "name", "Output Channel");
|
||||
livido_set_int_array( port, "palette_list", 3, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = in_chans[0];
|
||||
livido_set_string_value( port, "name", "Input Channel");
|
||||
livido_set_int_array( port, "palette_list", 4, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_params[0] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[0];
|
||||
|
||||
livido_set_string_value(port, "name", "Amplitude" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 30 );
|
||||
livido_set_int_value( port, "default", 10 );
|
||||
livido_set_string_value( port, "description" ,"Amplitude");
|
||||
|
||||
livido_set_portptr_array( filter, "in_parameter_templates",1, in_params );
|
||||
livido_set_portptr_array( filter, "out_channel_templates",1, out_chans );
|
||||
livido_set_portptr_array( filter, "in_channel_templates",1, in_chans );
|
||||
|
||||
livido_set_portptr_value(info, "filters", filter);
|
||||
return info;
|
||||
}
|
||||
213
veejay-current/plugin-packs/lvdgmic/plugins/gmic_posteredges.c
Normal file
213
veejay-current/plugin-packs/lvdgmic/plugins/gmic_posteredges.c
Normal file
@@ -0,0 +1,213 @@
|
||||
/*
|
||||
* LIBVJE - veejay fx library
|
||||
*
|
||||
* Copyright(C)2015 Niels Elburg <nwelburg@gmail.com>
|
||||
* See COPYING for software license and distribution details
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef IS_LIVIDO_PLUGIN
|
||||
#define IS_LIVIDO_PLUGIN
|
||||
#endif
|
||||
|
||||
#include "livido.h"
|
||||
LIVIDO_PLUGIN
|
||||
#include "utils.h"
|
||||
#include "livido-utils.c"
|
||||
#include "lvd_common.h"
|
||||
#include "lvdgmicglue.h"
|
||||
|
||||
livido_init_f init_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = lvdgmic_new(1);
|
||||
|
||||
livido_property_set( my_instance, "PLUGIN_private",
|
||||
LIVIDO_ATOM_TYPE_VOIDPTR,1,&gmic );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_deinit_f deinit_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
lvdgmic_delete(gmic);
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_process_f process_instance( livido_port_t *my_instance, double timecode )
|
||||
{
|
||||
uint8_t *A[4] = {NULL,NULL,NULL,NULL};
|
||||
uint8_t *O[4]= {NULL,NULL,NULL,NULL};
|
||||
char cmd[256];
|
||||
int palette;
|
||||
int w;
|
||||
int h;
|
||||
|
||||
int error = lvd_extract_channel_values( my_instance, "out_channels", 0, &w,&h, O,&palette );
|
||||
if( error != LIVIDO_NO_ERROR )
|
||||
return LIVIDO_ERROR_HARDWARE;
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
|
||||
lvd_extract_channel_values( my_instance, "in_channels" , 0, &w, &h, A, &palette );
|
||||
|
||||
int smoothness = lvd_extract_param_index( my_instance,"in_parameters", 0 );
|
||||
int threshold = lvd_extract_param_index( my_instance,"in_parameters", 1 );
|
||||
int shade = lvd_extract_param_index(my_instance, "in_parameters",2);
|
||||
int thickness = lvd_extract_param_index(my_instance, "in_parameters",3);
|
||||
int antialiasing = lvd_extract_param_index(my_instance, "in_parameters",4);
|
||||
int posterization_lvl = lvd_extract_param_index(my_instance, "in_parameters",5);
|
||||
int posterization_aa = lvd_extract_param_index(my_instance, "in_parameters",6);
|
||||
|
||||
snprintf(cmd,sizeof(cmd),"-poster_edges %d,%d,%d,%d,%d,%d,%d",
|
||||
smoothness,threshold,shade,thickness,antialiasing,posterization_lvl,posterization_aa);
|
||||
|
||||
lvdgmic_push( gmic, w, h, palette, A, 0);
|
||||
|
||||
lvdgmic_gmic( gmic, cmd );
|
||||
|
||||
lvdgmic_pull( gmic, 0, O );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
livido_port_t *livido_setup(livido_setup_t list[], int version)
|
||||
|
||||
{
|
||||
LIVIDO_IMPORT(list);
|
||||
|
||||
livido_port_t *port = NULL;
|
||||
livido_port_t *in_params[7];
|
||||
livido_port_t *in_chans[3];
|
||||
livido_port_t *out_chans[1];
|
||||
livido_port_t *info = NULL;
|
||||
livido_port_t *filter = NULL;
|
||||
|
||||
//@ setup root node, plugin info
|
||||
info = livido_port_new( LIVIDO_PORT_TYPE_PLUGIN_INFO );
|
||||
port = info;
|
||||
|
||||
livido_set_string_value( port, "maintainer", "Niels");
|
||||
livido_set_string_value( port, "version","1");
|
||||
|
||||
filter = livido_port_new( LIVIDO_PORT_TYPE_FILTER_CLASS );
|
||||
livido_set_int_value( filter, "api_version", LIVIDO_API_VERSION );
|
||||
|
||||
//@ setup function pointers
|
||||
livido_set_voidptr_value( filter, "deinit_func", &deinit_instance );
|
||||
livido_set_voidptr_value( filter, "init_func", &init_instance );
|
||||
livido_set_voidptr_value( filter, "process_func", &process_instance );
|
||||
port = filter;
|
||||
|
||||
//@ meta information
|
||||
livido_set_string_value( port, "name", "G'MIC/GREYs Poster Edges");
|
||||
livido_set_string_value( port, "description", "Apply poster edges effect on image");
|
||||
livido_set_string_value( port, "author", "GREYC's Magic for Image Computing");
|
||||
|
||||
livido_set_int_value( port, "flags", LIVIDO_FILTER_NON_REALTIME);
|
||||
livido_set_string_value( port, "license", "GPL2");
|
||||
livido_set_int_value( port, "version", 1);
|
||||
|
||||
//@ some palettes veejay-classic uses
|
||||
int palettes0[] = {
|
||||
LIVIDO_PALETTE_YUV422P,
|
||||
0,
|
||||
};
|
||||
|
||||
//@ setup output channel
|
||||
out_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = out_chans[0];
|
||||
|
||||
livido_set_string_value( port, "name", "Output Channel");
|
||||
livido_set_int_array( port, "palette_list", 3, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = in_chans[0];
|
||||
livido_set_string_value( port, "name", "Input Channel");
|
||||
livido_set_int_array( port, "palette_list", 4, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_params[0] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[0];
|
||||
|
||||
livido_set_string_value(port, "name", "Image smoothness" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 100 );
|
||||
livido_set_int_value( port, "default", 20 );
|
||||
livido_set_string_value( port, "description" ,"Image smoothness");
|
||||
|
||||
|
||||
in_params[1] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[1];
|
||||
|
||||
livido_set_string_value(port, "name", "Edge threshold" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 100 );
|
||||
livido_set_int_value( port, "default", 60 );
|
||||
livido_set_string_value( port, "description" ,"Edge threshold");
|
||||
|
||||
in_params[2] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[2];
|
||||
|
||||
livido_set_string_value(port, "name", "Edge shade" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 30 );
|
||||
livido_set_int_value( port, "default", 10 );
|
||||
livido_set_string_value( port, "description" ,"Edge shade");
|
||||
|
||||
in_params[3] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[3];
|
||||
|
||||
livido_set_string_value(port, "name", "Edge thickness" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 10 );
|
||||
livido_set_int_value( port, "default",5 );
|
||||
livido_set_string_value( port, "description" ,"Edge thickness");
|
||||
|
||||
in_params[4] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[4];
|
||||
|
||||
livido_set_string_value(port, "name", "Edge antialiasing" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 100 );
|
||||
livido_set_int_value( port, "default",10 );
|
||||
livido_set_string_value( port, "description" ,"Edge antialiasing");
|
||||
|
||||
in_params[5] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[5];
|
||||
|
||||
livido_set_string_value(port, "name", "Posterization level" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 15 );
|
||||
livido_set_int_value( port, "default",0 );
|
||||
livido_set_string_value( port, "description" ,"Posterization level");
|
||||
|
||||
|
||||
in_params[6] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[6];
|
||||
|
||||
livido_set_string_value(port, "name", "Posterization antialiasing" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 100 );
|
||||
livido_set_int_value( port, "default",0 );
|
||||
livido_set_string_value( port, "description" ,"Posterization antialiasing");
|
||||
|
||||
livido_set_portptr_array( filter, "in_parameter_templates",7, in_params );
|
||||
livido_set_portptr_array( filter, "out_channel_templates",1, out_chans );
|
||||
livido_set_portptr_array( filter, "in_channel_templates",1, in_chans );
|
||||
|
||||
livido_set_portptr_value(info, "filters", filter);
|
||||
return info;
|
||||
}
|
||||
156
veejay-current/plugin-packs/lvdgmic/plugins/gmic_posterhope.c
Normal file
156
veejay-current/plugin-packs/lvdgmic/plugins/gmic_posterhope.c
Normal file
@@ -0,0 +1,156 @@
|
||||
/*
|
||||
* LIBVJE - veejay fx library
|
||||
*
|
||||
* Copyright(C)2015 Niels Elburg <nwelburg@gmail.com>
|
||||
* See COPYING for software license and distribution details
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef IS_LIVIDO_PLUGIN
|
||||
#define IS_LIVIDO_PLUGIN
|
||||
#endif
|
||||
|
||||
#include "livido.h"
|
||||
LIVIDO_PLUGIN
|
||||
#include "utils.h"
|
||||
#include "livido-utils.c"
|
||||
#include "lvd_common.h"
|
||||
#include "lvdgmicglue.h"
|
||||
|
||||
livido_init_f init_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = lvdgmic_new(1);
|
||||
|
||||
livido_property_set( my_instance, "PLUGIN_private",
|
||||
LIVIDO_ATOM_TYPE_VOIDPTR,1,&gmic );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_deinit_f deinit_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
lvdgmic_delete(gmic);
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_process_f process_instance( livido_port_t *my_instance, double timecode )
|
||||
{
|
||||
uint8_t *A[4] = {NULL,NULL,NULL,NULL};
|
||||
uint8_t *O[4]= {NULL,NULL,NULL,NULL};
|
||||
char cmd[256];
|
||||
int palette;
|
||||
int w;
|
||||
int h;
|
||||
|
||||
int error = lvd_extract_channel_values( my_instance, "out_channels", 0, &w,&h, O,&palette );
|
||||
if( error != LIVIDO_NO_ERROR )
|
||||
return LIVIDO_ERROR_HARDWARE;
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
|
||||
lvd_extract_channel_values( my_instance, "in_channels" , 0, &w, &h, A, &palette );
|
||||
|
||||
int gamma = lvd_extract_param_index( my_instance,"in_parameters", 0 );
|
||||
int smoothness = lvd_extract_param_index( my_instance,"in_parameters", 1 );
|
||||
|
||||
snprintf(cmd,sizeof(cmd),"-poster_hope %f,%d", (float) gamma/100.0f, smoothness );
|
||||
|
||||
lvdgmic_push( gmic, w, h, palette, A, 0);
|
||||
|
||||
lvdgmic_gmic( gmic, cmd );
|
||||
|
||||
lvdgmic_pull( gmic, 0, O );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
livido_port_t *livido_setup(livido_setup_t list[], int version)
|
||||
|
||||
{
|
||||
LIVIDO_IMPORT(list);
|
||||
|
||||
livido_port_t *port = NULL;
|
||||
livido_port_t *in_params[2];
|
||||
livido_port_t *in_chans[3];
|
||||
livido_port_t *out_chans[1];
|
||||
livido_port_t *info = NULL;
|
||||
livido_port_t *filter = NULL;
|
||||
|
||||
//@ setup root node, plugin info
|
||||
info = livido_port_new( LIVIDO_PORT_TYPE_PLUGIN_INFO );
|
||||
port = info;
|
||||
|
||||
livido_set_string_value( port, "maintainer", "Niels");
|
||||
livido_set_string_value( port, "version","1");
|
||||
|
||||
filter = livido_port_new( LIVIDO_PORT_TYPE_FILTER_CLASS );
|
||||
livido_set_int_value( filter, "api_version", LIVIDO_API_VERSION );
|
||||
|
||||
//@ setup function pointers
|
||||
livido_set_voidptr_value( filter, "deinit_func", &deinit_instance );
|
||||
livido_set_voidptr_value( filter, "init_func", &init_instance );
|
||||
livido_set_voidptr_value( filter, "process_func", &process_instance );
|
||||
port = filter;
|
||||
|
||||
//@ meta information
|
||||
livido_set_string_value( port, "name", "G'MIC/GREYs Poster Hope");
|
||||
livido_set_string_value( port, "description", "Apply poster hope effect on image");
|
||||
livido_set_string_value( port, "author", "GREYC's Magic for Image Computing");
|
||||
|
||||
livido_set_int_value( port, "flags", LIVIDO_FILTER_NON_REALTIME);
|
||||
livido_set_string_value( port, "license", "GPL2");
|
||||
livido_set_int_value( port, "version", 1);
|
||||
|
||||
//@ some palettes veejay-classic uses
|
||||
int palettes0[] = {
|
||||
LIVIDO_PALETTE_YUV422P,
|
||||
0,
|
||||
};
|
||||
|
||||
//@ setup output channel
|
||||
out_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = out_chans[0];
|
||||
|
||||
livido_set_string_value( port, "name", "Output Channel");
|
||||
livido_set_int_array( port, "palette_list", 3, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = in_chans[0];
|
||||
livido_set_string_value( port, "name", "Input Channel");
|
||||
livido_set_int_array( port, "palette_list", 4, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_params[0] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[0];
|
||||
|
||||
livido_set_string_value(port, "name", "Gamma" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", -300 );
|
||||
livido_set_int_value( port, "max", 300 );
|
||||
livido_set_int_value( port, "default", 0 );
|
||||
livido_set_string_value( port, "description" ,"Gamma");
|
||||
|
||||
|
||||
in_params[1] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[1];
|
||||
|
||||
livido_set_string_value(port, "name", "Smoothness" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 20 );
|
||||
livido_set_int_value( port, "default", 3 );
|
||||
livido_set_string_value( port, "description" ,"Smoothness");
|
||||
|
||||
livido_set_portptr_array( filter, "in_parameter_templates",2, in_params );
|
||||
livido_set_portptr_array( filter, "out_channel_templates",1, out_chans );
|
||||
livido_set_portptr_array( filter, "in_channel_templates",1, in_chans );
|
||||
|
||||
livido_set_portptr_value(info, "filters", filter);
|
||||
return info;
|
||||
}
|
||||
219
veejay-current/plugin-packs/lvdgmic/plugins/gmic_rodilius.c
Normal file
219
veejay-current/plugin-packs/lvdgmic/plugins/gmic_rodilius.c
Normal file
@@ -0,0 +1,219 @@
|
||||
/*
|
||||
* LIBVJE - veejay fx library
|
||||
*
|
||||
* Copyright(C)2015 Niels Elburg <nwelburg@gmail.com>
|
||||
* See COPYING for software license and distribution details
|
||||
*/
|
||||
|
||||
#ifndef IS_LIVIDO_PLUGIN
|
||||
#define IS_LIVIDO_PLUGIN
|
||||
#endif
|
||||
|
||||
#include "livido.h"
|
||||
LIVIDO_PLUGIN
|
||||
#include "utils.h"
|
||||
#include "livido-utils.c"
|
||||
#include "lvd_common.h"
|
||||
#include "lvdgmicglue.h"
|
||||
|
||||
livido_init_f init_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = lvdgmic_new(1);
|
||||
|
||||
livido_property_set( my_instance, "PLUGIN_private",
|
||||
LIVIDO_ATOM_TYPE_VOIDPTR,1,&gmic );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_deinit_f deinit_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
lvdgmic_delete(gmic);
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_process_f process_instance( livido_port_t *my_instance, double timecode )
|
||||
{
|
||||
uint8_t *A[4] = {NULL,NULL,NULL,NULL};
|
||||
uint8_t *O[4]= {NULL,NULL,NULL,NULL};
|
||||
char cmd[256];
|
||||
int palette;
|
||||
int w;
|
||||
int h;
|
||||
|
||||
int error = lvd_extract_channel_values( my_instance, "out_channels", 0, &w,&h, O,&palette );
|
||||
if( error != LIVIDO_NO_ERROR )
|
||||
return LIVIDO_ERROR_HARDWARE;
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
|
||||
lvd_extract_channel_values( my_instance, "in_channels" , 0, &w, &h, A, &palette );
|
||||
|
||||
int amplitude = lvd_extract_param_index( my_instance,"in_parameters", 0 );
|
||||
int thickness = lvd_extract_param_index( my_instance,"in_parameters", 1 );
|
||||
int sharpness = lvd_extract_param_index( my_instance,"in_parameters", 2 );
|
||||
int nb_orientations = lvd_extract_param_index( my_instance,"in_parameters", 3 );
|
||||
int offset = lvd_extract_param_index( my_instance,"in_parameters", 4 );
|
||||
int smoothness = lvd_extract_param_index( my_instance, "in_parameters", 5 );
|
||||
int color_mode = lvd_extract_param_index( my_instance,"in_parameters", 6 );
|
||||
|
||||
snprintf(cmd,sizeof(cmd),"-rodilius %d,%d,%d,%d,%d,%d,%d",
|
||||
amplitude,thickness,sharpness,nb_orientations,offset,smoothness,color_mode);
|
||||
|
||||
lvdgmic_push( gmic, w, h, 0, A, 0);
|
||||
|
||||
lvdgmic_gmic( gmic, cmd );
|
||||
|
||||
lvdgmic_pull( gmic, 0, O );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
livido_port_t *livido_setup(livido_setup_t list[], int version)
|
||||
|
||||
{
|
||||
LIVIDO_IMPORT(list);
|
||||
|
||||
livido_port_t *port = NULL;
|
||||
livido_port_t *in_params[8];
|
||||
livido_port_t *in_chans[3];
|
||||
livido_port_t *out_chans[1];
|
||||
livido_port_t *info = NULL;
|
||||
livido_port_t *filter = NULL;
|
||||
|
||||
//@ setup root node, plugin info
|
||||
info = livido_port_new( LIVIDO_PORT_TYPE_PLUGIN_INFO );
|
||||
port = info;
|
||||
|
||||
livido_set_string_value( port, "maintainer", "Niels");
|
||||
livido_set_string_value( port, "version","1");
|
||||
|
||||
filter = livido_port_new( LIVIDO_PORT_TYPE_FILTER_CLASS );
|
||||
livido_set_int_value( filter, "api_version", LIVIDO_API_VERSION );
|
||||
|
||||
//@ setup function pointers
|
||||
livido_set_voidptr_value( filter, "deinit_func", &deinit_instance );
|
||||
livido_set_voidptr_value( filter, "init_func", &init_instance );
|
||||
livido_set_voidptr_value( filter, "process_func", &process_instance );
|
||||
port = filter;
|
||||
|
||||
//@ meta information
|
||||
livido_set_string_value( port, "name", "G'MIC/GREYs Rodilius");
|
||||
livido_set_string_value( port, "description", "Apply rodilius (fractalius-like) filter on selected image");
|
||||
livido_set_string_value( port, "author", "GREYC's Magic for Image Computing");
|
||||
|
||||
livido_set_int_value( port, "flags", LIVIDO_FILTER_NON_REALTIME);
|
||||
livido_set_string_value( port, "license", "GPL2");
|
||||
livido_set_int_value( port, "version", 1);
|
||||
|
||||
//@ some palettes veejay-classic uses
|
||||
int palettes0[] = {
|
||||
LIVIDO_PALETTE_YUV422P,
|
||||
0,
|
||||
};
|
||||
|
||||
//@ setup output channel
|
||||
out_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = out_chans[0];
|
||||
|
||||
livido_set_string_value( port, "name", "Output Channel");
|
||||
livido_set_int_array( port, "palette_list", 3, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = in_chans[0];
|
||||
livido_set_string_value( port, "name", "Input Channel");
|
||||
livido_set_int_array( port, "palette_list", 4, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
//@ setup parameters (INDEX type, 0-255)
|
||||
in_params[0] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[0];
|
||||
|
||||
livido_set_string_value(port, "name", "Amplitude" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 30 );
|
||||
livido_set_int_value( port, "default", 10 );
|
||||
livido_set_string_value( port, "description" ,"Amplitude");
|
||||
|
||||
|
||||
in_params[1] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[1];
|
||||
|
||||
livido_set_string_value(port, "name", "Thickness" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 10 );
|
||||
livido_set_int_value( port, "default", 1 );
|
||||
livido_set_string_value( port, "description" ,"Thickness");
|
||||
|
||||
|
||||
|
||||
in_params[2] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[2];
|
||||
|
||||
livido_set_string_value(port, "name", "Sharpness" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0);
|
||||
livido_set_int_value( port, "max", 1000 );
|
||||
livido_set_int_value( port, "default", 300 );
|
||||
livido_set_string_value( port, "description" ,"Sharpness");
|
||||
|
||||
|
||||
in_params[3] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[3];
|
||||
|
||||
livido_set_string_value(port, "name", "Orientations" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 2);
|
||||
livido_set_int_value( port, "max", 36 );
|
||||
livido_set_int_value( port, "default", 5);
|
||||
livido_set_string_value( port, "description" ,"Orientations");
|
||||
|
||||
|
||||
in_params[4] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[4];
|
||||
|
||||
livido_set_string_value(port, "name", "Offset" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0);
|
||||
livido_set_int_value( port, "max", 180 );
|
||||
livido_set_int_value( port, "default", 30 );
|
||||
livido_set_string_value( port, "description" ,"Offset");
|
||||
|
||||
|
||||
|
||||
in_params[5] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[5];
|
||||
|
||||
livido_set_string_value(port, "name", "Smoothness" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0);
|
||||
livido_set_int_value( port, "max", 5 );
|
||||
livido_set_int_value( port, "default", 0 );
|
||||
livido_set_string_value( port, "description" ,"Smoothness");
|
||||
|
||||
in_params[6] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[6];
|
||||
|
||||
livido_set_string_value(port, "name", "Color Mode" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0);
|
||||
livido_set_int_value( port, "max", 1 );
|
||||
livido_set_int_value( port, "default", 0 );
|
||||
livido_set_string_value( port, "description" ,"Color Mode");
|
||||
|
||||
|
||||
livido_set_portptr_array( filter, "in_parameter_templates",7, in_params );
|
||||
livido_set_portptr_array( filter, "out_channel_templates", 1, out_chans );
|
||||
livido_set_portptr_array( filter, "in_channel_templates",1, in_chans );
|
||||
|
||||
livido_set_portptr_value(info, "filters", filter);
|
||||
return info;
|
||||
}
|
||||
171
veejay-current/plugin-packs/lvdgmic/plugins/gmic_shockwaves.c
Normal file
171
veejay-current/plugin-packs/lvdgmic/plugins/gmic_shockwaves.c
Normal file
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* LIBVJE - veejay fx library
|
||||
*
|
||||
* Copyright(C)2015 Niels Elburg <nwelburg@gmail.com>
|
||||
* See COPYING for software license and distribution details
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef IS_LIVIDO_PLUGIN
|
||||
#define IS_LIVIDO_PLUGIN
|
||||
#endif
|
||||
|
||||
#include "livido.h"
|
||||
LIVIDO_PLUGIN
|
||||
#include "utils.h"
|
||||
#include "livido-utils.c"
|
||||
#include "lvd_common.h"
|
||||
#include "lvdgmicglue.h"
|
||||
|
||||
livido_init_f init_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = lvdgmic_new(1);
|
||||
|
||||
livido_property_set( my_instance, "PLUGIN_private",
|
||||
LIVIDO_ATOM_TYPE_VOIDPTR,1,&gmic );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_deinit_f deinit_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
lvdgmic_delete(gmic);
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_process_f process_instance( livido_port_t *my_instance, double timecode )
|
||||
{
|
||||
uint8_t *A[4] = {NULL,NULL,NULL,NULL};
|
||||
uint8_t *O[4]= {NULL,NULL,NULL,NULL};
|
||||
char cmd[256];
|
||||
int palette;
|
||||
int w;
|
||||
int h;
|
||||
|
||||
int error = lvd_extract_channel_values( my_instance, "out_channels", 0, &w,&h, O,&palette );
|
||||
if( error != LIVIDO_NO_ERROR )
|
||||
return LIVIDO_ERROR_HARDWARE;
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
|
||||
lvd_extract_channel_values( my_instance, "in_channels" , 0, &w, &h, A, &palette );
|
||||
|
||||
int amplitude = lvd_extract_param_index( my_instance,"in_parameters", 0 );
|
||||
int lowfreq = lvd_extract_param_index( my_instance,"in_parameters", 1 );
|
||||
int freqrange = lvd_extract_param_index(my_instance, "in_parameters",2);
|
||||
|
||||
snprintf(cmd,sizeof(cmd),"-gimp_shockwaves %d,%d,%d,%d", amplitude, lowfreq, freqrange );
|
||||
|
||||
lvdgmic_push( gmic, w, h, palette, A, 0);
|
||||
|
||||
lvdgmic_gmic( gmic, cmd );
|
||||
|
||||
lvdgmic_pull( gmic, 0, O );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
livido_port_t *livido_setup(livido_setup_t list[], int version)
|
||||
|
||||
{
|
||||
LIVIDO_IMPORT(list);
|
||||
|
||||
livido_port_t *port = NULL;
|
||||
livido_port_t *in_params[3];
|
||||
livido_port_t *in_chans[3];
|
||||
livido_port_t *out_chans[1];
|
||||
livido_port_t *info = NULL;
|
||||
livido_port_t *filter = NULL;
|
||||
|
||||
//@ setup root node, plugin info
|
||||
info = livido_port_new( LIVIDO_PORT_TYPE_PLUGIN_INFO );
|
||||
port = info;
|
||||
|
||||
livido_set_string_value( port, "maintainer", "Niels");
|
||||
livido_set_string_value( port, "version","1");
|
||||
|
||||
filter = livido_port_new( LIVIDO_PORT_TYPE_FILTER_CLASS );
|
||||
livido_set_int_value( filter, "api_version", LIVIDO_API_VERSION );
|
||||
|
||||
//@ setup function pointers
|
||||
livido_set_voidptr_value( filter, "deinit_func", &deinit_instance );
|
||||
livido_set_voidptr_value( filter, "init_func", &init_instance );
|
||||
livido_set_voidptr_value( filter, "process_func", &process_instance );
|
||||
port = filter;
|
||||
|
||||
//@ meta information
|
||||
livido_set_string_value( port, "name", "G'MIC/GREYs Shock Wave");
|
||||
livido_set_string_value( port, "description", "Apply Shock Wave");
|
||||
livido_set_string_value( port, "author", "GREYC's Magic for Image Computing");
|
||||
|
||||
livido_set_int_value( port, "flags", LIVIDO_FILTER_NON_REALTIME);
|
||||
livido_set_string_value( port, "license", "GPL2");
|
||||
livido_set_int_value( port, "version", 1);
|
||||
|
||||
//@ some palettes veejay-classic uses
|
||||
int palettes0[] = {
|
||||
LIVIDO_PALETTE_YUV422P,
|
||||
LIVIDO_PALETTE_YUV444P,
|
||||
LIVIDO_PALETTE_RGBFLOAT,
|
||||
LIVIDO_PALETTE_A8,
|
||||
0,
|
||||
};
|
||||
|
||||
//@ setup output channel
|
||||
out_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = out_chans[0];
|
||||
|
||||
livido_set_string_value( port, "name", "Output Channel");
|
||||
livido_set_int_array( port, "palette_list", 3, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = in_chans[0];
|
||||
livido_set_string_value( port, "name", "Input Channel");
|
||||
livido_set_int_array( port, "palette_list", 4, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_params[0] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[0];
|
||||
|
||||
livido_set_string_value(port, "name", "Amplitude" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 100 );
|
||||
livido_set_int_value( port, "default", 10 );
|
||||
livido_set_string_value( port, "description" ,"Amplitude");
|
||||
|
||||
|
||||
in_params[1] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[1];
|
||||
|
||||
livido_set_string_value(port, "name", "Low frequency" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 100 );
|
||||
livido_set_int_value( port, "default", 10 );
|
||||
livido_set_string_value( port, "description" ,"Low frequency");
|
||||
|
||||
in_params[2] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[2];
|
||||
|
||||
livido_set_string_value(port, "name", "Frequency range" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 100 );
|
||||
livido_set_int_value( port, "default", 20 );
|
||||
livido_set_string_value( port, "description" ,"Frequency range");
|
||||
|
||||
//@ setup the nodes
|
||||
livido_set_portptr_array( filter, "in_parameter_templates",3, in_params );
|
||||
livido_set_portptr_array( filter, "out_channel_templates", 1, out_chans );
|
||||
livido_set_portptr_array( filter, "in_channel_templates",1, in_chans );
|
||||
|
||||
livido_set_portptr_value(info, "filters", filter);
|
||||
return info;
|
||||
}
|
||||
144
veejay-current/plugin-packs/lvdgmic/plugins/gmic_sponge.c
Normal file
144
veejay-current/plugin-packs/lvdgmic/plugins/gmic_sponge.c
Normal file
@@ -0,0 +1,144 @@
|
||||
/*
|
||||
* LIBVJE - veejay fx library
|
||||
*
|
||||
* Copyright(C)2015 Niels Elburg <nwelburg@gmail.com>
|
||||
* See COPYING for software license and distribution details
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef IS_LIVIDO_PLUGIN
|
||||
#define IS_LIVIDO_PLUGIN
|
||||
#endif
|
||||
|
||||
#include "livido.h"
|
||||
LIVIDO_PLUGIN
|
||||
#include "utils.h"
|
||||
#include "livido-utils.c"
|
||||
#include "lvd_common.h"
|
||||
#include "lvdgmicglue.h"
|
||||
|
||||
livido_init_f init_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = lvdgmic_new(1);
|
||||
|
||||
livido_property_set( my_instance, "PLUGIN_private",
|
||||
LIVIDO_ATOM_TYPE_VOIDPTR,1,&gmic );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_deinit_f deinit_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
lvdgmic_delete(gmic);
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_process_f process_instance( livido_port_t *my_instance, double timecode )
|
||||
{
|
||||
uint8_t *A[4] = {NULL,NULL,NULL,NULL};
|
||||
uint8_t *O[4]= {NULL,NULL,NULL,NULL};
|
||||
char cmd[256];
|
||||
int palette;
|
||||
int w;
|
||||
int h;
|
||||
|
||||
int error = lvd_extract_channel_values( my_instance, "out_channels", 0, &w,&h, O,&palette );
|
||||
if( error != LIVIDO_NO_ERROR )
|
||||
return LIVIDO_ERROR_HARDWARE;
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
|
||||
lvd_extract_channel_values( my_instance, "in_channels" , 0, &w, &h, A, &palette );
|
||||
|
||||
int size = lvd_extract_param_index( my_instance,"in_parameters", 0 );
|
||||
|
||||
snprintf(cmd,sizeof(cmd),"-gimp_sponge %d", size);
|
||||
|
||||
lvdgmic_push( gmic, w, h, palette, A, 0);
|
||||
|
||||
lvdgmic_gmic( gmic, cmd );
|
||||
|
||||
lvdgmic_pull( gmic, 0, O );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
livido_port_t *livido_setup(livido_setup_t list[], int version)
|
||||
|
||||
{
|
||||
LIVIDO_IMPORT(list);
|
||||
|
||||
livido_port_t *port = NULL;
|
||||
livido_port_t *in_params[1];
|
||||
livido_port_t *in_chans[3];
|
||||
livido_port_t *out_chans[1];
|
||||
livido_port_t *info = NULL;
|
||||
livido_port_t *filter = NULL;
|
||||
|
||||
//@ setup root node, plugin info
|
||||
info = livido_port_new( LIVIDO_PORT_TYPE_PLUGIN_INFO );
|
||||
port = info;
|
||||
|
||||
livido_set_string_value( port, "maintainer", "Niels");
|
||||
livido_set_string_value( port, "version","1");
|
||||
|
||||
filter = livido_port_new( LIVIDO_PORT_TYPE_FILTER_CLASS );
|
||||
livido_set_int_value( filter, "api_version", LIVIDO_API_VERSION );
|
||||
|
||||
//@ setup function pointers
|
||||
livido_set_voidptr_value( filter, "deinit_func", &deinit_instance );
|
||||
livido_set_voidptr_value( filter, "init_func", &init_instance );
|
||||
livido_set_voidptr_value( filter, "process_func", &process_instance );
|
||||
port = filter;
|
||||
|
||||
//@ meta information
|
||||
livido_set_string_value( port, "name", "G'MIC/GREYs Sponge");
|
||||
livido_set_string_value( port, "description", "Apply sponge effect on image");
|
||||
livido_set_string_value( port, "author", "GREYC's Magic for Image Computing");
|
||||
|
||||
livido_set_int_value( port, "flags", LIVIDO_FILTER_NON_REALTIME);
|
||||
livido_set_string_value( port, "license", "GPL2");
|
||||
livido_set_int_value( port, "version", 1);
|
||||
|
||||
//@ some palettes veejay-classic uses
|
||||
int palettes0[] = {
|
||||
LIVIDO_PALETTE_YUV422P,
|
||||
0,
|
||||
};
|
||||
|
||||
//@ setup output channel
|
||||
out_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = out_chans[0];
|
||||
|
||||
livido_set_string_value( port, "name", "Output Channel");
|
||||
livido_set_int_array( port, "palette_list", 3, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = in_chans[0];
|
||||
livido_set_string_value( port, "name", "Input Channel");
|
||||
livido_set_int_array( port, "palette_list", 4, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_params[0] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[0];
|
||||
|
||||
livido_set_string_value(port, "name", "Size" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min",3 );
|
||||
livido_set_int_value( port, "max",21 );
|
||||
livido_set_int_value( port, "default", 13 );
|
||||
livido_set_string_value( port, "description" ,"Size");
|
||||
|
||||
livido_set_portptr_array( filter, "in_parameter_templates",1, in_params );
|
||||
livido_set_portptr_array( filter, "out_channel_templates",1, out_chans );
|
||||
livido_set_portptr_array( filter, "in_channel_templates",1, in_chans );
|
||||
|
||||
livido_set_portptr_value(info, "filters", filter);
|
||||
return info;
|
||||
}
|
||||
171
veejay-current/plugin-packs/lvdgmic/plugins/gmic_spread.c
Normal file
171
veejay-current/plugin-packs/lvdgmic/plugins/gmic_spread.c
Normal file
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* LIBVJE - veejay fx library
|
||||
*
|
||||
* Copyright(C)2015 Niels Elburg <nwelburg@gmail.com>
|
||||
* See COPYING for software license and distribution details
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef IS_LIVIDO_PLUGIN
|
||||
#define IS_LIVIDO_PLUGIN
|
||||
#endif
|
||||
|
||||
#include "livido.h"
|
||||
LIVIDO_PLUGIN
|
||||
#include "utils.h"
|
||||
#include "livido-utils.c"
|
||||
#include "lvd_common.h"
|
||||
#include "lvdgmicglue.h"
|
||||
|
||||
livido_init_f init_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = lvdgmic_new(1);
|
||||
|
||||
livido_property_set( my_instance, "PLUGIN_private",
|
||||
LIVIDO_ATOM_TYPE_VOIDPTR,1,&gmic );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_deinit_f deinit_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
lvdgmic_delete(gmic);
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_process_f process_instance( livido_port_t *my_instance, double timecode )
|
||||
{
|
||||
uint8_t *A[4] = {NULL,NULL,NULL,NULL};
|
||||
uint8_t *O[4]= {NULL,NULL,NULL,NULL};
|
||||
char cmd[256];
|
||||
int palette;
|
||||
int w;
|
||||
int h;
|
||||
|
||||
int error = lvd_extract_channel_values( my_instance, "out_channels", 0, &w,&h, O,&palette );
|
||||
if( error != LIVIDO_NO_ERROR )
|
||||
return LIVIDO_ERROR_HARDWARE;
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
|
||||
lvd_extract_channel_values( my_instance, "in_channels" , 0, &w, &h, A, &palette );
|
||||
|
||||
int dx = lvd_extract_param_index( my_instance,"in_parameters", 0 );
|
||||
int dy = lvd_extract_param_index( my_instance,"in_parameters", 1 );
|
||||
int dz = lvd_extract_param_index(my_instance, "in_parameters",2);
|
||||
|
||||
snprintf(cmd,sizeof(cmd),"-spread %d,%d,%d",dx,dy,dz);
|
||||
|
||||
lvdgmic_push( gmic, w, h, palette, A, 0);
|
||||
|
||||
lvdgmic_gmic( gmic, cmd );
|
||||
|
||||
lvdgmic_pull( gmic, 0, O );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
livido_port_t *livido_setup(livido_setup_t list[], int version)
|
||||
|
||||
{
|
||||
LIVIDO_IMPORT(list);
|
||||
|
||||
livido_port_t *port = NULL;
|
||||
livido_port_t *in_params[3];
|
||||
livido_port_t *in_chans[3];
|
||||
livido_port_t *out_chans[1];
|
||||
livido_port_t *info = NULL;
|
||||
livido_port_t *filter = NULL;
|
||||
|
||||
//@ setup root node, plugin info
|
||||
info = livido_port_new( LIVIDO_PORT_TYPE_PLUGIN_INFO );
|
||||
port = info;
|
||||
|
||||
livido_set_string_value( port, "maintainer", "Niels");
|
||||
livido_set_string_value( port, "version","1");
|
||||
|
||||
filter = livido_port_new( LIVIDO_PORT_TYPE_FILTER_CLASS );
|
||||
livido_set_int_value( filter, "api_version", LIVIDO_API_VERSION );
|
||||
|
||||
//@ setup function pointers
|
||||
livido_set_voidptr_value( filter, "deinit_func", &deinit_instance );
|
||||
livido_set_voidptr_value( filter, "init_func", &init_instance );
|
||||
livido_set_voidptr_value( filter, "process_func", &process_instance );
|
||||
port = filter;
|
||||
|
||||
//@ meta information
|
||||
livido_set_string_value( port, "name", "G'MIC/GREYs Spread");
|
||||
livido_set_string_value( port, "description", "Spread pixel values of image randomly along x,y and z");
|
||||
livido_set_string_value( port, "author", "GREYC's Magic for Image Computing");
|
||||
|
||||
livido_set_int_value( port, "flags", LIVIDO_FILTER_NON_REALTIME);
|
||||
livido_set_string_value( port, "license", "GPL2");
|
||||
livido_set_int_value( port, "version", 1);
|
||||
|
||||
//@ some palettes veejay-classic uses
|
||||
int palettes0[] = {
|
||||
LIVIDO_PALETTE_YUV422P,
|
||||
LIVIDO_PALETTE_YUV444P,
|
||||
LIVIDO_PALETTE_RGBFLOAT,
|
||||
LIVIDO_PALETTE_A8,
|
||||
0,
|
||||
};
|
||||
|
||||
//@ setup output channel
|
||||
out_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = out_chans[0];
|
||||
|
||||
livido_set_string_value( port, "name", "Output Channel");
|
||||
livido_set_int_array( port, "palette_list", 3, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = in_chans[0];
|
||||
livido_set_string_value( port, "name", "Input Channel");
|
||||
livido_set_int_array( port, "palette_list", 4, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_params[0] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[0];
|
||||
|
||||
livido_set_string_value(port, "name", "X-Axis" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 100 );
|
||||
livido_set_int_value( port, "default", 20 );
|
||||
livido_set_string_value( port, "description" ,"X-Axis");
|
||||
|
||||
|
||||
in_params[1] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[1];
|
||||
|
||||
livido_set_string_value(port, "name", "Y-Axis" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 100 );
|
||||
livido_set_int_value( port, "default", 10 );
|
||||
livido_set_string_value( port, "description" ,"Y-Axis");
|
||||
|
||||
in_params[2] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[2];
|
||||
|
||||
livido_set_string_value(port, "name", "Z-Axis" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 100 );
|
||||
livido_set_int_value( port, "default", 1 );
|
||||
livido_set_string_value( port, "description" ,"Z-Axis");
|
||||
|
||||
//@ setup the nodes
|
||||
livido_set_portptr_array( filter, "in_parameter_templates",3, in_params );
|
||||
livido_set_portptr_array( filter, "out_channel_templates", 1, out_chans );
|
||||
livido_set_portptr_array( filter, "in_channel_templates",1, in_chans );
|
||||
|
||||
livido_set_portptr_value(info, "filters", filter);
|
||||
return info;
|
||||
}
|
||||
144
veejay-current/plugin-packs/lvdgmic/plugins/gmic_tetris.c
Normal file
144
veejay-current/plugin-packs/lvdgmic/plugins/gmic_tetris.c
Normal file
@@ -0,0 +1,144 @@
|
||||
/*
|
||||
* LIBVJE - veejay fx library
|
||||
*
|
||||
* Copyright(C)2015 Niels Elburg <nwelburg@gmail.com>
|
||||
* See COPYING for software license and distribution details
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef IS_LIVIDO_PLUGIN
|
||||
#define IS_LIVIDO_PLUGIN
|
||||
#endif
|
||||
|
||||
#include "livido.h"
|
||||
LIVIDO_PLUGIN
|
||||
#include "utils.h"
|
||||
#include "livido-utils.c"
|
||||
#include "lvd_common.h"
|
||||
#include "lvdgmicglue.h"
|
||||
|
||||
livido_init_f init_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = lvdgmic_new(1);
|
||||
|
||||
livido_property_set( my_instance, "PLUGIN_private",
|
||||
LIVIDO_ATOM_TYPE_VOIDPTR,1,&gmic );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_deinit_f deinit_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
lvdgmic_delete(gmic);
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_process_f process_instance( livido_port_t *my_instance, double timecode )
|
||||
{
|
||||
uint8_t *A[4] = {NULL,NULL,NULL,NULL};
|
||||
uint8_t *O[4]= {NULL,NULL,NULL,NULL};
|
||||
char cmd[256];
|
||||
int palette;
|
||||
int w;
|
||||
int h;
|
||||
|
||||
int error = lvd_extract_channel_values( my_instance, "out_channels", 0, &w,&h, O,&palette );
|
||||
if( error != LIVIDO_NO_ERROR )
|
||||
return LIVIDO_ERROR_HARDWARE;
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
|
||||
lvd_extract_channel_values( my_instance, "in_channels" , 0, &w, &h, A, &palette );
|
||||
|
||||
int scale = lvd_extract_param_index( my_instance,"in_parameters", 0 );
|
||||
|
||||
snprintf(cmd,sizeof(cmd),"-gimp_tetris %d", scale);
|
||||
|
||||
lvdgmic_push( gmic, w, h, palette, A, 0);
|
||||
|
||||
lvdgmic_gmic( gmic, cmd );
|
||||
|
||||
lvdgmic_pull( gmic, 0, O );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
livido_port_t *livido_setup(livido_setup_t list[], int version)
|
||||
|
||||
{
|
||||
LIVIDO_IMPORT(list);
|
||||
|
||||
livido_port_t *port = NULL;
|
||||
livido_port_t *in_params[1];
|
||||
livido_port_t *in_chans[3];
|
||||
livido_port_t *out_chans[1];
|
||||
livido_port_t *info = NULL;
|
||||
livido_port_t *filter = NULL;
|
||||
|
||||
//@ setup root node, plugin info
|
||||
info = livido_port_new( LIVIDO_PORT_TYPE_PLUGIN_INFO );
|
||||
port = info;
|
||||
|
||||
livido_set_string_value( port, "maintainer", "Niels");
|
||||
livido_set_string_value( port, "version","1");
|
||||
|
||||
filter = livido_port_new( LIVIDO_PORT_TYPE_FILTER_CLASS );
|
||||
livido_set_int_value( filter, "api_version", LIVIDO_API_VERSION );
|
||||
|
||||
//@ setup function pointers
|
||||
livido_set_voidptr_value( filter, "deinit_func", &deinit_instance );
|
||||
livido_set_voidptr_value( filter, "init_func", &init_instance );
|
||||
livido_set_voidptr_value( filter, "process_func", &process_instance );
|
||||
port = filter;
|
||||
|
||||
//@ meta information
|
||||
livido_set_string_value( port, "name", "G'MIC/GREYs Tetris");
|
||||
livido_set_string_value( port, "description", "Apply tetris effect on image");
|
||||
livido_set_string_value( port, "author", "GREYC's Magic for Image Computing");
|
||||
|
||||
livido_set_int_value( port, "flags", LIVIDO_FILTER_NON_REALTIME);
|
||||
livido_set_string_value( port, "license", "GPL2");
|
||||
livido_set_int_value( port, "version", 1);
|
||||
|
||||
//@ some palettes veejay-classic uses
|
||||
int palettes0[] = {
|
||||
LIVIDO_PALETTE_YUV422P,
|
||||
0,
|
||||
};
|
||||
|
||||
//@ setup output channel
|
||||
out_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = out_chans[0];
|
||||
|
||||
livido_set_string_value( port, "name", "Output Channel");
|
||||
livido_set_int_array( port, "palette_list", 3, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = in_chans[0];
|
||||
livido_set_string_value( port, "name", "Input Channel");
|
||||
livido_set_int_array( port, "palette_list", 4, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_params[0] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[0];
|
||||
|
||||
livido_set_string_value(port, "name", "Scale" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min",1 );
|
||||
livido_set_int_value( port, "max",20 );
|
||||
livido_set_int_value( port, "default", 10 );
|
||||
livido_set_string_value( port, "description" ,"Scale");
|
||||
|
||||
livido_set_portptr_array( filter, "in_parameter_templates",1, in_params );
|
||||
livido_set_portptr_array( filter, "out_channel_templates",1, out_chans );
|
||||
livido_set_portptr_array( filter, "in_channel_templates",1, in_chans );
|
||||
|
||||
livido_set_portptr_value(info, "filters", filter);
|
||||
return info;
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
/*
|
||||
* LIBVJE - veejay fx library
|
||||
*
|
||||
* Copyright(C)2015 Niels Elburg <nwelburg@gmail.com>
|
||||
* See COPYING for software license and distribution details
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef IS_LIVIDO_PLUGIN
|
||||
#define IS_LIVIDO_PLUGIN
|
||||
#endif
|
||||
|
||||
#include "livido.h"
|
||||
LIVIDO_PLUGIN
|
||||
#include "utils.h"
|
||||
#include "livido-utils.c"
|
||||
#include "lvd_common.h"
|
||||
#include "lvdgmicglue.h"
|
||||
|
||||
livido_init_f init_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = lvdgmic_new(1);
|
||||
|
||||
livido_property_set( my_instance, "PLUGIN_private",
|
||||
LIVIDO_ATOM_TYPE_VOIDPTR,1,&gmic );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_deinit_f deinit_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
lvdgmic_delete(gmic);
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_process_f process_instance( livido_port_t *my_instance, double timecode )
|
||||
{
|
||||
uint8_t *A[4] = {NULL,NULL,NULL,NULL};
|
||||
uint8_t *O[4]= {NULL,NULL,NULL,NULL};
|
||||
char cmd[256];
|
||||
int palette;
|
||||
int w;
|
||||
int h;
|
||||
|
||||
int error = lvd_extract_channel_values( my_instance, "out_channels", 0, &w,&h, O,&palette );
|
||||
if( error != LIVIDO_NO_ERROR )
|
||||
return LIVIDO_ERROR_HARDWARE;
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
|
||||
lvd_extract_channel_values( my_instance, "in_channels" , 0, &w, &h, A, &palette );
|
||||
|
||||
snprintf(cmd,sizeof(cmd),"-texturize_paper");
|
||||
|
||||
lvdgmic_push( gmic, w, h, 0, A, 0);
|
||||
|
||||
lvdgmic_gmic( gmic, cmd );
|
||||
|
||||
lvdgmic_pull( gmic, 0, O );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
livido_port_t *livido_setup(livido_setup_t list[], int version)
|
||||
|
||||
{
|
||||
LIVIDO_IMPORT(list);
|
||||
|
||||
livido_port_t *port = NULL;
|
||||
livido_port_t *in_chans[3];
|
||||
livido_port_t *out_chans[1];
|
||||
livido_port_t *info = NULL;
|
||||
livido_port_t *filter = NULL;
|
||||
|
||||
//@ setup root node, plugin info
|
||||
info = livido_port_new( LIVIDO_PORT_TYPE_PLUGIN_INFO );
|
||||
port = info;
|
||||
|
||||
livido_set_string_value( port, "maintainer", "Niels");
|
||||
livido_set_string_value( port, "version","1");
|
||||
|
||||
filter = livido_port_new( LIVIDO_PORT_TYPE_FILTER_CLASS );
|
||||
livido_set_int_value( filter, "api_version", LIVIDO_API_VERSION );
|
||||
|
||||
//@ setup function pointers
|
||||
livido_set_voidptr_value( filter, "deinit_func", &deinit_instance );
|
||||
livido_set_voidptr_value( filter, "init_func", &init_instance );
|
||||
livido_set_voidptr_value( filter, "process_func", &process_instance );
|
||||
port = filter;
|
||||
|
||||
//@ meta information
|
||||
livido_set_string_value( port, "name", "G'MIC/GREYs Texture Paper");
|
||||
livido_set_string_value( port, "description", "Add paper texture to image");
|
||||
livido_set_string_value( port, "author", "GREYC's Magic for Image Computing");
|
||||
|
||||
livido_set_int_value( port, "flags", LIVIDO_FILTER_NON_REALTIME);
|
||||
livido_set_string_value( port, "license", "GPL2");
|
||||
livido_set_int_value( port, "version", 1);
|
||||
|
||||
//@ some palettes veejay-classic uses
|
||||
int palettes0[] = {
|
||||
LIVIDO_PALETTE_YUV422P,
|
||||
0,
|
||||
};
|
||||
|
||||
//@ setup output channel
|
||||
out_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = out_chans[0];
|
||||
|
||||
livido_set_string_value( port, "name", "Output Channel");
|
||||
livido_set_int_array( port, "palette_list", 3, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = in_chans[0];
|
||||
livido_set_string_value( port, "name", "Input Channel");
|
||||
livido_set_int_array( port, "palette_list", 4, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
livido_set_portptr_array( filter, "out_channel_templates", 1, out_chans );
|
||||
livido_set_portptr_array( filter, "in_channel_templates",1, in_chans );
|
||||
|
||||
livido_set_portptr_value(info, "filters", filter);
|
||||
return info;
|
||||
}
|
||||
169
veejay-current/plugin-packs/lvdgmic/plugins/gmic_vignette.c
Normal file
169
veejay-current/plugin-packs/lvdgmic/plugins/gmic_vignette.c
Normal file
@@ -0,0 +1,169 @@
|
||||
/*
|
||||
* LIBVJE - veejay fx library
|
||||
*
|
||||
* Copyright(C)2015 Niels Elburg <nwelburg@gmail.com>
|
||||
* See COPYING for software license and distribution details
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef IS_LIVIDO_PLUGIN
|
||||
#define IS_LIVIDO_PLUGIN
|
||||
#endif
|
||||
|
||||
#include "livido.h"
|
||||
LIVIDO_PLUGIN
|
||||
#include "utils.h"
|
||||
#include "livido-utils.c"
|
||||
#include "lvd_common.h"
|
||||
#include "lvdgmicglue.h"
|
||||
|
||||
livido_init_f init_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = lvdgmic_new(1);
|
||||
|
||||
livido_property_set( my_instance, "PLUGIN_private",
|
||||
LIVIDO_ATOM_TYPE_VOIDPTR,1,&gmic );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_deinit_f deinit_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
lvdgmic_delete(gmic);
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_process_f process_instance( livido_port_t *my_instance, double timecode )
|
||||
{
|
||||
uint8_t *A[4] = {NULL,NULL,NULL,NULL};
|
||||
uint8_t *O[4]= {NULL,NULL,NULL,NULL};
|
||||
char cmd[256];
|
||||
int palette;
|
||||
int w;
|
||||
int h;
|
||||
|
||||
int error = lvd_extract_channel_values( my_instance, "out_channels", 0, &w,&h, O,&palette );
|
||||
if( error != LIVIDO_NO_ERROR )
|
||||
return LIVIDO_ERROR_HARDWARE;
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
|
||||
lvd_extract_channel_values( my_instance, "in_channels" , 0, &w, &h, A, &palette );
|
||||
|
||||
int strength = lvd_extract_param_index( my_instance,"in_parameters", 0 );
|
||||
int min_radius = lvd_extract_param_index( my_instance,"in_parameters", 1 );
|
||||
int max_radius = lvd_extract_param_index(my_instance, "in_parameters",2);
|
||||
|
||||
snprintf(cmd,sizeof(cmd),"-vignette %d,%d,%d", strength, min_radius,max_radius );
|
||||
|
||||
lvdgmic_push( gmic, w, h, 0, A, 0);
|
||||
|
||||
lvdgmic_gmic( gmic, cmd );
|
||||
|
||||
lvdgmic_pull( gmic, 0, O );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
livido_port_t *livido_setup(livido_setup_t list[], int version)
|
||||
|
||||
{
|
||||
LIVIDO_IMPORT(list);
|
||||
|
||||
livido_port_t *port = NULL;
|
||||
livido_port_t *in_params[3];
|
||||
livido_port_t *in_chans[3];
|
||||
livido_port_t *out_chans[1];
|
||||
livido_port_t *info = NULL;
|
||||
livido_port_t *filter = NULL;
|
||||
|
||||
//@ setup root node, plugin info
|
||||
info = livido_port_new( LIVIDO_PORT_TYPE_PLUGIN_INFO );
|
||||
port = info;
|
||||
|
||||
livido_set_string_value( port, "maintainer", "Niels");
|
||||
livido_set_string_value( port, "version","1");
|
||||
|
||||
filter = livido_port_new( LIVIDO_PORT_TYPE_FILTER_CLASS );
|
||||
livido_set_int_value( filter, "api_version", LIVIDO_API_VERSION );
|
||||
|
||||
//@ setup function pointers
|
||||
livido_set_voidptr_value( filter, "deinit_func", &deinit_instance );
|
||||
livido_set_voidptr_value( filter, "init_func", &init_instance );
|
||||
livido_set_voidptr_value( filter, "process_func", &process_instance );
|
||||
port = filter;
|
||||
|
||||
//@ meta information
|
||||
livido_set_string_value( port, "name", "G'MIC/GREYs Vignette");
|
||||
livido_set_string_value( port, "description", "Add vignette effect to image");
|
||||
livido_set_string_value( port, "author", "GREYC's Magic for Image Computing");
|
||||
|
||||
livido_set_int_value( port, "flags", LIVIDO_FILTER_NON_REALTIME);
|
||||
livido_set_string_value( port, "license", "GPL2");
|
||||
livido_set_int_value( port, "version", 1);
|
||||
|
||||
//@ some palettes veejay-classic uses
|
||||
int palettes0[] = {
|
||||
LIVIDO_PALETTE_YUV422P,
|
||||
0,
|
||||
};
|
||||
|
||||
//@ setup output channel
|
||||
out_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = out_chans[0];
|
||||
|
||||
livido_set_string_value( port, "name", "Output Channel");
|
||||
livido_set_int_array( port, "palette_list", 3, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = in_chans[0];
|
||||
livido_set_string_value( port, "name", "Input Channel");
|
||||
livido_set_int_array( port, "palette_list", 4, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_params[0] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[0];
|
||||
|
||||
livido_set_string_value(port, "name", "Strength" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 500 );
|
||||
livido_set_int_value( port, "default", 100 );
|
||||
livido_set_string_value( port, "description" ,"Strength");
|
||||
|
||||
|
||||
in_params[1] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[1];
|
||||
|
||||
livido_set_string_value(port, "name", "Min Radius" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 100 );
|
||||
livido_set_int_value( port, "default", 70 );
|
||||
livido_set_string_value( port, "description" ,"Min Radius");
|
||||
|
||||
in_params[2] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[2];
|
||||
|
||||
livido_set_string_value(port, "name", "Max Radius" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 100 );
|
||||
livido_set_int_value( port, "default", 90 );
|
||||
livido_set_string_value( port, "description" ,"Max Radius");
|
||||
|
||||
|
||||
//@ setup the nodes
|
||||
livido_set_portptr_array( filter, "in_parameter_templates",3, in_params );
|
||||
livido_set_portptr_array( filter, "out_channel_templates", 1, out_chans );
|
||||
livido_set_portptr_array( filter, "in_channel_templates",1, in_chans );
|
||||
|
||||
livido_set_portptr_value(info, "filters", filter);
|
||||
return info;
|
||||
}
|
||||
160
veejay-current/plugin-packs/lvdgmic/plugins/gmic_water.c
Normal file
160
veejay-current/plugin-packs/lvdgmic/plugins/gmic_water.c
Normal file
@@ -0,0 +1,160 @@
|
||||
/*
|
||||
* LIBVJE - veejay fx library
|
||||
*
|
||||
* Copyright(C)2015 Niels Elburg <nwelburg@gmail.com>
|
||||
* See COPYING for software license and distribution details
|
||||
*
|
||||
* GMIC Water, intially ported to livido by Michael John Hornyak
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef IS_LIVIDO_PLUGIN
|
||||
#define IS_LIVIDO_PLUGIN
|
||||
#endif
|
||||
|
||||
#include "livido.h"
|
||||
LIVIDO_PLUGIN
|
||||
#include "utils.h"
|
||||
#include "livido-utils.c"
|
||||
#include "lvd_common.h"
|
||||
#include "lvdgmicglue.h"
|
||||
|
||||
livido_init_f init_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = lvdgmic_new(1);
|
||||
|
||||
livido_property_set( my_instance, "PLUGIN_private",
|
||||
LIVIDO_ATOM_TYPE_VOIDPTR,1,&gmic );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_deinit_f deinit_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
lvdgmic_delete(gmic);
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_process_f process_instance( livido_port_t *my_instance, double timecode )
|
||||
{
|
||||
uint8_t *A[4] = {NULL,NULL,NULL,NULL};
|
||||
uint8_t *O[4]= {NULL,NULL,NULL,NULL};
|
||||
char cmd[256];
|
||||
int palette;
|
||||
int w;
|
||||
int h;
|
||||
|
||||
int error = lvd_extract_channel_values( my_instance, "out_channels", 0, &w,&h, O,&palette );
|
||||
if( error != LIVIDO_NO_ERROR )
|
||||
return LIVIDO_ERROR_HARDWARE;
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
|
||||
lvd_extract_channel_values( my_instance, "in_channels" , 0, &w, &h, A, &palette );
|
||||
|
||||
int amplitude = lvd_extract_param_index( my_instance,"in_parameters", 0 );
|
||||
int smoothness = lvd_extract_param_index( my_instance,"in_parameters", 1 );
|
||||
|
||||
snprintf(cmd,sizeof(cmd),"-water %d,%f", amplitude, (float)smoothness/100.0f);
|
||||
|
||||
lvdgmic_push( gmic, w, h, palette, A, 0);
|
||||
|
||||
lvdgmic_gmic( gmic, cmd );
|
||||
|
||||
lvdgmic_pull( gmic, 0, O );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
livido_port_t *livido_setup(livido_setup_t list[], int version)
|
||||
|
||||
{
|
||||
LIVIDO_IMPORT(list);
|
||||
|
||||
livido_port_t *port = NULL;
|
||||
livido_port_t *in_params[2];
|
||||
livido_port_t *in_chans[3];
|
||||
livido_port_t *out_chans[1];
|
||||
livido_port_t *info = NULL;
|
||||
livido_port_t *filter = NULL;
|
||||
|
||||
//@ setup root node, plugin info
|
||||
info = livido_port_new( LIVIDO_PORT_TYPE_PLUGIN_INFO );
|
||||
port = info;
|
||||
|
||||
livido_set_string_value( port, "maintainer", "Niels");
|
||||
livido_set_string_value( port, "version","1");
|
||||
|
||||
filter = livido_port_new( LIVIDO_PORT_TYPE_FILTER_CLASS );
|
||||
livido_set_int_value( filter, "api_version", LIVIDO_API_VERSION );
|
||||
|
||||
//@ setup function pointers
|
||||
livido_set_voidptr_value( filter, "deinit_func", &deinit_instance );
|
||||
livido_set_voidptr_value( filter, "init_func", &init_instance );
|
||||
livido_set_voidptr_value( filter, "process_func", &process_instance );
|
||||
port = filter;
|
||||
|
||||
//@ meta information
|
||||
livido_set_string_value( port, "name", "G'MIC/GREYs Water");
|
||||
livido_set_string_value( port, "description", "Apply water effect on image");
|
||||
livido_set_string_value( port, "author", "GREYC's Magic for Image Computing");
|
||||
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
livido_set_string_value( port, "license", "GPL2");
|
||||
livido_set_int_value( port, "version", 1);
|
||||
|
||||
//@ some palettes veejay-classic uses
|
||||
int palettes0[] = {
|
||||
LIVIDO_PALETTE_YUV444P,
|
||||
0,
|
||||
};
|
||||
|
||||
//@ setup output channel
|
||||
out_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = out_chans[0];
|
||||
|
||||
livido_set_string_value( port, "name", "Output Channel");
|
||||
livido_set_int_array( port, "palette_list", 3, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = in_chans[0];
|
||||
livido_set_string_value( port, "name", "Input Channel");
|
||||
livido_set_int_array( port, "palette_list", 4, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_params[0] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[0];
|
||||
|
||||
livido_set_string_value(port, "name", "Amplitude" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 300 );
|
||||
livido_set_int_value( port, "default", 30 );
|
||||
livido_set_string_value( port, "description" ,"Amplitude");
|
||||
|
||||
|
||||
in_params[1] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[1];
|
||||
|
||||
livido_set_string_value(port, "name", "Smoothness" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 400 );
|
||||
livido_set_int_value( port, "default", 150 );
|
||||
livido_set_string_value( port, "description" ,"Smoothness");
|
||||
|
||||
|
||||
//@ setup the nodes
|
||||
livido_set_portptr_array( filter, "in_parameter_templates",2, in_params );
|
||||
livido_set_portptr_array( filter, "out_channel_templates", 1, out_chans );
|
||||
livido_set_portptr_array( filter, "in_channel_templates",1, in_chans );
|
||||
|
||||
livido_set_portptr_value(info, "filters", filter);
|
||||
return info;
|
||||
}
|
||||
180
veejay-current/plugin-packs/lvdgmic/plugins/gmic_wave.c
Normal file
180
veejay-current/plugin-packs/lvdgmic/plugins/gmic_wave.c
Normal file
@@ -0,0 +1,180 @@
|
||||
/*
|
||||
* LIBVJE - veejay fx library
|
||||
*
|
||||
* Copyright(C)2015 Niels Elburg <nwelburg@gmail.com>
|
||||
* See COPYING for software license and distribution details
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef IS_LIVIDO_PLUGIN
|
||||
#define IS_LIVIDO_PLUGIN
|
||||
#endif
|
||||
|
||||
#include "livido.h"
|
||||
LIVIDO_PLUGIN
|
||||
#include "utils.h"
|
||||
#include "livido-utils.c"
|
||||
#include "lvd_common.h"
|
||||
#include "lvdgmicglue.h"
|
||||
|
||||
livido_init_f init_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = lvdgmic_new(1);
|
||||
|
||||
livido_property_set( my_instance, "PLUGIN_private",
|
||||
LIVIDO_ATOM_TYPE_VOIDPTR,1,&gmic );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_deinit_f deinit_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
lvdgmic_delete(gmic);
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_process_f process_instance( livido_port_t *my_instance, double timecode )
|
||||
{
|
||||
uint8_t *A[4] = {NULL,NULL,NULL,NULL};
|
||||
uint8_t *O[4]= {NULL,NULL,NULL,NULL};
|
||||
char cmd[256];
|
||||
int palette;
|
||||
int w;
|
||||
int h;
|
||||
|
||||
int error = lvd_extract_channel_values( my_instance, "out_channels", 0, &w,&h, O,&palette );
|
||||
if( error != LIVIDO_NO_ERROR )
|
||||
return LIVIDO_ERROR_HARDWARE;
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
|
||||
lvd_extract_channel_values( my_instance, "in_channels" , 0, &w, &h, A, &palette );
|
||||
|
||||
int amplitude = lvd_extract_param_index( my_instance,"in_parameters", 0 );
|
||||
int frequency = lvd_extract_param_index( my_instance,"in_parameters", 1 );
|
||||
int x_center = lvd_extract_param_index(my_instance, "in_parameters",2);
|
||||
int y_center = lvd_extract_param_index(my_instance, "in_parameters",3);
|
||||
|
||||
snprintf(cmd,sizeof(cmd),"-wave %d,%f,%d,%d", amplitude, (float)frequency/100.0f,x_center,y_center);
|
||||
|
||||
lvdgmic_push( gmic, w, h, palette, A, 0);
|
||||
|
||||
lvdgmic_gmic( gmic, cmd );
|
||||
|
||||
lvdgmic_pull( gmic, 0, O );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
livido_port_t *livido_setup(livido_setup_t list[], int version)
|
||||
|
||||
{
|
||||
LIVIDO_IMPORT(list);
|
||||
|
||||
livido_port_t *port = NULL;
|
||||
livido_port_t *in_params[4];
|
||||
livido_port_t *in_chans[3];
|
||||
livido_port_t *out_chans[1];
|
||||
livido_port_t *info = NULL;
|
||||
livido_port_t *filter = NULL;
|
||||
|
||||
//@ setup root node, plugin info
|
||||
info = livido_port_new( LIVIDO_PORT_TYPE_PLUGIN_INFO );
|
||||
port = info;
|
||||
|
||||
livido_set_string_value( port, "maintainer", "Niels");
|
||||
livido_set_string_value( port, "version","1");
|
||||
|
||||
filter = livido_port_new( LIVIDO_PORT_TYPE_FILTER_CLASS );
|
||||
livido_set_int_value( filter, "api_version", LIVIDO_API_VERSION );
|
||||
|
||||
//@ setup function pointers
|
||||
livido_set_voidptr_value( filter, "deinit_func", &deinit_instance );
|
||||
livido_set_voidptr_value( filter, "init_func", &init_instance );
|
||||
livido_set_voidptr_value( filter, "process_func", &process_instance );
|
||||
port = filter;
|
||||
|
||||
//@ meta information
|
||||
livido_set_string_value( port, "name", "G'MIC/GREYs Wave");
|
||||
livido_set_string_value( port, "description", "Apply wave deformation on image");
|
||||
livido_set_string_value( port, "author", "GREYC's Magic for Image Computing");
|
||||
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
livido_set_string_value( port, "license", "GPL2");
|
||||
livido_set_int_value( port, "version", 1);
|
||||
|
||||
//@ some palettes veejay-classic uses
|
||||
int palettes0[] = {
|
||||
LIVIDO_PALETTE_YUV444P,
|
||||
0,
|
||||
};
|
||||
|
||||
//@ setup output channel
|
||||
out_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = out_chans[0];
|
||||
|
||||
livido_set_string_value( port, "name", "Output Channel");
|
||||
livido_set_int_array( port, "palette_list", 3, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = in_chans[0];
|
||||
livido_set_string_value( port, "name", "Input Channel");
|
||||
livido_set_int_array( port, "palette_list", 4, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_params[0] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[0];
|
||||
|
||||
livido_set_string_value(port, "name", "Amplitude" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 30 );
|
||||
livido_set_int_value( port, "default", 10 );
|
||||
livido_set_string_value( port, "description" ,"Amplitude");
|
||||
|
||||
|
||||
in_params[1] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[1];
|
||||
|
||||
livido_set_string_value(port, "name", "Frequency" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 200 );
|
||||
livido_set_int_value( port, "default", 40 );
|
||||
livido_set_string_value( port, "description" ,"Frequency");
|
||||
|
||||
in_params[2] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[2];
|
||||
|
||||
livido_set_string_value(port, "name", "X-Center" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 100 );
|
||||
livido_set_int_value( port, "default", 50 );
|
||||
livido_set_string_value( port, "description" ,"X-Center");
|
||||
|
||||
in_params[3] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[3];
|
||||
|
||||
livido_set_string_value(port, "name", "Y-Center" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 100 );
|
||||
livido_set_int_value( port, "default", 50 );
|
||||
livido_set_string_value( port, "description" ,"Y-Center");
|
||||
|
||||
|
||||
//@ setup the nodes
|
||||
livido_set_portptr_array( filter, "in_parameter_templates",4, in_params );
|
||||
livido_set_portptr_array( filter, "out_channel_templates", 1, out_chans );
|
||||
livido_set_portptr_array( filter, "in_channel_templates",1, in_chans );
|
||||
|
||||
livido_set_portptr_value(info, "filters", filter);
|
||||
return info;
|
||||
}
|
||||
144
veejay-current/plugin-packs/lvdgmic/plugins/gmic_whirl.c
Normal file
144
veejay-current/plugin-packs/lvdgmic/plugins/gmic_whirl.c
Normal file
@@ -0,0 +1,144 @@
|
||||
/*
|
||||
* LIBVJE - veejay fx library
|
||||
*
|
||||
* Copyright(C)2015 Niels Elburg <nwelburg@gmail.com>
|
||||
* See COPYING for software license and distribution details
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef IS_LIVIDO_PLUGIN
|
||||
#define IS_LIVIDO_PLUGIN
|
||||
#endif
|
||||
|
||||
#include "livido.h"
|
||||
LIVIDO_PLUGIN
|
||||
#include "utils.h"
|
||||
#include "livido-utils.c"
|
||||
#include "lvd_common.h"
|
||||
#include "lvdgmicglue.h"
|
||||
|
||||
livido_init_f init_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = lvdgmic_new(1);
|
||||
|
||||
livido_property_set( my_instance, "PLUGIN_private",
|
||||
LIVIDO_ATOM_TYPE_VOIDPTR,1,&gmic );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_deinit_f deinit_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
lvdgmic_delete(gmic);
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_process_f process_instance( livido_port_t *my_instance, double timecode )
|
||||
{
|
||||
uint8_t *A[4] = {NULL,NULL,NULL,NULL};
|
||||
uint8_t *O[4]= {NULL,NULL,NULL,NULL};
|
||||
char cmd[256];
|
||||
int palette;
|
||||
int w;
|
||||
int h;
|
||||
|
||||
int error = lvd_extract_channel_values( my_instance, "out_channels", 0, &w,&h, O,&palette );
|
||||
if( error != LIVIDO_NO_ERROR )
|
||||
return LIVIDO_ERROR_HARDWARE;
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
|
||||
lvd_extract_channel_values( my_instance, "in_channels" , 0, &w, &h, A, &palette );
|
||||
|
||||
int amplitude = lvd_extract_param_index( my_instance,"in_parameters", 0 );
|
||||
|
||||
snprintf(cmd,sizeof(cmd),"-draw_whirl %d", amplitude );
|
||||
|
||||
lvdgmic_push( gmic, w, h, palette, A, 0);
|
||||
|
||||
lvdgmic_gmic( gmic, cmd );
|
||||
|
||||
lvdgmic_pull( gmic, 0, O );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
livido_port_t *livido_setup(livido_setup_t list[], int version)
|
||||
|
||||
{
|
||||
LIVIDO_IMPORT(list);
|
||||
|
||||
livido_port_t *port = NULL;
|
||||
livido_port_t *in_params[1];
|
||||
livido_port_t *in_chans[3];
|
||||
livido_port_t *out_chans[1];
|
||||
livido_port_t *info = NULL;
|
||||
livido_port_t *filter = NULL;
|
||||
|
||||
//@ setup root node, plugin info
|
||||
info = livido_port_new( LIVIDO_PORT_TYPE_PLUGIN_INFO );
|
||||
port = info;
|
||||
|
||||
livido_set_string_value( port, "maintainer", "Niels");
|
||||
livido_set_string_value( port, "version","1");
|
||||
|
||||
filter = livido_port_new( LIVIDO_PORT_TYPE_FILTER_CLASS );
|
||||
livido_set_int_value( filter, "api_version", LIVIDO_API_VERSION );
|
||||
|
||||
//@ setup function pointers
|
||||
livido_set_voidptr_value( filter, "deinit_func", &deinit_instance );
|
||||
livido_set_voidptr_value( filter, "init_func", &init_instance );
|
||||
livido_set_voidptr_value( filter, "process_func", &process_instance );
|
||||
port = filter;
|
||||
|
||||
//@ meta information
|
||||
livido_set_string_value( port, "name", "G'MIC/GREYs Whirl drawing");
|
||||
livido_set_string_value( port, "description", "Apply whirl drawing effect on image");
|
||||
livido_set_string_value( port, "author", "GREYC's Magic for Image Computing");
|
||||
|
||||
livido_set_int_value( port, "flags", LIVIDO_FILTER_NON_REALTIME);
|
||||
livido_set_string_value( port, "license", "GPL2");
|
||||
livido_set_int_value( port, "version", 1);
|
||||
|
||||
//@ some palettes veejay-classic uses
|
||||
int palettes0[] = {
|
||||
LIVIDO_PALETTE_YUV422P,
|
||||
0,
|
||||
};
|
||||
|
||||
//@ setup output channel
|
||||
out_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = out_chans[0];
|
||||
|
||||
livido_set_string_value( port, "name", "Output Channel");
|
||||
livido_set_int_array( port, "palette_list", 3, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = in_chans[0];
|
||||
livido_set_string_value( port, "name", "Input Channel");
|
||||
livido_set_int_array( port, "palette_list", 4, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_params[0] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[0];
|
||||
|
||||
livido_set_string_value(port, "name", "Amplitude" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 100 );
|
||||
livido_set_int_value( port, "default", 20 );
|
||||
livido_set_string_value( port, "description" ,"Amplitude");
|
||||
|
||||
livido_set_portptr_array( filter, "in_parameter_templates",1,in_params );
|
||||
livido_set_portptr_array( filter, "out_channel_templates",1,out_chans );
|
||||
livido_set_portptr_array( filter, "in_channel_templates",1,in_chans );
|
||||
|
||||
livido_set_portptr_value(info, "filters", filter);
|
||||
return info;
|
||||
}
|
||||
194
veejay-current/plugin-packs/lvdgmic/plugins/gmic_wind.c
Normal file
194
veejay-current/plugin-packs/lvdgmic/plugins/gmic_wind.c
Normal file
@@ -0,0 +1,194 @@
|
||||
/*
|
||||
* LIBVJE - veejay fx library
|
||||
*
|
||||
* Copyright(C)2015 Niels Elburg <nwelburg@gmail.com>
|
||||
* See COPYING for software license and distribution details
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef IS_LIVIDO_PLUGIN
|
||||
#define IS_LIVIDO_PLUGIN
|
||||
#endif
|
||||
|
||||
#include "livido.h"
|
||||
LIVIDO_PLUGIN
|
||||
#include "utils.h"
|
||||
#include "livido-utils.c"
|
||||
#include "lvd_common.h"
|
||||
#include "lvdgmicglue.h"
|
||||
|
||||
livido_init_f init_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = lvdgmic_new(1);
|
||||
|
||||
livido_property_set( my_instance, "PLUGIN_private",
|
||||
LIVIDO_ATOM_TYPE_VOIDPTR,1,&gmic );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_deinit_f deinit_instance( livido_port_t *my_instance )
|
||||
{
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
lvdgmic_delete(gmic);
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
livido_process_f process_instance( livido_port_t *my_instance, double timecode )
|
||||
{
|
||||
uint8_t *A[4] = {NULL,NULL,NULL,NULL};
|
||||
uint8_t *O[4]= {NULL,NULL,NULL,NULL};
|
||||
char cmd[256];
|
||||
int palette;
|
||||
int w;
|
||||
int h;
|
||||
|
||||
int error = lvd_extract_channel_values( my_instance, "out_channels", 0, &w,&h, O,&palette );
|
||||
if( error != LIVIDO_NO_ERROR )
|
||||
return LIVIDO_ERROR_HARDWARE;
|
||||
Clvdgmic *gmic = NULL;
|
||||
livido_property_get( my_instance, "PLUGIN_private",0, &gmic);
|
||||
|
||||
lvd_extract_channel_values( my_instance, "in_channels" , 0, &w, &h, A, &palette );
|
||||
|
||||
int amplitude = lvd_extract_param_index( my_instance,"in_parameters", 0 );
|
||||
int angle = lvd_extract_param_index( my_instance,"in_parameters", 1 );
|
||||
int attenuation = lvd_extract_param_index(my_instance, "in_parameters",2);
|
||||
int threshold = lvd_extract_param_index(my_instance, "in_parameters",3);
|
||||
int mode = lvd_extract_param_index(my_instance,"in_parameters",4);
|
||||
|
||||
snprintf(cmd,sizeof(cmd),"-wind %d,%d,%f,%d,%d", amplitude, angle,(float)attenuation/100.0f,threshold,mode);
|
||||
|
||||
lvdgmic_push( gmic, w, h, palette, A, 0);
|
||||
|
||||
lvdgmic_gmic( gmic, cmd );
|
||||
|
||||
lvdgmic_pull( gmic, 0, O );
|
||||
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
livido_port_t *livido_setup(livido_setup_t list[], int version)
|
||||
|
||||
{
|
||||
LIVIDO_IMPORT(list);
|
||||
|
||||
livido_port_t *port = NULL;
|
||||
livido_port_t *in_params[5];
|
||||
livido_port_t *in_chans[3];
|
||||
livido_port_t *out_chans[1];
|
||||
livido_port_t *info = NULL;
|
||||
livido_port_t *filter = NULL;
|
||||
|
||||
//@ setup root node, plugin info
|
||||
info = livido_port_new( LIVIDO_PORT_TYPE_PLUGIN_INFO );
|
||||
port = info;
|
||||
|
||||
livido_set_string_value( port, "maintainer", "Niels");
|
||||
livido_set_string_value( port, "version","1");
|
||||
|
||||
filter = livido_port_new( LIVIDO_PORT_TYPE_FILTER_CLASS );
|
||||
livido_set_int_value( filter, "api_version", LIVIDO_API_VERSION );
|
||||
|
||||
//@ setup function pointers
|
||||
livido_set_voidptr_value( filter, "deinit_func", &deinit_instance );
|
||||
livido_set_voidptr_value( filter, "init_func", &init_instance );
|
||||
livido_set_voidptr_value( filter, "process_func", &process_instance );
|
||||
port = filter;
|
||||
|
||||
//@ meta information
|
||||
livido_set_string_value( port, "name", "G'MIC/GREYs Wind");
|
||||
livido_set_string_value( port, "description", "Apply wind effect on image");
|
||||
livido_set_string_value( port, "author", "GREYC's Magic for Image Computing");
|
||||
|
||||
livido_set_int_value( port, "flags", LIVIDO_FILTER_NON_REALTIME);
|
||||
livido_set_string_value( port, "license", "GPL2");
|
||||
livido_set_int_value( port, "version", 1);
|
||||
|
||||
//@ some palettes veejay-classic uses
|
||||
int palettes0[] = {
|
||||
LIVIDO_PALETTE_YUV422P,
|
||||
LIVIDO_PALETTE_YUV444P,
|
||||
LIVIDO_PALETTE_RGBFLOAT,
|
||||
LIVIDO_PALETTE_A8,
|
||||
0,
|
||||
};
|
||||
|
||||
//@ setup output channel
|
||||
out_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = out_chans[0];
|
||||
|
||||
livido_set_string_value( port, "name", "Output Channel");
|
||||
livido_set_int_array( port, "palette_list", 3, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_chans[0] = livido_port_new( LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE );
|
||||
port = in_chans[0];
|
||||
livido_set_string_value( port, "name", "Input Channel");
|
||||
livido_set_int_array( port, "palette_list", 4, palettes0);
|
||||
livido_set_int_value( port, "flags", 0);
|
||||
|
||||
in_params[0] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[0];
|
||||
|
||||
livido_set_string_value(port, "name", "Amplitude" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 500 );
|
||||
livido_set_int_value( port, "default", 20 );
|
||||
livido_set_string_value( port, "description" ,"Amplitude");
|
||||
|
||||
|
||||
in_params[1] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[1];
|
||||
|
||||
livido_set_string_value(port, "name", "Angle" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 360 );
|
||||
livido_set_int_value( port, "default", 0 );
|
||||
livido_set_string_value( port, "description" ,"Angle");
|
||||
|
||||
in_params[2] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[2];
|
||||
|
||||
livido_set_string_value(port, "name", "Attenuation" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 100 );
|
||||
livido_set_int_value( port, "default", 70 );
|
||||
livido_set_string_value( port, "description" ,"Attenuation");
|
||||
|
||||
in_params[3] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[3];
|
||||
|
||||
livido_set_string_value(port, "name", "Threshold" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 100 );
|
||||
livido_set_int_value( port, "default", 20 );
|
||||
livido_set_string_value( port, "description" ,"Threshold");
|
||||
|
||||
in_params[4] = livido_port_new( LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE );
|
||||
port = in_params[4];
|
||||
|
||||
livido_set_string_value(port, "name", "Mode" );
|
||||
livido_set_string_value(port, "kind", "INDEX" );
|
||||
livido_set_int_value( port, "min", 0 );
|
||||
livido_set_int_value( port, "max", 1 );
|
||||
livido_set_int_value( port, "default", 0 );
|
||||
livido_set_string_value( port, "description" ,"Mode");
|
||||
|
||||
|
||||
//@ setup the nodes
|
||||
livido_set_portptr_array( filter, "in_parameter_templates",5, in_params );
|
||||
livido_set_portptr_array( filter, "out_channel_templates", 1, out_chans );
|
||||
livido_set_portptr_array( filter, "in_channel_templates",1, in_chans );
|
||||
|
||||
livido_set_portptr_value(info, "filters", filter);
|
||||
return info;
|
||||
}
|
||||
358
veejay-current/plugin-packs/lvdgmic/plugins/livido-utils.c
Normal file
358
veejay-current/plugin-packs/lvdgmic/plugins/livido-utils.c
Normal file
@@ -0,0 +1,358 @@
|
||||
/* LiViDO 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.
|
||||
|
||||
LiViDO 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 this source code; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
LiViDO is developed by:
|
||||
|
||||
Niels Elburg - http://veejay.sf.net
|
||||
|
||||
Gabriel "Salsaman" Finch - http://lives.sourceforge.net
|
||||
|
||||
Denis "Jaromil" Rojo - http://freej.dyne.org
|
||||
|
||||
Tom Schouten - http://zwizwa.fartit.com
|
||||
|
||||
Andraz Tori - http://cvs.cinelerra.org
|
||||
|
||||
reviewed with suggestions and contributions from:
|
||||
|
||||
Silvano "Kysucix" Galliani - http://freej.dyne.org
|
||||
|
||||
Kentaro Fukuchi - http://megaui.net/fukuchi
|
||||
|
||||
Jun Iio - http://www.malib.net
|
||||
|
||||
Carlo Prelz - http://www2.fluido.as:8080/
|
||||
|
||||
*/
|
||||
|
||||
/* (C) Gabriel "Salsaman" Finch, 2005 */
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "livido.h"
|
||||
|
||||
int livido_has_property (livido_port_t *port, const char *key) {
|
||||
if (livido_property_get(port,key,0,NULL)==LIVIDO_ERROR_NOSUCH_PROPERTY) return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// property setters
|
||||
|
||||
int livido_set_int_value (livido_port_t *port, const char *key, int value) {
|
||||
// returns a LIVIDO_ERROR
|
||||
return livido_property_set (port,key,LIVIDO_ATOM_TYPE_INT,1,&value);
|
||||
}
|
||||
|
||||
int livido_set_double_value (livido_port_t *port, const char *key, double value) {
|
||||
// returns a LIVIDO_ERROR
|
||||
return livido_property_set (port,key,LIVIDO_ATOM_TYPE_DOUBLE,1,&value);
|
||||
}
|
||||
|
||||
int livido_set_boolean_value (livido_port_t *port, const char *key, int value) {
|
||||
// returns a LIVIDO_ERROR
|
||||
return livido_property_set (port,key,LIVIDO_ATOM_TYPE_BOOLEAN,1,&value);
|
||||
}
|
||||
|
||||
int livido_set_string_value (livido_port_t *port, const char *key, char *value) {
|
||||
// returns a LIVIDO_ERROR
|
||||
return livido_property_set (port,key,LIVIDO_ATOM_TYPE_STRING,1,&value);
|
||||
}
|
||||
|
||||
int livido_set_portptr_value (livido_port_t *port, const char *key, void *value) {
|
||||
// returns a LIVIDO_ERROR
|
||||
return livido_property_set (port,key,LIVIDO_ATOM_TYPE_PORTPTR,1,&value);
|
||||
}
|
||||
|
||||
int livido_set_voidptr_value (livido_port_t *port, const char *key, void *value) {
|
||||
// returns a LIVIDO_ERROR
|
||||
return livido_property_set (port,key,LIVIDO_ATOM_TYPE_VOIDPTR,1,&value);
|
||||
}
|
||||
|
||||
|
||||
/////////// these functions need a size ////////////
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// general property getter
|
||||
|
||||
inline int livido_get_value (livido_port_t *port, const char *key, void *value) {
|
||||
// returns a LIVIDO_ERROR
|
||||
return livido_property_get( port, key, 0, value);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
int livido_get_int_value (livido_port_t *port, const char *key, int *error) {
|
||||
int retval=0;
|
||||
if (livido_has_property(port,key)&&livido_property_atom_type(port,key)!=LIVIDO_ATOM_TYPE_INT) {
|
||||
*error=LIVIDO_ERROR_WRONG_ATOM_TYPE;
|
||||
return retval;
|
||||
}
|
||||
else *error=livido_get_value (port,key,&retval);
|
||||
return retval;
|
||||
}
|
||||
|
||||
double livido_get_double_value (livido_port_t *port, const char *key, int *error) {
|
||||
double retval=0.;
|
||||
if (livido_has_property(port,key)&&livido_property_atom_type(port,key)!=LIVIDO_ATOM_TYPE_DOUBLE) {
|
||||
*error=LIVIDO_ERROR_WRONG_ATOM_TYPE;
|
||||
return retval;
|
||||
}
|
||||
*error=livido_get_value (port,key,&retval);
|
||||
return retval;
|
||||
}
|
||||
|
||||
int livido_get_boolean_value (livido_port_t *port, const char *key, int *error) {
|
||||
int retval=0;
|
||||
if (livido_has_property(port,key)&&livido_property_atom_type(port,key)!=LIVIDO_ATOM_TYPE_BOOLEAN) {
|
||||
*error=LIVIDO_ERROR_WRONG_ATOM_TYPE;
|
||||
return retval;
|
||||
}
|
||||
*error=livido_get_value (port,key,&retval);
|
||||
return retval;
|
||||
}
|
||||
|
||||
char *livido_get_string_value (livido_port_t *port, const char *key, int *error) {
|
||||
char *retval=NULL;
|
||||
if (livido_has_property(port,key)&&livido_property_atom_type(port,key)!=LIVIDO_ATOM_TYPE_STRING) {
|
||||
*error=LIVIDO_ERROR_WRONG_ATOM_TYPE;
|
||||
return NULL;
|
||||
}
|
||||
if ((retval=(char *)livido_malloc(livido_property_element_size(port,key,0)+1))==NULL) {
|
||||
*error=LIVIDO_ERROR_MEMORY_ALLOCATION;
|
||||
return NULL;
|
||||
}
|
||||
if ((*error=livido_get_value (port,key,&retval))!=LIVIDO_NO_ERROR) {
|
||||
livido_free (retval);
|
||||
return NULL;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
void *livido_get_voidptr_value (livido_port_t *port, const char *key, int *error) {
|
||||
void *retval=NULL;
|
||||
if (livido_has_property(port,key)&&livido_property_atom_type(port,key)!=LIVIDO_ATOM_TYPE_VOIDPTR) {
|
||||
*error=LIVIDO_ERROR_WRONG_ATOM_TYPE;
|
||||
return retval;
|
||||
}
|
||||
*error=livido_get_value (port,key,&retval);
|
||||
return retval;
|
||||
}
|
||||
|
||||
livido_port_t *livido_get_portptr_value (livido_port_t *port, const char *key, int *error) {
|
||||
livido_port_t *retval=NULL;
|
||||
if (livido_has_property(port,key)&&livido_property_atom_type(port,key)!=LIVIDO_ATOM_TYPE_PORTPTR) {
|
||||
*error=LIVIDO_ERROR_WRONG_ATOM_TYPE;
|
||||
return retval;
|
||||
}
|
||||
*error=livido_get_value (port,key,&retval);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
int *livido_get_int_array (livido_port_t *port, const char *key, int *error) {
|
||||
int i;
|
||||
int num_elems;
|
||||
int *retval;
|
||||
|
||||
if (livido_has_property(port,key)&&livido_property_atom_type(port,key)!=LIVIDO_ATOM_TYPE_INT) {
|
||||
*error=LIVIDO_ERROR_WRONG_ATOM_TYPE;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if ((num_elems=livido_property_num_elements (port,key))==0) return NULL;
|
||||
|
||||
if ((retval=(int *)livido_malloc(num_elems*sizeof(int)))==NULL) {
|
||||
*error=LIVIDO_ERROR_MEMORY_ALLOCATION;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (i=0;i<num_elems;i++) {
|
||||
if ((*error=livido_property_get(port, key, i, &retval[i]))!=LIVIDO_NO_ERROR) {
|
||||
livido_free (retval);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
double *livido_get_double_array (livido_port_t *port, const char *key, int *error) {
|
||||
int i;
|
||||
int num_elems;
|
||||
double *retval;
|
||||
|
||||
if (livido_has_property(port,key)&&livido_property_atom_type(port,key)!=LIVIDO_ATOM_TYPE_DOUBLE) {
|
||||
*error=LIVIDO_ERROR_WRONG_ATOM_TYPE;
|
||||
return NULL;
|
||||
}
|
||||
if ((num_elems=livido_property_num_elements (port,key))==0) return NULL;
|
||||
|
||||
if ((retval=(double *)livido_malloc(num_elems*sizeof(double)))==NULL) {
|
||||
*error=LIVIDO_ERROR_MEMORY_ALLOCATION;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (i=0;i<num_elems;i++) {
|
||||
if ((*error=livido_property_get(port, key, i, &retval[i]))!=LIVIDO_NO_ERROR) {
|
||||
livido_free (retval);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
int *livido_get_boolean_array (livido_port_t *port, const char *key, int *error) {
|
||||
int i;
|
||||
int num_elems;
|
||||
int *retval;
|
||||
|
||||
if (livido_has_property(port,key)&&livido_property_atom_type(port,key)!=LIVIDO_ATOM_TYPE_BOOLEAN) {
|
||||
*error=LIVIDO_ERROR_WRONG_ATOM_TYPE;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if ((num_elems=livido_property_num_elements (port,key))==0) return NULL;
|
||||
|
||||
if ((retval=(int *)livido_malloc(num_elems*sizeof(int)))==NULL) {
|
||||
*error=LIVIDO_ERROR_MEMORY_ALLOCATION;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (i=0;i<num_elems;i++) {
|
||||
if ((*error=livido_property_get(port, key, i, &retval[i]))!=LIVIDO_NO_ERROR) {
|
||||
livido_free (retval);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
char **livido_get_string_array (livido_port_t *port, const char *key, int *error) {
|
||||
int i;
|
||||
int num_elems;
|
||||
char **retval;
|
||||
|
||||
if (livido_has_property(port,key)&&livido_property_atom_type(port,key)!=LIVIDO_ATOM_TYPE_STRING) {
|
||||
*error=LIVIDO_ERROR_WRONG_ATOM_TYPE;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if ((num_elems=livido_property_num_elements (port,key))==0) return NULL;
|
||||
|
||||
if ((retval=(char **)livido_malloc(num_elems*sizeof(char *)))==NULL) {
|
||||
*error=LIVIDO_ERROR_MEMORY_ALLOCATION;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (i=0;i<num_elems;i++) {
|
||||
if ((retval[i]=(char *)livido_malloc(livido_property_element_size(port,key,i)+1))==NULL) {
|
||||
for (--i;i>=0;i--) livido_free(retval[i]);
|
||||
*error=LIVIDO_ERROR_MEMORY_ALLOCATION;
|
||||
livido_free (retval);
|
||||
return NULL;
|
||||
}
|
||||
if ((*error=livido_property_get(port, key, i, &retval[i]))!=LIVIDO_NO_ERROR) {
|
||||
for (--i;i>=0;i--) livido_free(retval[i]);
|
||||
livido_free (retval);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
void **livido_get_voidptr_array (livido_port_t *port, const char *key, int *error) {
|
||||
int i;
|
||||
int num_elems;
|
||||
void **retval;
|
||||
|
||||
if (livido_has_property(port,key)&&livido_property_atom_type(port,key)!=LIVIDO_ATOM_TYPE_VOIDPTR) {
|
||||
*error=LIVIDO_ERROR_WRONG_ATOM_TYPE;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if ((num_elems=livido_property_num_elements (port,key))==0) return NULL;
|
||||
|
||||
if ((retval=(void **)livido_malloc(num_elems*sizeof(void *)))==NULL) {
|
||||
*error=LIVIDO_ERROR_MEMORY_ALLOCATION;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (i=0;i<num_elems;i++) {
|
||||
if ((*error=livido_property_get(port, key, i, &retval[i]))!=LIVIDO_NO_ERROR) {
|
||||
livido_free (retval);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
livido_port_t **livido_get_portptr_array (livido_port_t *port, const char *key, int *error) {
|
||||
int i;
|
||||
int num_elems;
|
||||
livido_port_t **retval;
|
||||
|
||||
if (livido_has_property(port,key)&&livido_property_atom_type(port,key)!=LIVIDO_ATOM_TYPE_PORTPTR) {
|
||||
*error=LIVIDO_ERROR_WRONG_ATOM_TYPE;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if ((num_elems=livido_property_num_elements (port,key))==0) return NULL;
|
||||
|
||||
if ((retval=(livido_port_t **)livido_malloc(num_elems*sizeof(livido_port_t *)))==NULL) {
|
||||
*error=LIVIDO_ERROR_MEMORY_ALLOCATION;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (i=0;i<num_elems;i++) {
|
||||
if ((*error=livido_property_get(port, key, i, &retval[i]))!=LIVIDO_NO_ERROR) {
|
||||
livido_free (retval);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
int livido_set_int_array (livido_port_t *port, const char *key, int num_elems, int *values) {
|
||||
return livido_property_set (port,key,LIVIDO_ATOM_TYPE_INT,num_elems,values);
|
||||
}
|
||||
|
||||
int livido_set_double_array (livido_port_t *port, const char *key, int num_elems, double *values) {
|
||||
return livido_property_set (port,key,LIVIDO_ATOM_TYPE_DOUBLE,num_elems,values);
|
||||
}
|
||||
|
||||
int livido_set_boolean_array (livido_port_t *port, const char *key, int num_elems, int *values) {
|
||||
return livido_property_set (port,key,LIVIDO_ATOM_TYPE_BOOLEAN,num_elems,values);
|
||||
}
|
||||
|
||||
int livido_set_string_array (livido_port_t *port, const char *key, int num_elems, char **values) {
|
||||
return livido_property_set (port,key,LIVIDO_ATOM_TYPE_STRING,num_elems,values);
|
||||
}
|
||||
|
||||
int livido_set_voidptr_array (livido_port_t *port, const char *key, int num_elems, void **values) {
|
||||
return livido_property_set (port,key,LIVIDO_ATOM_TYPE_VOIDPTR,num_elems,values);
|
||||
}
|
||||
|
||||
int livido_set_portptr_array (livido_port_t *port, const char *key, int num_elems, livido_port_t **values) {
|
||||
return livido_property_set (port,key,LIVIDO_ATOM_TYPE_PORTPTR,num_elems,values);
|
||||
}
|
||||
|
||||
212
veejay-current/plugin-packs/lvdgmic/plugins/livido.h
Normal file
212
veejay-current/plugin-packs/lvdgmic/plugins/livido.h
Normal file
@@ -0,0 +1,212 @@
|
||||
/*
|
||||
(C) Copyright 2005
|
||||
Gabriel "Salsaman" Finch,
|
||||
Niels Elburg,
|
||||
Dennis "Jaromil" Rojo,
|
||||
Daniel Fischer,
|
||||
Martin Bayer,
|
||||
Kentaro Fukuchi,
|
||||
Andraz Tori.
|
||||
|
||||
|
||||
Revised by Niels, 2010 ( 101 )
|
||||
2011 ( 102 )
|
||||
|
||||
LiViDO 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.
|
||||
|
||||
LiViDO 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 this source code; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
*/
|
||||
#ifndef __LIVIDO_H__
|
||||
#define __LIVIDO_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define LIVIDO_BEGIN_DECLS extern "C" {
|
||||
#define LIVIDO_END_DECLS }
|
||||
#else
|
||||
#define LIVIDO_BEGIN_DECLS
|
||||
#define LIVIDO_END_DECLS
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE (0)
|
||||
#endif
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE (!FALSE)
|
||||
#endif
|
||||
|
||||
LIVIDO_BEGIN_DECLS
|
||||
#include <sys/types.h>
|
||||
|
||||
|
||||
#ifdef IS_LIVIDO_PLUGIN
|
||||
typedef void livido_port_t;
|
||||
#endif
|
||||
#define LIVIDO_API_VERSION 102
|
||||
#define LIVIDO_PALETTE_RGB888 1
|
||||
#define LIVIDO_PALETTE_RGB24 1
|
||||
#define LIVIDO_PALETTE_BGR888 2
|
||||
#define LIVIDO_PALETTE_BGR24 2
|
||||
#define LIVIDO_PALETTE_RGBA8888 3
|
||||
#define LIVIDO_PALETTE_RGBA32 3
|
||||
#define LIVIDO_PALETTE_ARGB8888 4
|
||||
#define LIVIDO_PALETTE_ARGB32 4
|
||||
|
||||
#define LIVIDO_PALETTE_RGBFLOAT 5
|
||||
#define LIVIDO_PALETTE_ARGBFLOAT 6
|
||||
|
||||
#define LIVIDO_PALETTE_RGB48BE 7
|
||||
#define LIVIDO_PALETTE_RGB48LE 8
|
||||
#define LIVIDO_PALETTE_YUV444P16LE 9
|
||||
#define LIVIDO_PALETTE_YUV444P16BE 10
|
||||
#define LIVIDO_PALETTE_YUV422P16LE 11
|
||||
#define LIVIDO_PALETTE_YUV422P16BE 12
|
||||
#define LIVIDO_PALETTE_YUV422P 513
|
||||
#define LIVIDO_PALETTE_YV16 513
|
||||
#define LIVIDO_PALETTE_YUV420P 514
|
||||
#define LIVIDO_PALETTE_YV12 514
|
||||
#define LIVIDO_PALETTE_YVU420P 515
|
||||
#define LIVIDO_PALETTE_I420 515
|
||||
|
||||
#define LIVIDO_PALETTE_YUV444P 516
|
||||
#define LIVIDO_PALETTE_YUV4444P 517
|
||||
#define LIVIDO_PALETTE_YUV444P16 523
|
||||
#define LIVIDO_PALETTE_YUYV8888 518
|
||||
#define LIVIDO_PALETTE_UYVY8888 519
|
||||
#define LIVIDO_PALETTE_YUV411 520
|
||||
#define LIVIDO_PALETTE_YUV888 521
|
||||
#define LIVIDO_PALETTE_YUVA8888 522
|
||||
#define LIVIDO_PALETTE_A1 1025
|
||||
#define LIVIDO_PALETTE_A8 1026
|
||||
#define LIVIDO_PALETTE_A16 1028
|
||||
#define LIVIDO_PALETTE_AFLOAT 1027
|
||||
|
||||
//@ do we want openmp?
|
||||
|
||||
#define LIVIDO_FILTER_NON_REALTIME (1<<0)
|
||||
#define LIVIDO_FILTER_CAN_DO_INPLACE (1<<1)
|
||||
#define LIVIDO_FILTER_NON_STATELESS (1<<2)
|
||||
#define LIVIDO_FILTER_IS_CONVERTOR (1<<3)
|
||||
#define LIVIDO_CHANNEL_CHANGE_UNADVISED (1<<0)
|
||||
#define LIVIDO_CHANNEL_PALETTE_UNADVISED (1<<1)
|
||||
#define LIVIDO_PARAMETER_CHANGE_UNADVISED (1<<0)
|
||||
#define LIVIDO_PROPERTY_READONLY (1<<0)
|
||||
|
||||
#define LIVIDO_INTERLACE_NONE 0
|
||||
#define LIVIDO_INTERLACE_TOPFIRST 1
|
||||
#define LIVIDO_INTERLACE_BOTTOMFIRST 2
|
||||
#define LIVIDO_INTERLACE_PROGRESSIVE 3
|
||||
#define LIVIDO_NO_ERROR 0
|
||||
#define LIVIDO_ERROR_MEMORY_ALLOCATION 1
|
||||
#define LIVIDO_ERROR_PROPERTY_READONLY 2
|
||||
#define LIVIDO_ERROR_NOSUCH_ELEMENT 3
|
||||
#define LIVIDO_ERROR_NOSUCH_PROPERTY 4
|
||||
#define LIVIDO_ERROR_WRONG_ATOM_TYPE 5
|
||||
#define LIVIDO_ERROR_TOO_MANY_INSTANCES 6
|
||||
#define LIVIDO_ERROR_HARDWARE 7
|
||||
#define LIVIDO_ERROR_PORT 8 //@ error in port
|
||||
|
||||
#define LIVIDO_ATOM_TYPE_INT 1
|
||||
#define LIVIDO_ATOM_TYPE_DOUBLE 2
|
||||
#define LIVIDO_ATOM_TYPE_BOOLEAN 3
|
||||
#define LIVIDO_ATOM_TYPE_STRING 4
|
||||
#define LIVIDO_ATOM_TYPE_VOIDPTR 65
|
||||
#define LIVIDO_ATOM_TYPE_PORTPTR 66
|
||||
|
||||
#define LIVIDO_PORT_TYPE_PLUGIN_INFO 1
|
||||
#define LIVIDO_PORT_TYPE_FILTER_CLASS 2
|
||||
#define LIVIDO_PORT_TYPE_FILTER_INSTANCE 3
|
||||
#define LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE 4
|
||||
#define LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE 5
|
||||
#define LIVIDO_PORT_TYPE_CHANNEL 6
|
||||
#define LIVIDO_PORT_TYPE_PARAMETER 7
|
||||
#define LIVIDO_PORT_TYPE_GUI 8
|
||||
|
||||
//#define FUNCSTRUCT
|
||||
/*
|
||||
Uncomment the #define above and recompile all
|
||||
*/
|
||||
|
||||
typedef int (*livido_init_f) (livido_port_t * filter_instance);
|
||||
typedef int (*livido_process_f) (livido_port_t * filter_instance,double timestamp);
|
||||
typedef int (*livido_deinit_f) (livido_port_t * filter_instance);
|
||||
|
||||
|
||||
typedef void *(*livido_malloc_f) (size_t size);
|
||||
typedef void (*livido_free_f) (void *ptr);
|
||||
typedef void *(*livido_memset_f) (void *s, int c, size_t n);
|
||||
typedef void *(*livido_memcpy_f) (void *dest, const void *src, size_t n);
|
||||
typedef livido_port_t *(*livido_port_new_f) (int);
|
||||
typedef void (*livido_port_free_f) (livido_port_t * port);
|
||||
typedef int (*livido_property_set_f) (livido_port_t *, const char *, int, int, void *);
|
||||
typedef int (*livido_property_get_f) (livido_port_t *, const char *, int, void *);
|
||||
typedef int (*livido_property_num_elements_f) (livido_port_t *, const char *);
|
||||
typedef int (*livido_property_atom_type_f) (livido_port_t *, const char *);
|
||||
typedef size_t(*livido_property_element_size_f) (livido_port_t *, const char *, const int);
|
||||
typedef char **(*livido_list_properties_f) (livido_port_t *);
|
||||
typedef int (*livido_keyframe_get_f)(livido_port_t *port, long pos, int dir );
|
||||
typedef int (*livido_keyframe_put_f)(livido_port_t *port, long pos, int dir );
|
||||
|
||||
//@ what about openmp
|
||||
//@ automatic top/bottom half processing, using 2 threads.
|
||||
//@ maybe with preprocessor directives
|
||||
//typedef int (*livido_set_max_threads)(livido_port_t *port, int max );
|
||||
|
||||
typedef struct
|
||||
{
|
||||
void (*f)();
|
||||
// void *f;
|
||||
} livido_setup_t;
|
||||
|
||||
typedef livido_port_t *(*livido_setup_f) (const livido_setup_t list[], int );
|
||||
|
||||
#define LIVIDO_PLUGIN \
|
||||
static livido_port_t *(*livido_port_new) (int) = 0;\
|
||||
static void (*livido_port_free) (livido_port_t * port) = 0;\
|
||||
static int (*livido_property_set) (livido_port_t * port,const char *key, int atom_type, int num_elems, void *value) = 0;\
|
||||
static int (*livido_property_get) (livido_port_t * port,const char *key, int idx, void *value) = 0;\
|
||||
static int (*livido_property_num_elements) (livido_port_t * port,const char *key) = 0;\
|
||||
static int (*livido_property_atom_type) (livido_port_t * port,const char *key) = 0;\
|
||||
static size_t(*livido_property_element_size) (livido_port_t * port,const char *key, const int idx) = 0;\
|
||||
static char **(*livido_list_properties) (livido_port_t * port) = 0;\
|
||||
static void *(*livido_malloc) (size_t size) = 0;\
|
||||
static void (*livido_free) (void *ptr) = 0;\
|
||||
static void *(*livido_memset) (void *s, int c, size_t n) = 0;\
|
||||
static void *(*livido_memcpy) (void *dest, const void *src, size_t n) = 0;\
|
||||
static int (*livido_keyframe_get)(livido_port_t *port, long pos, int dir) = 0;\
|
||||
static int (*livido_keyframe_put)(livido_port_t *port, long pos, int dir) = 0; \
|
||||
|
||||
/* Using void* to pass base address of function, needs explicit typecast and host
|
||||
must match ordering */
|
||||
#define LIVIDO_IMPORT(list) \
|
||||
{\
|
||||
livido_malloc = (livido_malloc_f) list[0].f;\
|
||||
livido_free = (livido_free_f) list[1].f;\
|
||||
livido_memset = (livido_memset_f) list[2].f;\
|
||||
livido_memcpy = (livido_memcpy_f) list[3].f;\
|
||||
livido_port_new = (livido_port_new_f) list[4].f;\
|
||||
livido_port_free = (livido_port_free_f) list[5].f;\
|
||||
livido_property_set = (livido_property_set_f) list[6].f;\
|
||||
livido_property_get = (livido_property_get_f) list[7].f;\
|
||||
livido_property_num_elements = (livido_property_num_elements_f) list[8].f;\
|
||||
livido_property_atom_type = (livido_property_atom_type_f) list[9].f;\
|
||||
livido_property_element_size = (livido_property_element_size_f) list[10].f;\
|
||||
livido_list_properties = (livido_list_properties_f) list[11].f;\
|
||||
livido_keyframe_get = (livido_keyframe_get_f) list[12].f;\
|
||||
livido_keyframe_put = (livido_keyframe_put_f) list[13].f;\
|
||||
}
|
||||
|
||||
LIVIDO_END_DECLS
|
||||
#endif // #ifndef __LIVIDO_H_
|
||||
31
veejay-current/plugin-packs/lvdgmic/plugins/lvd_common.h
Normal file
31
veejay-current/plugin-packs/lvdgmic/plugins/lvd_common.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* LIBVJE - veejay fx library
|
||||
*
|
||||
* Copyright(C)2015 Niels Elburg <nwelburg@gmail.com>
|
||||
* See COPYING for software license and distribution details
|
||||
*/
|
||||
|
||||
#ifndef LVD_COMMON_H
|
||||
#define LVD_COMMON_H
|
||||
|
||||
#define GIMP_rgb2yuv(r,g,b,y,u,v)\
|
||||
{\
|
||||
float Ey = (0.299 * (float)r) + (0.587 * (float)g) + (0.114 * (float) b);\
|
||||
float Eu = (-0.168736 * (float)r) - (0.331264 * (float)g) + (0.500 * (float)b) + 128.0;\
|
||||
float Ev = (0.500 * (float)r) - (0.418688 * (float)g) - (0.081312 * (float)b)+ 128.0;\
|
||||
y = myround(Ey);\
|
||||
u = myround(Eu);\
|
||||
v = myround(Ev);\
|
||||
}
|
||||
|
||||
#define CCIR601_rgb2yuv(r,g,b,y,u,v) \
|
||||
{\
|
||||
float Ey = (0.299f * (float)r) + (0.587f * (float) g) + (0.114f * (float)b );\
|
||||
float Eu = (0.713f * ( ((float)r) - Ey ) );\
|
||||
float Ev = (0.564f * ( ((float)b) - Ey ) );\
|
||||
y = (int) ( 255.0 * Ey );\
|
||||
u = (int) (( 255.0 * Eu ) + 128);\
|
||||
v = (int) (( 255.0 * Ev ) + 128);\
|
||||
}
|
||||
|
||||
#endif
|
||||
203
veejay-current/plugin-packs/lvdgmic/plugins/utils.h
Normal file
203
veejay-current/plugin-packs/lvdgmic/plugins/utils.h
Normal file
@@ -0,0 +1,203 @@
|
||||
#ifndef LVDUTILSFX
|
||||
#define LVDUTILSFX
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#ifdef STRICT_CHECKING
|
||||
#include <assert.h>
|
||||
#endif
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#ifdef ARCH_X86
|
||||
#define fast_sin(d,x) asm("fsin" : "=t" (d) : "0" (x))
|
||||
#define fast_cos(d,x) asm("fcos" : "=t" (d) : "0" (x))
|
||||
#define fast_sqrt(res,x) asm ("fsqrt" : "=t" (res) : "0" (x))
|
||||
#define sin_cos(si, co, x) asm ("fsincos" : "=t" (co), "=u" (si) : "0" (x))
|
||||
#else
|
||||
#define fast_sin(d,x) d = sin(x)
|
||||
#define fast_cos(d,x) d = cos(x)
|
||||
#define fast_sqrt( res,x ) res = sqrt(x)
|
||||
#define sin_cos(si, co, x) si = sin(x); co = cos(x)
|
||||
|
||||
#endif
|
||||
static inline int myround(float n)
|
||||
{
|
||||
if (n >= 0)
|
||||
return (int)(n + 0.5);
|
||||
else
|
||||
return (int)(n - 0.5);
|
||||
}
|
||||
|
||||
#define _rgb2yuv(r,g,b,y,u,v)\
|
||||
{\
|
||||
float Ey = (0.299 * (float)r) + (0.587 * (float)g) + (0.114 * (float) b);\
|
||||
float Eu = (-0.168736 * (float)r) - (0.331264 * (float)g) + (0.500 * (float)b) + 128.0;\
|
||||
float Ev = (0.500 * (float)r) - (0.418688 * (float)g) - (0.081312 * (float)b)+ 128.0;\
|
||||
y = myround(Ey);\
|
||||
u = myround(Eu);\
|
||||
v = myround(Ev);\
|
||||
if( y > 0xff ) y = 0xff ; else if ( y < 0 ) y = 0;\
|
||||
if( u > 0xff ) u = 0xff ; else if ( u < 0 ) u = 0;\
|
||||
if( v > 0xff ) v = 0xff ; else if ( v < 0 ) v = 0;\
|
||||
}
|
||||
|
||||
|
||||
#ifdef USE_MATRIX_PLACEMENT
|
||||
typedef struct
|
||||
{
|
||||
int w;
|
||||
int h;
|
||||
} matrix_t;
|
||||
|
||||
typedef matrix_t (*matrix_f)(int i, int s, int w, int h);
|
||||
static matrix_t matrix_placementA(int photoindex, int size, int w , int h);
|
||||
static matrix_t matrix_placementB(int photoindex, int size, int w , int h);
|
||||
static matrix_f get_matrix_func(int type);
|
||||
|
||||
static matrix_t matrix_placementA(int photoindex, int size, int w , int h)
|
||||
{
|
||||
matrix_t m;
|
||||
m.w = (photoindex % size) * (w/size);
|
||||
m.h = (photoindex / size) * (h/size);
|
||||
return m;
|
||||
}
|
||||
|
||||
static matrix_t matrix_placementB(int photoindex, int size, int w , int h)
|
||||
{
|
||||
matrix_t m;
|
||||
m.w = (photoindex/size) * (w/size);
|
||||
m.h = (photoindex % size) * (h/size);
|
||||
return m;
|
||||
}
|
||||
|
||||
static matrix_t matrix_placementC(int photoindex, int size, int w , int h)
|
||||
{
|
||||
matrix_t m;
|
||||
int n = size*size-1;
|
||||
m.w = ((n-photoindex) % size) * (w/size);
|
||||
m.h = ((n-photoindex) / size) * (h/size);
|
||||
return m;
|
||||
}
|
||||
|
||||
static matrix_t matrix_placementD(int photoindex, int size, int w , int h)
|
||||
{
|
||||
matrix_t m;
|
||||
int n = size*size-1;
|
||||
m.w = ((n-photoindex) / size) * (w/size);
|
||||
m.h = ((n-photoindex) % size) * (h/size);
|
||||
return m;
|
||||
}
|
||||
|
||||
static matrix_f get_matrix_func(int type)
|
||||
{
|
||||
if(type==0)
|
||||
return &matrix_placementA;
|
||||
if(type==1)
|
||||
return &matrix_placementB;
|
||||
if(type==2)
|
||||
return &matrix_placementC;
|
||||
return &matrix_placementD;
|
||||
}
|
||||
#endif
|
||||
|
||||
static double lvd_extract_param_number( livido_port_t *instance, const char *pname, int n )
|
||||
{
|
||||
double pn = 0.0;
|
||||
livido_port_t *c = NULL;
|
||||
int error = livido_property_get( instance, pname,n, &c );
|
||||
#ifdef STRICT_CHECKING
|
||||
assert( error == LIVIDO_NO_ERROR );
|
||||
#endif
|
||||
|
||||
error = livido_property_get( c, "value", 0, &pn );
|
||||
if( error != LIVIDO_NO_ERROR ) {
|
||||
printf(" --> %s idx %d invalid\n", pname, n );
|
||||
}
|
||||
#ifdef STRICT_CHECKING
|
||||
assert( error == LIVIDO_NO_ERROR );
|
||||
#endif
|
||||
return pn;
|
||||
}
|
||||
|
||||
|
||||
static int lvd_extract_param_index( livido_port_t *instance, const char *pname, int n )
|
||||
{
|
||||
int pn = 0;
|
||||
livido_port_t *c = NULL;
|
||||
int error = livido_property_get( instance, pname,n, &c );
|
||||
if( error != LIVIDO_NO_ERROR )
|
||||
return 0;
|
||||
livido_property_get( c, "value", 0, &pn );
|
||||
return pn;
|
||||
}
|
||||
|
||||
static int lvd_extract_param_boolean( livido_port_t *instance, const char *pname, int n )
|
||||
{
|
||||
int pn = 0;
|
||||
livido_port_t *c = NULL;
|
||||
int error = livido_property_get( instance, pname,n, &c );
|
||||
if( error != LIVIDO_NO_ERROR )
|
||||
return 0;
|
||||
livido_property_get( c, "value", 0, &pn );
|
||||
return pn;
|
||||
}
|
||||
static void lvd_set_param_number( livido_port_t *instance, const char *pname,int id, double num )
|
||||
{
|
||||
livido_port_t *c = NULL;
|
||||
int error = livido_property_get( instance, pname,id, &c );
|
||||
if(error!=LIVIDO_NO_ERROR)
|
||||
return;
|
||||
livido_property_set( c, "value",LIVIDO_ATOM_TYPE_DOUBLE, 1, &num );
|
||||
}
|
||||
|
||||
static int lvd_extract_channel_values( livido_port_t *instance,
|
||||
const char *pname,
|
||||
int n,
|
||||
int *w,
|
||||
int *h,
|
||||
uint8_t **pixel_data,
|
||||
int *palette )
|
||||
{
|
||||
livido_port_t *c = NULL;
|
||||
int error = livido_property_get( instance, pname,n, &c );
|
||||
error = livido_property_get( c, "width", 0,w );
|
||||
#ifdef STRICT_CHECKING
|
||||
if(error!=LIVIDO_NO_ERROR) printf("%s: width not found\n",__FUNCTION__);
|
||||
assert( error == LIVIDO_NO_ERROR );
|
||||
#endif
|
||||
if( error != LIVIDO_NO_ERROR )
|
||||
return error;
|
||||
error = livido_property_get( c, "height",0,h );
|
||||
#ifdef STRICT_CHECKING
|
||||
if(error!=LIVIDO_NO_ERROR) printf("%s: height not found\n",__FUNCTION__);
|
||||
|
||||
assert( error == LIVIDO_NO_ERROR );
|
||||
#endif
|
||||
if( error != LIVIDO_NO_ERROR )
|
||||
return error;
|
||||
error = livido_property_get( c, "current_palette",0, palette );
|
||||
#ifdef STRICT_CHECKING
|
||||
if(error!=LIVIDO_NO_ERROR) printf("%s: current_palette not found\n",__FUNCTION__);
|
||||
|
||||
assert( error == LIVIDO_NO_ERROR );
|
||||
#endif
|
||||
if( error != LIVIDO_NO_ERROR )
|
||||
return error;
|
||||
|
||||
int i = 0;
|
||||
for( i = 0; i <4 ; i ++ )
|
||||
{
|
||||
error = livido_property_get( c, "pixel_data", i, &(pixel_data[i]));
|
||||
#ifdef STRICT_CHECKING
|
||||
if( error != LIVIDO_NO_ERROR )
|
||||
printf("%s: pixel_data[%d] not set in %s %d\n",__FUNCTION__,i,pname,n);
|
||||
assert( error == LIVIDO_NO_ERROR );
|
||||
#endif
|
||||
if( error != LIVIDO_NO_ERROR )
|
||||
return error;
|
||||
}
|
||||
return LIVIDO_NO_ERROR;
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user