mirror of
https://github.com/game-stop/veejay.git
synced 2025-12-20 14:50:01 +01:00
add cracks,lightpatch,noisehurl,wave,wind to gmic plugin pack
This commit is contained in:
@@ -4,14 +4,21 @@ LDFLAGS=-g -Wall -lstdc++ -lgmic -shared
|
||||
|
||||
OBJS=lvdgmic.o lvdgmicglue.o
|
||||
CARTOON_SO=gmic_cartoon.so
|
||||
CRACKS_SO=gmic_cracks.so
|
||||
BOKEY_SO=gmic_bokeh.so
|
||||
PENCILBW_SO=gmic_pencilbw.so
|
||||
ARRAYFADE_SO=gmic_arrayfade.so
|
||||
PENCILPORTRAIT_SO=gmic_pencilportrait.so
|
||||
RODILIUS_SO=gmic_rodilius.so
|
||||
WATER_SO=gmic_water.so
|
||||
WAVE_SO=gmic_wave.so
|
||||
WIND_SO=gmic_wind.so
|
||||
LIGHTPATCH_SO=gmic_lightpatch.so
|
||||
NOISEHURL_SO=gmic_noisehurl.so
|
||||
|
||||
all: $(CARTOON_SO) $(BOKEY_SO) $(PENCILBW_SO) $(ARRAYFADE_SO) $(RODILIUS_SO) $(WATER_SO) $(WAVE_SO) $(WIND_SO) $(CRACKS_SO) \
|
||||
$(LIGHTPATCH_SO) $(NOISEHURL_SO)
|
||||
|
||||
all: $(CARTOON_SO) $(BOKEY_SO) $(PENCILBW_SO) $(ARRAYFADE_SO) $(RODILIUS_SO) $(WATER_SO)
|
||||
default:all
|
||||
|
||||
%.o: %.cc
|
||||
@@ -44,7 +51,27 @@ $(WATER_SO): $(OBJS) gmic_water.o
|
||||
$(CC) $(OBJS) $(LDFLAGS) -o $@
|
||||
$(CC) $(CFLAGS) -shared $^ -lgmic -o $@
|
||||
|
||||
$(WAVE_SO): $(OBJS) gmic_wave.o
|
||||
$(CC) $(OBJS) $(LDFLAGS) -o $@
|
||||
$(CC) $(CFLAGS) -shared $^ -lgmic -o $@
|
||||
|
||||
$(WIND_SO): $(OBJS) gmic_wind.o
|
||||
$(CC) $(OBJS) $(LDFLAGS) -o $@
|
||||
$(CC) $(CFLAGS) -shared $^ -lgmic -o $@
|
||||
|
||||
$(CRACKS_SO): $(OBJS) gmic_cracks.o
|
||||
$(CC) $(OBJS) $(LDFLAGS) -o $@
|
||||
$(CC) $(CFLAGS) -shared $^ -lgmic -o $@
|
||||
|
||||
$(LIGHTPATCH_SO): $(OBJS) gmic_lightpatch.o
|
||||
$(CC) $(OBJS) $(LDFLAGS) -o $@
|
||||
$(CC) $(CFLAGS) -shared $^ -lgmic -o $@
|
||||
|
||||
$(NOISEHURL_SO): $(OBJS) gmic_noisehurl.o
|
||||
$(CC) $(OBJS) $(LDFLAGS) -o $@
|
||||
$(CC) $(CFLAGS) -shared $^ -lgmic -o $@
|
||||
|
||||
clean:
|
||||
rm -f *.o
|
||||
rm -f $(CARTOON_SO) $(BOKEY_SO) $(PENCLIBW_SO) $(ARRAYFADE_SO) $(RODILIUS_SO) $(WATER_SO)
|
||||
rm -f $(CARTOON_SO) $(BOKEY_SO) $(PENCLIBW_SO) $(ARRAYFADE_SO) $(RODILIUS_SO) $(WATER_SO) $(WAVE_SO) $(WIND_SO) $(CRACKS_SO) \
|
||||
$(LIGHTPATCH_SO) $(NOISEHURL_SO)
|
||||
|
||||
178
veejay-current/plugin-packs/lvdgmic/src/gmic_cracks.c
Normal file
178
veejay-current/plugin-packs/lvdgmic/src/gmic_cracks.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 )
|
||||
{
|
||||
int len =0;
|
||||
int i = 0;
|
||||
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 uv_len = lvd_uv_plane_len( palette,w,h );
|
||||
len = w * h;
|
||||
|
||||
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,
|
||||
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", "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;
|
||||
}
|
||||
178
veejay-current/plugin-packs/lvdgmic/src/gmic_lightpatch.c
Normal file
178
veejay-current/plugin-packs/lvdgmic/src/gmic_lightpatch.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 )
|
||||
{
|
||||
int len =0;
|
||||
int i = 0;
|
||||
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 uv_len = lvd_uv_plane_len( palette,w,h );
|
||||
len = w * h;
|
||||
|
||||
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", 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);
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
154
veejay-current/plugin-packs/lvdgmic/src/gmic_noisehurl.c
Normal file
154
veejay-current/plugin-packs/lvdgmic/src/gmic_noisehurl.c
Normal file
@@ -0,0 +1,154 @@
|
||||
/*
|
||||
* 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 )
|
||||
{
|
||||
int len =0;
|
||||
int i = 0;
|
||||
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 uv_len = lvd_uv_plane_len( palette,w,h );
|
||||
len = w * h;
|
||||
|
||||
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,
|
||||
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", 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;
|
||||
}
|
||||
188
veejay-current/plugin-packs/lvdgmic/src/gmic_wave.c
Normal file
188
veejay-current/plugin-packs/lvdgmic/src/gmic_wave.c
Normal file
@@ -0,0 +1,188 @@
|
||||
/*
|
||||
* 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 )
|
||||
{
|
||||
int len =0;
|
||||
int i = 0;
|
||||
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 uv_len = lvd_uv_plane_len( palette,w,h );
|
||||
len = w * h;
|
||||
|
||||
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, 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 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_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", 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;
|
||||
}
|
||||
199
veejay-current/plugin-packs/lvdgmic/src/gmic_wind.c
Normal file
199
veejay-current/plugin-packs/lvdgmic/src/gmic_wind.c
Normal file
@@ -0,0 +1,199 @@
|
||||
/*
|
||||
* 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 )
|
||||
{
|
||||
int len =0;
|
||||
int i = 0;
|
||||
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 uv_len = lvd_uv_plane_len( palette,w,h );
|
||||
len = w * h;
|
||||
|
||||
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, 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[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", 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);
|
||||
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user