コード例 #1
0
ファイル: gmic_wave.c プロジェクト: c0ntrol/veejay
int		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_NO_OUTPUT_CHANNELS; 
	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;
}
コード例 #2
0
ファイル: gmic_oldscool8bits.c プロジェクト: flv0/veejay
int		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_NO_OUTPUT_CHANNELS; 
	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;
}
コード例 #3
0
ファイル: gmic_crystal.c プロジェクト: c0ntrol/veejay
int		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_NO_OUTPUT_CHANNELS; 
	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;
}
コード例 #4
0
ファイル: gmic_abstraction.c プロジェクト: c0ntrol/veejay
int		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_NO_OUTPUT_CHANNELS; 
	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;
}
コード例 #5
0
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;
}
コード例 #6
0
ファイル: gmic_posterhope.c プロジェクト: flv0/veejay
int		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_NO_OUTPUT_CHANNELS; 
	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;
}
コード例 #7
0
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;
}
コード例 #8
0
ファイル: gmic_posteredges.c プロジェクト: flv0/veejay
int		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_NO_OUTPUT_CHANNELS; 
	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;
}