Exemplo n.º 1
0
t_jit_err jit_coerce_init(void)
{
	long attrflags=0;
	t_jit_object *attr,*mop,*o;

	_jit_coerce_class = jit_class_new("jit_coerce",(method)jit_coerce_new,(method)jit_coerce_free,
									  sizeof(t_jit_coerce),0L);

	//add mop
	mop = jit_object_new(_jit_sym_jit_mop,1,1); //#inputs,#outputs
	jit_mop_output_nolink(mop,1);
	jit_class_addadornment(_jit_coerce_class,mop);
	//add methods
	jit_class_addmethod(_jit_coerce_class, (method)jit_coerce_matrix_calc, 		"matrix_calc", 		A_CANT, 0L);
	//add attributes
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;
	attr = jit_object_new(_jit_sym_jit_attr_offset,"type",_jit_sym_symbol,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_coerce,type));
	object_addattr_parse(attr,"category",_jit_sym_symbol,0,"MOP");
	object_addattr_parse(attr,"basic",_jit_sym_long,0,"1");
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"Type");
	jit_class_addattr(_jit_coerce_class,attr);
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"planecount",_jit_sym_long,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_coerce,planecount));
	object_addattr_parse(attr,"category",_jit_sym_symbol,0,"MOP");
	object_addattr_parse(attr,"basic",_jit_sym_long,0,"1");
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"Planecount");
	jit_class_addattr(_jit_coerce_class,attr);

	jit_class_register(_jit_coerce_class);

	return JIT_ERR_NONE;
}
Exemplo n.º 2
0
t_jit_err jit_findbounds_init(void) 
{
	long attrflags=0;
	t_jit_object *attr,*mop;
	
	_jit_findbounds_class = jit_class_new("jit_findbounds",(method)jit_findbounds_new,(method)jit_findbounds_free,
		sizeof(t_jit_findbounds),0L);

	//add mop
	mop = jit_object_new(_jit_sym_jit_mop,1,0);
	jit_class_addadornment(_jit_findbounds_class,mop);
	//add methods
	jit_class_addmethod(_jit_findbounds_class, (method)jit_findbounds_matrix_calc, 		"matrix_calc", 		A_CANT, 0L);
	//add attributes	
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;
	attr = jit_object_new(_jit_sym_jit_attr_offset_array,"min",_jit_sym_float64,JIT_MATRIX_MAX_PLANECOUNT,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_findbounds, mincount),calcoffset(t_jit_findbounds,min));
	jit_class_addattr(_jit_findbounds_class,attr);
	attr = jit_object_new(_jit_sym_jit_attr_offset_array,"max",_jit_sym_float64,JIT_MATRIX_MAX_PLANECOUNT,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_findbounds, maxcount),calcoffset(t_jit_findbounds,max));
	jit_class_addattr(_jit_findbounds_class,attr);
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_OPAQUE_USER;
	attr = jit_object_new(_jit_sym_jit_attr_offset_array,"boundmin",_jit_sym_long,JIT_MATRIX_MAX_DIMCOUNT,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_findbounds, boundmincount),calcoffset(t_jit_findbounds,boundmin));
	jit_class_addattr(_jit_findbounds_class,attr);
	attr = jit_object_new(_jit_sym_jit_attr_offset_array,"boundmax",_jit_sym_long,JIT_MATRIX_MAX_DIMCOUNT,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_findbounds, boundmaxcount),calcoffset(t_jit_findbounds,boundmax));
	jit_class_addattr(_jit_findbounds_class,attr);
	
	jit_class_register(_jit_findbounds_class);

	return JIT_ERR_NONE;
}
Exemplo n.º 3
0
t_jit_err jit_field_mesh_init(void)
{
	long attrflags=0;
	t_jit_object *attr;
		
	_jit_field_mesh_class = jit_class_new("jit_field_mesh",(method)jit_field_mesh_new,(method)jit_field_mesh_free,
		sizeof(t_jit_field_mesh),0L);

	// add attributes	
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;
	
	jit_class_addmethod(_jit_field_mesh_class, (method)jit_field_mesh_jit_field, "jit_field", A_GIMME, 0L);
	jit_class_addmethod(_jit_field_mesh_class, (method)jit_field_mesh_get_vertex_matrix, "get_vertex_matrix", A_CANT, 0L);
	jit_class_addmethod(_jit_field_mesh_class, (method)jit_field_mesh_get_normal_matrix, "get_normal_matrix", A_CANT, 0L);
	jit_class_addmethod(_jit_field_mesh_class, (method)jit_field_mesh_get_index_matrix, "get_index_matrix",	A_CANT, 0L);
	jit_class_addmethod(_jit_field_mesh_class, (method)jit_field_mesh_volume_to_mesh, "volume_to_mesh",	A_CANT, 0L);
	
	
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset, "isolevel", _jit_sym_float32, attrflags,
				(method)0L, (method)0L, calcoffset(t_jit_field_mesh, isolevel));
    jit_class_addattr(_jit_field_mesh_class, (t_jit_object*)attr);
	
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset, "mode", _jit_sym_symbol, attrflags,
				(method)0L, (method)0L, calcoffset(t_jit_field_mesh, mode));
    jit_class_addattr(_jit_field_mesh_class, (t_jit_object*)attr);
	CLASS_ATTR_ENUM((t_class *)_jit_field_mesh_class, "mode", 0, "mesh particles");

	jit_class_register(_jit_field_mesh_class);

	return JIT_ERR_NONE;
}
Exemplo n.º 4
0
t_jit_err jit_3m_init(void) 
{
	long attrflags=0;
	t_jit_object *attr,*mop;
	
	_jit_3m_class = jit_class_new("jit_3m",(method)jit_3m_new,(method)jit_3m_free,
		sizeof(t_jit_3m),0L);

	//add mop
	mop = jit_object_new(_jit_sym_jit_mop,1,0);
	jit_class_addadornment(_jit_3m_class,mop);
	//add methods
	jit_class_addmethod(_jit_3m_class, (method)jit_3m_matrix_calc, 		"matrix_calc", 		A_CANT, 0L);
	//add attributes	
	attrflags = JIT_ATTR_SET_OPAQUE_USER | JIT_ATTR_GET_DEFER_LOW;
	attr = jit_object_new(_jit_sym_jit_attr_offset_array,"min",_jit_sym_atom,JIT_MATRIX_MAX_PLANECOUNT,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_3m,planecount),calcoffset(t_jit_3m,min));
	jit_class_addattr(_jit_3m_class,attr);
	attr = jit_object_new(_jit_sym_jit_attr_offset_array,"mean",_jit_sym_atom,JIT_MATRIX_MAX_PLANECOUNT,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_3m,planecount),calcoffset(t_jit_3m,mean));
	jit_class_addattr(_jit_3m_class,attr);
	attr = jit_object_new(_jit_sym_jit_attr_offset_array,"max",_jit_sym_atom,JIT_MATRIX_MAX_PLANECOUNT,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_3m,planecount),calcoffset(t_jit_3m,max));
	jit_class_addattr(_jit_3m_class,attr);
	
	jit_class_register(_jit_3m_class);

	return JIT_ERR_NONE;
}
Exemplo n.º 5
0
t_jit_err jit_scissors_init(void) 
{
	long attrflags=0;
	void *attr, *mop;
	
	_jit_scissors_class = jit_class_new("jit_scissors", (method)jit_scissors_new, (method)jit_scissors_free,
		sizeof(t_jit_scissors), 0L);

	//add mop
	mop = jit_object_new(_jit_sym_jit_mop, 1, -1); //#inputs, #outputs(variable)
	jit_class_addadornment(_jit_scissors_class, mop);
	//add methods
	jit_class_addmethod(_jit_scissors_class, (method)jit_scissors_matrix_calc, 		"matrix_calc", 		A_CANT, 0L);
	//add attributes	
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;
	attr = jit_object_new(_jit_sym_jit_attr_offset, "rows", _jit_sym_long, attrflags,
		(method)0, (method)0, calcoffset(t_jit_scissors, rows));
	jit_attr_addfilterset_clip(attr, 1, 16, 1, 1);
	jit_class_addattr(_jit_scissors_class, attr);
	attr = jit_object_new(_jit_sym_jit_attr_offset, "columns", _jit_sym_long, attrflags,
		(method)0, (method)0, calcoffset(t_jit_scissors, cols));
	jit_attr_addfilterset_clip(attr, 1, 16, 1, 1);
	jit_class_addattr(_jit_scissors_class, attr);

	attrflags = JIT_ATTR_GET_OPAQUE_USER | JIT_ATTR_SET_OPAQUE_USER;
	attr = jit_object_new(_jit_sym_jit_attr_offset, "max", _jit_sym_long, attrflags,
		(method)0, (method)0, calcoffset(t_jit_scissors, max));
	jit_class_addattr(_jit_scissors_class, attr);

	jit_class_register(_jit_scissors_class);

	return JIT_ERR_NONE;
}
Exemplo n.º 6
0
t_jit_err jit_glue_init(void) 
{
	long attrflags=0;
	void *attr,*mop,*o;
	
	_jit_glue_class = jit_class_new("jit_glue",(method)jit_glue_new,(method)jit_glue_free,
		sizeof(t_jit_glue),0L);

	//add mop
	mop = jit_object_new(_jit_sym_jit_mop,-1,1); //#inputs,#outputs(variable)
	o = jit_object_method(mop,_jit_sym_getoutput,1);
	jit_attr_setlong(o,_jit_sym_dimlink,0);
	jit_class_addadornment(_jit_glue_class,mop);
	//add methods
	jit_class_addmethod(_jit_glue_class, (method)jit_glue_matrix_calc, 		"matrix_calc", 		A_CANT, 0L);
	//add attributes	
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;
	attr = jit_object_new(_jit_sym_jit_attr_offset,"rows",_jit_sym_long,attrflags,
		(method)0,(method)0,calcoffset(t_jit_glue,rows));
	jit_attr_addfilterset_clip(attr,1,16,1,1);
	jit_class_addattr(_jit_glue_class,attr);
	attr = jit_object_new(_jit_sym_jit_attr_offset,"columns",_jit_sym_long,attrflags,
		(method)0,(method)0,calcoffset(t_jit_glue,cols));
	jit_attr_addfilterset_clip(attr,1,16,1,1);
	jit_class_addattr(_jit_glue_class,attr);

	attrflags = JIT_ATTR_GET_OPAQUE_USER | JIT_ATTR_SET_OPAQUE_USER;
	attr = jit_object_new(_jit_sym_jit_attr_offset,"input",_jit_sym_long,attrflags,
		(method)0,(method)0,calcoffset(t_jit_glue,input));
	jit_class_addattr(_jit_glue_class,attr);

	jit_class_register(_jit_glue_class);

	return JIT_ERR_NONE;
}
Exemplo n.º 7
0
t_jit_err jit_fluoride_init(void)
{
	long attrflags=0;
	t_jit_object *attr, *mop;

	_jit_fluoride_class = jit_class_new("jit_fluoride",(method)jit_fluoride_new,(method)jit_fluoride_free,
										sizeof(t_jit_fluoride),0L);

	//add mop
	mop = jit_object_new(_jit_sym_jit_mop,1,1); //#inputs,#outputs
	jit_mop_single_type(mop,_jit_sym_char);
	jit_mop_single_planecount(mop,4);
	jit_class_addadornment(_jit_fluoride_class,mop);

	//add methods
	jit_class_addmethod(_jit_fluoride_class, (method)jit_fluoride_matrix_calc, 		"matrix_calc", 		A_CANT, 0L);

	//add attributes
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;

	CLASS_STICKY_CATEGORY(_jit_fluoride_class,0,"Behavior");
	CLASS_STICKY_ATTR(_jit_fluoride_class,"basic",0,"1");

	// glow -- sets color for neon effect
	attr = jit_object_new(_jit_sym_jit_attr_offset_array, "glow", _jit_sym_float64, 3,
						  attrflags, (method)0L, (method)0L, calcoffset(t_jit_fluoride, glowcount),
						  calcoffset(t_jit_fluoride,glow));
	jit_class_addattr(_jit_fluoride_class,attr);
	CLASS_ATTR_STYLE_LABEL(_jit_fluoride_class,"glow",0,"rgb","Glow Color");

	// lum -- moves center luminosity
	attr = jit_object_new(_jit_sym_jit_attr_offset,"lum",_jit_sym_float64,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_fluoride,lum));
	jit_class_addattr(_jit_fluoride_class,attr);
	CLASS_ATTR_LABEL(_jit_fluoride_class,"lum",0,"Luminosity");

	// tol -- width of neon tolerance
	attr = jit_object_new(_jit_sym_jit_attr_offset,"tol",_jit_sym_float64,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_fluoride,tol));
	jit_class_addattr(_jit_fluoride_class,attr);
	CLASS_ATTR_LABEL(_jit_fluoride_class,"tol",0,"Tolerance");

	// mode -- b/w (0) or color (1)
	attr = jit_object_new(_jit_sym_jit_attr_offset,"mode",_jit_sym_long,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_fluoride,mode));
	jit_class_addattr(_jit_fluoride_class,attr);
	CLASS_ATTR_LABEL(_jit_fluoride_class,"mode",0,"Color Mode");
	CLASS_ATTR_ENUMINDEX(_jit_fluoride_class, "mode", 0, "\"Black and White\" Color");

	CLASS_STICKY_CATEGORY_CLEAR(_jit_fluoride_class);
	CLASS_STICKY_ATTR_CLEAR(_jit_fluoride_class, "basic");

	jit_class_register(_jit_fluoride_class);

	return JIT_ERR_NONE;
}
Exemplo n.º 8
0
t_jit_err cv_jit_lines_init(void) 
{
	long attrflags=0;
	t_jit_object *attr,*mop,*output;
	
	_cv_jit_lines_class = jit_class_new("cv_jit_lines",(method)cv_jit_lines_new,(method)cv_jit_lines_free,
		sizeof(t_cv_jit_lines),0L);

	//add mop
	mop = (t_jit_object *)jit_object_new(_jit_sym_jit_mop,1,1);  //Object has one input and one output

   	jit_mop_single_type(mop,_jit_sym_char);   //Set input type and planecount
   	jit_mop_single_planecount(mop,1);  
   	jit_mop_output_nolink(mop,1); //Turn off output linking so that output matrix does not adapt to input
   	
   	output = (t_jit_object *)jit_object_method(mop,_jit_sym_getoutput,1); //Get a pointer to the output matrix
   	jit_attr_setlong(output,_jit_sym_minplanecount,4);  //Set output plane count
  	jit_attr_setlong(output,_jit_sym_maxplanecount,4); //4 -> Coordinates of start and end points for each line
  	jit_attr_setlong(output,_jit_sym_mindim,1);  //Only one dimension
  	jit_attr_setlong(output,_jit_sym_maxdim,1);
  	jit_attr_setsym(output,_jit_sym_types,_jit_sym_long);
  	
  	jit_class_addadornment(_cv_jit_lines_class,mop);
  	
	//add methods
	jit_class_addmethod(_cv_jit_lines_class, (method)cv_jit_lines_matrix_calc, 		"matrix_calc", 		A_CANT, 0L);
	
	//add attributes	
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,"threshold",_jit_sym_float64,attrflags,
		(method)0L,(method)0L,calcoffset(t_cv_jit_lines,threshold));
	jit_attr_addfilterset_clip(attr,1,255,TRUE,TRUE);	//clip to 1-255
	jit_class_addattr(_cv_jit_lines_class,attr);
	
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,"resolution",_jit_sym_long,attrflags,
		(method)0L,(method)0L,calcoffset(t_cv_jit_lines,resolution));
	jit_attr_addfilterset_clip(attr,1,10,TRUE,TRUE);	//clip to 1-10
	jit_class_addattr(_cv_jit_lines_class,attr);
	
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,"gap",_jit_sym_float64,attrflags,
		(method)0L,(method)0L,calcoffset(t_cv_jit_lines,gap));
	jit_class_addattr(_cv_jit_lines_class,attr);
	
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,"length",_jit_sym_float64,attrflags,
		(method)0L,(method)0L,calcoffset(t_cv_jit_lines,length));
	jit_class_addattr(_cv_jit_lines_class,attr);
	
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,"sensitivity",_jit_sym_long,attrflags,
		(method)0L,(method)0L,calcoffset(t_cv_jit_lines,sensitivity));
	jit_attr_addfilterset_clip(attr,1,255,TRUE,TRUE);	//clip to 1-255
	jit_class_addattr(_cv_jit_lines_class,attr);
	
	jit_class_register(_cv_jit_lines_class);

	return JIT_ERR_NONE;
}
Exemplo n.º 9
0
t_jit_err xray_jit_fdm_init(void) 
{
	long attrflags=0;
	t_jit_object *attr,*mop,*o;
	t_symbol *atsym;
	t_atom a[1];
	
	atsym = gensym("jit_attr_offset");
	
	_xray_jit_fdm_class = jit_class_new("xray_jit_fdm",(method)xray_jit_fdm_new,(method)xray_jit_fdm_free,
		sizeof(t_xray_jit_fdm),0L);

	//add mop
	mop = jit_object_new(_jit_sym_jit_mop,1,1);
	jit_mop_single_planecount(mop,1);	
	jit_atom_setsym(a,_jit_sym_float32);
	
	o = jit_object_method(mop,_jit_sym_getoutput,1);
	jit_object_method(o,_jit_sym_types,1,a);
	
	jit_class_addadornment(_xray_jit_fdm_class,mop);
	
	//add methods
	jit_class_addmethod(_xray_jit_fdm_class, (method)xray_jit_fdm_matrix_calc, 		"matrix_calc", 		A_CANT, 0L);
	
	//add attributes	
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;
	
	//spacestep
	attr = jit_object_new(atsym,"spacestep",_jit_sym_float32,attrflags,
		(method)0L,(method)0L,calcoffset(t_xray_jit_fdm,spacestep));
	jit_class_addattr(_xray_jit_fdm_class,attr);
	
	//direction
	attr = jit_object_new(_jit_sym_jit_attr_offset,"direction",_jit_sym_symbol,attrflags,
		(method)0L,(method)0L,calcoffset(t_xray_jit_fdm, direction));	
	jit_class_addattr(_xray_jit_fdm_class,attr);
	
	//generate symbols
	ps_x 	= gensym("x");
	ps_y 	= gensym("y");
	ps_xx	= gensym("xx");
	ps_xy 	= gensym("xy");
	ps_yx 	= gensym("yx");
	ps_yy 	= gensym("yy");

	jit_class_register(_xray_jit_fdm_class);
	
	return JIT_ERR_NONE;
}
Exemplo n.º 10
0
t_jit_err jit_gradient_init(void) 
{
	long attrflags=0;
	t_jit_object *attr;
	t_jit_object *mop;
	
	_jit_gradient_class = jit_class_new("jit_gradient",(method)jit_gradient_new,(method)jit_gradient_free,
		sizeof(t_jit_gradient),0L);

	//add mop
	mop = jit_object_new(_jit_sym_jit_mop,1,1);
	jit_mop_single_type(mop, _jit_sym_char);
	jit_mop_single_planecount(mop, 4);
	jit_class_addadornment(_jit_gradient_class,mop);
	//add methods
	jit_class_addmethod(_jit_gradient_class, (method)jit_gradient_matrix_calc, "matrix_calc", A_CANT, 0L);

	//add attributes	
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;

	CLASS_STICKY_CATEGORY(_jit_gradient_class,0,"Behavior");
	CLASS_STICKY_ATTR(_jit_gradient_class,"basic",0,"1");

	// start - beginning gradient cell
	attr = jit_object_new(_jit_sym_jit_attr_offset_array, "start", _jit_sym_float64, 4, 
		attrflags, (method)0L, (method)0L, calcoffset(t_jit_gradient, startcount),
		calcoffset(t_jit_gradient,start));
	jit_class_addattr(_jit_gradient_class,attr);
	CLASS_ATTR_LABEL(_jit_gradient_class,"start",0,"Start");	
	
	attr = jit_object_new(_jit_sym_jit_attr_offset_array, "end", _jit_sym_float64, 4, 
		attrflags, (method)0L, (method)0L, calcoffset(t_jit_gradient, endcount),
		calcoffset(t_jit_gradient,end));
	jit_class_addattr(_jit_gradient_class,attr);
	CLASS_ATTR_LABEL(_jit_gradient_class,"end",0,"End");	

	attr = jit_object_new(_jit_sym_jit_attr_offset_array, "cheby", _jit_sym_float64, 64, 
		attrflags, (method)0L, (method)0L, calcoffset(t_jit_gradient, chebycount),
		calcoffset(t_jit_gradient,cheby));
	jit_class_addattr(_jit_gradient_class,attr);
	CLASS_ATTR_LABEL(_jit_gradient_class,"cheby",0,"Chebyshev Coefficients");	

	CLASS_STICKY_CATEGORY_CLEAR(_jit_gradient_class);
	CLASS_STICKY_ATTR_CLEAR(_jit_gradient_class, "basic");

	jit_class_register(_jit_gradient_class);

	return JIT_ERR_NONE;
}
Exemplo n.º 11
0
t_jit_err GainClassInit(void)
{
    long			attrflags = 0;// = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;
    t_jit_object	*attr;
    t_jit_object	*mop;

    s_gain_class = (t_class*)jit_class_new((char*)"j_gain", (method)GainNew, (method)GainFree, sizeof(t_gain), 0);

    // add matrix operator (mop)
    mop = (t_jit_object*)jit_object_new(_jit_sym_jit_mop, 1, 1); // args are  num inputs and num outputs
    jit_class_addadornment(s_gain_class, mop);

    // add method(s)
    jit_class_addmethod(s_gain_class, (method)GainMatrixCalc, (char*)"matrix_calc", A_CANT, 0);

    // add attribute(s)
    attr = (t_jit_object*)jit_object_new(_jit_sym_jit_attr_offset,
                                         "gain",
                                         _jit_sym_float32,
                                         attrflags,
                                         (method)GainGetGain, (method)GainSetGain,
                                         NULL);
    jit_class_addattr(s_gain_class, attr);

    // finalize class
    jit_class_register(s_gain_class);
    return JIT_ERR_NONE;
}
Exemplo n.º 12
0
t_jit_err cv_jit_LKflow_init(void) 
{
	long 			attrflags=0;
	t_jit_object 	*attr,*mop;
	
	_cv_jit_LKflow_class = jit_class_new("cv_jit_LKflow",(method)cv_jit_LKflow_new,(method)cv_jit_LKflow_free,sizeof(t_cv_jit_LKflow),A_CANT,0L); //A_CANT = untyped

	//add mop
	mop = (t_jit_object *)jit_object_new(_jit_sym_jit_mop,1,1);
	jit_mop_single_type(mop,_jit_sym_float32);	
	jit_mop_single_planecount(mop,2);	
	jit_class_addadornment(_cv_jit_LKflow_class,mop);
	
	//add methods
	jit_class_addmethod(_cv_jit_LKflow_class, (method)cv_jit_LKflow_matrix_calc, 		"matrix_calc", 		A_CANT, 0L);
	
	//add attributes	
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,"radius",_jit_sym_long,attrflags,(method)0L,(method)0L,calcoffset(t_cv_jit_LKflow,radius));
	jit_attr_addfilterset_clip(attr,1,7,TRUE,TRUE);	//clip to 1-7
	jit_class_addattr(_cv_jit_LKflow_class,attr);
	
	jit_class_register(_cv_jit_LKflow_class);

	return JIT_ERR_NONE;
}
Exemplo n.º 13
0
t_jit_err jit_pcl_freenect_init(void)
{
    long			attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;
    t_jit_object	*attr;
    t_jit_object	*mop;
    t_atom a[1];
    
    s_jit_pcl_freenect_class = jit_class_new("jit_pcl_freenect",
                                             (method)jit_pcl_freenect_new,
                                             (method)jit_pcl_freenect_free,
                                             sizeof(t_jit_pcl_freenect),
                                             0);
    
    mop = (t_jit_object *)jit_object_new(_jit_sym_jit_mop, 0, 2);
    
    jit_class_addadornment(s_jit_pcl_freenect_class, mop);
    
    jit_class_addmethod(s_jit_pcl_freenect_class, (method)jit_pcl_freenect_matrix_calc, "matrix_calc", A_CANT, 0);
    
    
    attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,
                                          "enable",
                                          _jit_sym_long,
                                          attrflags,
                                          (method)jit_pcl_freenect_poll_get,
                                          (method)jit_pcl_freenect_poll_set,
                                          calcoffset(t_jit_pcl_freenect, enable));
    
    jit_class_addattr(s_jit_pcl_freenect_class, attr);

    jit_class_register(s_jit_pcl_freenect_class);
    return JIT_ERR_NONE;
}
Exemplo n.º 14
0
t_jit_err jit_ys_pixelweightmat_init(void) 
{
    long attrflags=0;
    t_jit_object *attr;
    t_jit_object *mop, *o;
	
	
    _jit_ys_pixelweightmat_class = jit_class_new("jit_ys_pixelweightmat",(method)jit_ys_pixelweightmat_new,(method)jit_ys_pixelweightmat_free,
						 sizeof(t_jit_ys_pixelweightmat),A_CANT,0L); //A_CANT = untyped

    // add mop
    mop = jit_object_new(_jit_sym_jit_mop,2,1);	// 1 matrix input / 1 matrix output

    // need this for getting correct matrix_info from 2nd input matrix....  (see jit.concat.c...)
    jit_mop_input_nolink(mop,2);
    o= jit_object_method(mop,_jit_sym_getinput,2);
    jit_object_method(o,_jit_sym_ioproc,jit_mop_ioproc_copy_adapt); 
	
    jit_class_addadornment(_jit_ys_pixelweightmat_class,mop);
	
    // add methods
    jit_class_addmethod(_jit_ys_pixelweightmat_class, (method)jit_ys_pixelweightmat_matrix_calc, "matrix_calc", A_CANT, 0L);
	
	//Add attributes
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;	
	attr = jit_object_new(	_jit_sym_jit_attr_offset_array,"param",_jit_sym_float32,
							JIT_MATRIX_MAX_PLANECOUNT, attrflags,(method)0L,(method)0L,
							calcoffset(t_jit_ys_pixelweightmat,paramcount),calcoffset(t_jit_ys_pixelweightmat,param));
	jit_class_addattr(_jit_ys_pixelweightmat_class,attr);

		
    jit_class_register(_jit_ys_pixelweightmat_class);

    return JIT_ERR_NONE;
}
Exemplo n.º 15
0
t_jit_err evolver_init(void)
{
	long			attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;
	t_jit_object	*attr;
	t_jit_object	*mop;

	s_evolver_class = jit_class_new("evolver~", (method)evolver_new, (method)evolver_free, sizeof(t_evolver), 0);

	// add matrix operator (mop)
	mop = (t_jit_object *)jit_object_new(_jit_sym_jit_mop, 1, 1); // args are  num inputs and num outputs
	jit_class_addadornment(s_evolver_class, mop);

	// add method(s)
	jit_class_addmethod(s_evolver_class, (method)evolver_matrix_calc, "matrix_calc", A_CANT, 0);

	// add attribute(s)
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,
										  "gain",
										  _jit_sym_float64,
										  attrflags,
										  (method)NULL, (method)NULL,
										  calcoffset(t_evolver, gain));
	jit_class_addattr(s_evolver_class, attr);

	// finalize class
	jit_class_register(s_evolver_class);
	return JIT_ERR_NONE;
}
Exemplo n.º 16
0
t_jit_err cv_jit_blobs_direction_init(void) 
{
	long attrflags=0;
	t_jit_object *attr,*mop,*output;
	t_symbol *atsym;
	
	atsym = gensym("jit_attr_offset");
	
	_cv_jit_blobs_direction_class = jit_class_new("cv_jit_blobs_direction",(method)cv_jit_blobs_direction_new,(method)cv_jit_blobs_direction_free,
		sizeof(t_cv_jit_blobs_direction),0L); 

	//add mop
	mop = jit_object_new(_jit_sym_jit_mop,1,1);  //Object has one input and one output

   	jit_mop_single_type(mop,_jit_sym_float32);   //Set input type and planecount
   	jit_mop_single_planecount(mop,17);  
   	jit_mop_output_nolink(mop,1); //Turn off output linking so that output matrix does not adapt to input
   	
   	output = jit_object_method(mop,_jit_sym_getoutput,1); //Get a pointer to the output matrix
   	jit_attr_setlong(output,_jit_sym_minplanecount,1);
  	jit_attr_setlong(output,_jit_sym_maxplanecount,1);
  	jit_attr_setlong(output,_jit_sym_mindim,1);
  	jit_attr_setlong(output,_jit_sym_maxdim,1);
  	jit_attr_setsym(output,_jit_sym_types,_jit_sym_float32);
   	   	
	jit_class_addadornment(_cv_jit_blobs_direction_class,mop);
	
	
	//add methods
	jit_class_addmethod(_cv_jit_blobs_direction_class, (method)cv_jit_blobs_direction_matrix_calc, 		"matrix_calc", 		A_CANT, 0L);	

	//add attributes	
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;
	attr = jit_object_new(_jit_sym_jit_attr_offset,"mode",_jit_sym_long,attrflags,
		(method)0L,(method)0L,calcoffset(t_cv_jit_blobs_direction,mode));
	jit_attr_addfilterset_clip(attr,0,1,TRUE,TRUE);	//clip to 0-1
	jit_class_addattr(_cv_jit_blobs_direction_class,attr);
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"flip",_jit_sym_long,attrflags,
		(method)0L,(method)0L,calcoffset(t_cv_jit_blobs_direction,flip));
	jit_attr_addfilterset_clip(attr,0,1,TRUE,TRUE);	//clip to 0-1
	jit_class_addattr(_cv_jit_blobs_direction_class,attr);
		
	jit_class_register(_cv_jit_blobs_direction_class);

	return JIT_ERR_NONE;
}
Exemplo n.º 17
0
t_jit_err jit_fluoride_init(void) 
{
	long attrflags=0;
	t_jit_object *attr, *mop;
	
	_jit_fluoride_class = jit_class_new("jit_fluoride",(method)jit_fluoride_new,(method)jit_fluoride_free,
		sizeof(t_jit_fluoride),0L);

	//add mop
	mop = jit_object_new(_jit_sym_jit_mop,1,1); //#inputs,#outputs
	jit_mop_single_type(mop,_jit_sym_char);	
	jit_mop_single_planecount(mop,4);	
	jit_class_addadornment(_jit_fluoride_class,mop);

	//add methods
	jit_class_addmethod(_jit_fluoride_class, (method)jit_fluoride_matrix_calc, 		"matrix_calc", 		A_CANT, 0L);

	//add attributes	
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;

	// glow -- sets color for neon effect
	attr = jit_object_new(_jit_sym_jit_attr_offset_array, "glow", _jit_sym_float64, 3, 
		attrflags, (method)0L, (method)0L, calcoffset(t_jit_fluoride, glowcount),
		calcoffset(t_jit_fluoride,glow));
	jit_class_addattr(_jit_fluoride_class,attr);

	// lum -- moves center luminosity
	attr = jit_object_new(_jit_sym_jit_attr_offset,"lum",_jit_sym_float64,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_fluoride,lum));
	jit_class_addattr(_jit_fluoride_class,attr);

	// tol -- width of neon tolerance
	attr = jit_object_new(_jit_sym_jit_attr_offset,"tol",_jit_sym_float64,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_fluoride,tol));
	jit_class_addattr(_jit_fluoride_class,attr);

	// mode -- b/w (0) or color (1)
	attr = jit_object_new(_jit_sym_jit_attr_offset,"mode",_jit_sym_long,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_fluoride,mode));
	jit_class_addattr(_jit_fluoride_class,attr);

	jit_class_register(_jit_fluoride_class);

	return JIT_ERR_NONE;
}
Exemplo n.º 18
0
t_jit_err jit_change_init(void) 
{
	long attrflags=0;
	t_jit_object *attr;
	t_jit_object *mop;
	
	_jit_change_class = jit_class_new("jit_change",(method)jit_change_new,(method)jit_change_free,
		sizeof(t_jit_change),0L);

	//add mop
	mop = jit_object_new(_jit_sym_jit_mop,1,1);
	jit_class_addadornment(_jit_change_class,mop);
	//add methods
	jit_class_addmethod(_jit_change_class, (method)jit_change_matrix_calc, "matrix_calc", A_CANT, 0L);
	//add attributes	
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;

	CLASS_STICKY_CATEGORY(_jit_change_class,0,"Behavior");
	CLASS_STICKY_ATTR(_jit_change_class,"basic",0,"1");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"thresh",_jit_sym_long,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_change,thresh));
	jit_class_addattr(_jit_change_class,attr);
	CLASS_ATTR_LABEL(_jit_change_class,"thresh",0,"Threshold");	
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"mode",_jit_sym_char,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_change,mode));
	jit_class_addattr(_jit_change_class,attr);
	CLASS_ATTR_LABEL(_jit_change_class,"mode",0,"Pass Mode");	
	CLASS_ATTR_ENUMINDEX2(_jit_change_class, "mode", 0, "More-Than-Threshold", "Less-Than-Threshold");
	
	CLASS_STICKY_CATEGORY_CLEAR(_jit_change_class);
	CLASS_STICKY_ATTR_CLEAR(_jit_change_class, "basic");

	attrflags = JIT_ATTR_GET_OPAQUE_USER | JIT_ATTR_SET_OPAQUE_USER;
	attr = jit_object_new(_jit_sym_jit_attr_offset,"change",_jit_sym_long,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_change,change));
	jit_class_addattr(_jit_change_class,attr);
	
	jit_class_register(_jit_change_class);
	
//	ps_change = gensym("change");

	return JIT_ERR_NONE;
}
Exemplo n.º 19
0
t_jit_err jit_rgb2luma_init(void)
{
	long attrflags=0;
	t_jit_object *attr, *mop, *o;

	_jit_rgb2luma_class = jit_class_new("jit_rgb2luma",(method)jit_rgb2luma_new,(method)jit_rgb2luma_free,
										sizeof(t_jit_rgb2luma),0L);

	//add mop
	mop = jit_object_new(_jit_sym_jit_mop,1,1); //#inputs,#outputs
	jit_mop_single_planecount(mop, 1);
	jit_mop_single_type(mop, _jit_sym_char);
	o=jit_object_method(mop,_jit_sym_getoutput,1);
	jit_attr_setlong(o,_jit_sym_planelink,0);
	jit_class_addadornment(_jit_rgb2luma_class,mop);

	//add methods
	jit_class_addmethod(_jit_rgb2luma_class, (method)jit_rgb2luma_matrix_calc, 		"matrix_calc", 		A_CANT, 0L);

	//add attributes
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;
	attr = jit_object_new(_jit_sym_jit_attr_offset,"ascale",_jit_sym_float64,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_rgb2luma,ascale));
	jit_class_addattr(_jit_rgb2luma_class,attr);
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"\"Alpha Scale\"");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"rscale",_jit_sym_float64,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_rgb2luma,rscale));
	jit_class_addattr(_jit_rgb2luma_class,attr);
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"\"Red Scale\"");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"gscale",_jit_sym_float64,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_rgb2luma,gscale));
	jit_class_addattr(_jit_rgb2luma_class,attr);
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"\"Green Scale\"");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"bscale",_jit_sym_float64,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_rgb2luma,bscale));
	jit_class_addattr(_jit_rgb2luma_class,attr);
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"\"Blue Scale\"");

	jit_class_register(_jit_rgb2luma_class);

	return JIT_ERR_NONE;
}
Exemplo n.º 20
0
t_jit_err jit_dimmap_init(void) 
{
	long attrflags=0;
	t_jit_object *attr,*mop,*o;
	t_symbol *atsym;
	
	atsym = gensym("jit_attr_offset");
	
	_jit_dimmap_class = jit_class_new("jit_dimmap",(method)jit_dimmap_new,(method)jit_dimmap_free,
		sizeof(t_jit_dimmap),0L);

	//add mop
	mop = jit_object_new(_jit_sym_jit_mop,1,1);
	jit_mop_output_nolink(mop,1);	
	jit_class_addadornment(_jit_dimmap_class,mop);
	o = jit_object_method(mop,_jit_sym_getoutput,1);
	//add methods
	jit_class_addmethod(_jit_dimmap_class, (method)jit_dimmap_matrix_calc, 		"matrix_calc", 		A_CANT, 0L);	
	//add attributes	
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;

	CLASS_STICKY_ATTR(_jit_dimmap_class,"category",0,"Behavior");
	CLASS_STICKY_ATTR(_jit_dimmap_class,"basic",0,"1");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset_array,"map",_jit_sym_long,JIT_MATRIX_MAX_DIMCOUNT,attrflags,
		(method)0L,(method)jit_dimmap_map,calcoffset(t_jit_dimmap,mapcount),calcoffset(t_jit_dimmap,map));
	jit_class_addattr(_jit_dimmap_class,attr);
	CLASS_ATTR_LABEL(_jit_dimmap_class,"map",0,"Dimension Map");	
	
	attr = jit_object_new(_jit_sym_jit_attr_offset_array,"invert",_jit_sym_long,JIT_MATRIX_MAX_DIMCOUNT,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_dimmap,invertcount),calcoffset(t_jit_dimmap,invert));
	jit_class_addattr(_jit_dimmap_class,attr);
	CLASS_ATTR_LABEL(_jit_dimmap_class,"invert",0,"Dimension Invert");	

	CLASS_STICKY_ATTR_CLEAR(_jit_dimmap_class, "basic");
	CLASS_STICKY_ATTR_CLEAR(_jit_dimmap_class, "category");

	jit_class_register(_jit_dimmap_class);

	return JIT_ERR_NONE;
}
Exemplo n.º 21
0
t_jit_err jit_demultiplex_init(void) 
{
	long attrflags=0;
	t_jit_object *attr;	
	t_jit_object *mop, *o;
	
	_jit_demultiplex_class = jit_class_new("jit_demultiplex",(method)jit_demultiplex_new,(method)jit_demultiplex_free,
		sizeof(t_jit_demultiplex),0L);

	//add mop
	mop = jit_object_new(_jit_sym_jit_mop,1,2);
	jit_mop_output_nolink(mop,1);
	jit_mop_output_nolink(mop,2);

	jit_class_addadornment(_jit_demultiplex_class,mop);
	//add methods
	jit_class_addmethod(_jit_demultiplex_class, (method)jit_demultiplex_matrix_calc, "matrix_calc", A_CANT, 0L);

	//add attributes	
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;
	attr = jit_object_new(_jit_sym_jit_attr_offset,"demultiplexdim",_jit_sym_char,attrflags, 
		(method)0L,(method)0L,calcoffset(t_jit_demultiplex,demultiplexdim));
	jit_class_addattr(_jit_demultiplex_class,attr);
	attr = jit_object_new(_jit_sym_jit_attr_offset,"autoclear",_jit_sym_char,attrflags, 
		(method)0L,(method)0L,calcoffset(t_jit_demultiplex,autoclear));
	jit_class_addattr(_jit_demultiplex_class,attr);
	attr = jit_object_new(_jit_sym_jit_attr_offset,"scan_a",_jit_sym_long,attrflags, 
		(method)0L,(method)0L,calcoffset(t_jit_demultiplex,scan_a));
	jit_class_addattr(_jit_demultiplex_class,attr);
	attr = jit_object_new(_jit_sym_jit_attr_offset,"scan_b",_jit_sym_long,attrflags, 
		(method)0L,(method)0L,calcoffset(t_jit_demultiplex,scan_b));
	jit_class_addattr(_jit_demultiplex_class,attr);

	//add methods
		
	jit_class_register(_jit_demultiplex_class);

	return JIT_ERR_NONE;
}
Exemplo n.º 22
0
t_jit_err StencilClassInit(void) 
{
	long			attrflags = 0;// = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;
	t_jit_object	*attr;
	t_jit_object	*mop;
	
	sStencilClass = (ClassPtr)jit_class_new((char*)"jcom_stencil", (method)StencilNew, (method)StencilFree, sizeof(StencilObject), 0);

	// add matrix operator (mop)
	mop = (t_jit_object*)jit_object_new(_jit_sym_jit_mop, 1, 1); // args are  num inputs and num outputs
	jit_class_addadornment(sStencilClass, mop);

	// add method(s)
	jit_class_addmethod(sStencilClass, (method)StencilMatrixCalc, (char*)"matrix_calc", A_CANT, 0);

	// add attribute(s)
	attr = (t_jit_object*)jit_object_new(_jit_sym_jit_attr_offset_array, 
										 "stepSize", 
										 _jit_sym_long, 
										 JIT_MATRIX_MAX_PLANECOUNT,
										 attrflags, 
										 (method)StencilGetStepSize, (method)StencilSetStepSize, 
										 NULL, NULL);
	jit_class_addattr(sStencilClass, attr);
	
	attr = (t_jit_object*)jit_object_new(_jit_sym_jit_attr_offset,
										 "edges",
										 _jit_sym_symbol,
										 attrflags,
										 (method)StencilGetEdges, (method)StencilSetEdges,
										 NULL);
	jit_class_addattr(sStencilClass, attr);

	
	// finalize class
	jit_class_register(sStencilClass);
	return JIT_ERR_NONE;
}
Exemplo n.º 23
0
	static inline void AddPenizeAttribute(const char iName[], long iDataOffset)
		{
		const long kAttrFlags = JIT_ATTR_SET_OPAQUE_USER | JIT_ATTR_GET_OPAQUE_USER;
		
		jit_class_addattr(
				gPenizeJitClass,
				jit_object_new(
						_jit_sym_jit_attr_offset_array, iName,
						_jit_sym_atom, JIT_MATRIX_MAX_PLANECOUNT,
						kAttrFlags, (method) NIL, (method) NIL,
						calcoffset(jcobPenize, planeCount), iDataOffset
						)
				);
		}
Exemplo n.º 24
0
t_jit_err xray_jit_cellcoords_init(void)
{
	long attrflags=0;
	t_jit_object *attr;
	t_jit_object *mop, *o;

	_xray_jit_cellcoords_class = jit_class_new("xray_jit_cellcoords",(method)xray_jit_cellcoords_new,(method)xray_jit_cellcoords_free,
		sizeof(t_xray_jit_cellcoords),0L);

	//add mop
	mop = jit_object_new(_jit_sym_jit_mop,1,1);
	o = jit_object_method(mop,_jit_sym_getoutput,1);
	jit_attr_setlong(o,_jit_sym_dimlink,0);

	jit_class_addadornment(_xray_jit_cellcoords_class,mop);

	//add methods
	jit_class_addmethod(_xray_jit_cellcoords_class, (method)xray_jit_cellcoords_matrix_calc, "matrix_calc", A_CANT, 0L);

	//add attributes
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;

	//plane
	attr = jit_object_new(_jit_sym_jit_attr_offset,"plane",_jit_sym_char,attrflags,
		(method)0L,(method)0L,calcoffset(t_xray_jit_cellcoords,plane));
	jit_class_addattr(_xray_jit_cellcoords_class,attr);

	//out_mode
	attr = jit_object_new(_jit_sym_jit_attr_offset,"out_mode",_jit_sym_char,attrflags,
		(method)0L,(method)0L,calcoffset(t_xray_jit_cellcoords,out_mode));
	jit_class_addattr(_xray_jit_cellcoords_class,attr);

	jit_class_register(_xray_jit_cellcoords_class);

	return JIT_ERR_NONE;
}
Exemplo n.º 25
0
t_jit_err jit_map_init(void) 
{
	long attrflags=0;
	t_jit_object *attr,*mop;
	
	_jit_map_class = jit_class_new("jit_map",(method)jit_map_new,(method)jit_map_free,
		sizeof(t_jit_map),0L);

	//add mop
	mop = jit_object_new(_jit_sym_jit_mop,1,1); //#inputs,#outputs
	jit_class_addadornment(_jit_map_class,mop);
	//add methods
	jit_class_addmethod(_jit_map_class, (method)jit_map_matrix_calc, 		"matrix_calc", 		A_CANT, 0L);
	//add attributes	
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;
	
	CLASS_STICKY_ATTR(_jit_map_class,"category",0,"Behavior");
	CLASS_STICKY_ATTR(_jit_map_class,"basic",0,"1");

	attr = jit_object_new(_jit_sym_jit_attr_offset_array,"map",_jit_sym_float64,4,attrflags,
		(method)0L,(method)0L,0/*fix*/,calcoffset(t_jit_map,map));
	jit_class_addattr(_jit_map_class,attr);
	CLASS_ATTR_LABEL(_jit_map_class,"map",0,"Input to Output Map");	
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"clip",_jit_sym_long,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_map,clip));
	jit_class_addattr(_jit_map_class,attr);
	CLASS_ATTR_STYLE_LABEL(_jit_map_class,"clip",0,"onoff","Clip Values");	
	
	CLASS_STICKY_ATTR_CLEAR(_jit_map_class, "category");
	CLASS_STICKY_ATTR_CLEAR(_jit_map_class, "basic");

	jit_class_register(_jit_map_class);

	return JIT_ERR_NONE;
}
Exemplo n.º 26
0
t_jit_err jit_hello_init(void) 
{
	long attrflags=0;
	t_jit_object *attr;
	
	_jit_hello_class = jit_class_new("jit_hello",(method)jit_hello_new,(method)jit_hello_free,
		sizeof(t_jit_hello),0L);

	//add attributes	
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;
	attr = jit_object_new(_jit_sym_jit_attr_offset,"text",_jit_sym_symbol,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_hello,text));
	jit_class_addattr(_jit_hello_class,attr);
	
	jit_class_register(_jit_hello_class);

	return JIT_ERR_NONE;
}
Exemplo n.º 27
0
t_jit_err xray_jit_crossproduct_init(void)
{
	long attrflags=0;
	t_jit_object *attr,*mop;
	t_symbol *atsym;
	void *o;
	t_atom a[2];

	atsym = gensym("jit_attr_offset");

	_xray_jit_crossproduct_class = jit_class_new("xray_jit_crossproduct",(method)xray_jit_crossproduct_new,(method)xray_jit_crossproduct_free,
		sizeof(t_xray_jit_crossproduct),0L);

	//add mop
	mop = jit_object_new(_jit_sym_jit_mop,2,1);
	jit_atom_setsym(a, _jit_sym_float32);
	jit_atom_setsym(a+1, _jit_sym_float64);

	o = jit_object_method(mop,_jit_sym_getinput,1);
	jit_object_method(o,_jit_sym_types,2,a);

	o = jit_object_method(mop,_jit_sym_getinput,2);
	jit_object_method(o,_jit_sym_types,2,a);

	o = jit_object_method(mop,_jit_sym_getoutput,1);
	jit_object_method(o,_jit_sym_types,2,a);

	jit_class_addadornment(_xray_jit_crossproduct_class,mop);

	//add methods
	jit_class_addmethod(_xray_jit_crossproduct_class, (method)xray_jit_crossproduct_matrix_calc, 		"matrix_calc", 		A_CANT, 0L);

	//add attributes
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;

	//normalize
	attr = jit_object_new(_jit_sym_jit_attr_offset_array,"normalize",_jit_sym_char,2,attrflags,
		(method)0L,(method)0L,calcoffset(t_xray_jit_crossproduct,normalizecount),calcoffset(t_xray_jit_crossproduct,normalize));
	jit_class_addattr(_xray_jit_crossproduct_class,attr);

	jit_class_register(_xray_jit_crossproduct_class);

	return JIT_ERR_NONE;
}
Exemplo n.º 28
0
t_jit_err jit_alphablend_init(void)
{
	long attrflags=0;
	t_jit_object *attr,*mop,*o;
	t_symbol *atsym;
	t_atom a[3];

	atsym = gensym("jit_attr_offset");

	_jit_alphablend_class = jit_class_new("jit_alphablend",(method)jit_alphablend_new,(method)jit_alphablend_free,
										  sizeof(t_jit_alphablend),0L);

	//add mop
	mop = jit_object_new(_jit_sym_jit_mop,2,1);
//	jit_mop_single_planecount(mop,4);
	jit_atom_setsym(a,_jit_sym_char);
	jit_atom_setsym(a+1,_jit_sym_float32);
	jit_atom_setsym(a+2,_jit_sym_float64);
	o = jit_object_method(mop,_jit_sym_getinput,2);
	jit_object_method(o,_jit_sym_types,3,a);
	o = jit_object_method(mop,_jit_sym_getoutput,1);
	jit_object_method(o,_jit_sym_types,3,a);

	jit_class_addadornment(_jit_alphablend_class,mop);
	//add methods
	jit_class_addmethod(_jit_alphablend_class, (method)jit_alphablend_matrix_calc, 		"matrix_calc", 		A_CANT, 0L);

	//add attributes
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;
	attr = jit_object_new(atsym,"mode",_jit_sym_long,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_alphablend,mode));
	jit_class_addattr(_jit_alphablend_class,attr);
	CLASS_ATTR_BASIC(_jit_alphablend_class,"mode",0);
	CLASS_ATTR_LABEL(_jit_alphablend_class,"mode",0,"Crossfade Mode");
	CLASS_ATTR_ENUMINDEX2(_jit_alphablend_class, "mode", 0, "Left-to-Right", "Right-to-Left");
	CLASS_ATTR_CATEGORY(_jit_alphablend_class, "mode", 0, "Mode");

	jit_class_register(_jit_alphablend_class);

	return JIT_ERR_NONE;
}
t_jit_err jit_tml_vp8_encode_init(void)
{
    long attrflags=0;
    t_jit_object *attr;
    t_jit_object *mop, *o;

    //Create class with given constructors & destructors
    _jit_tml_vp8_encode_class = jit_class_new("jit_tml_vp8_encode",(method)jit_tml_vp8_encode_new,(method)jit_tml_vp8_encode_free,
                                sizeof(t_jit_tml_vp8_encode),A_CANT,0L); //A_CANT = untyped

    // 0 matrix input / 4 matrix output
    mop = (t_jit_object*)jit_object_new(_jit_sym_jit_mop,1,1);

    // need this for getting correct matrix_info from 2nd input matrix....  (see jit.concat.c...)
    //jit_mop_input_nolink(mop,2);
    // o= (t_jit_object*)jit_object_method(mop,_jit_sym_getinput,2);
    //jit_object_method(o,_jit_sym_ioproc,jit_mop_ioproc_copy_adapt);

    jit_class_addadornment(_jit_tml_vp8_encode_class,mop);

    // add methods
    jit_class_addmethod(_jit_tml_vp8_encode_class, (method)jit_tml_vp8_encode_matrix_calc, "matrix_calc", A_CANT, 0L);


    jit_class_addmethod(_jit_tml_vp8_encode_class, (method)jit_tml_vp8_encode_open, "open", A_DEFLONG, 0L);


    attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;
    attr = (t_jit_object*)jit_object_new(_jit_sym_jit_attr_offset, "kilobitrate", _jit_sym_long,
                                         attrflags, (method)0L,
                                         (method)jit_tml_vp8_encode_setBitrate,
                                         calcoffset(t_jit_tml_vp8_encode, bitRate));
    jit_class_addattr(_jit_tml_vp8_encode_class, attr);


    //Done!
    jit_class_register(_jit_tml_vp8_encode_class);

    return JIT_ERR_NONE;
}
Exemplo n.º 30
0
t_jit_err xray_jit_cumsum_init(void)
{
	long attrflags=0;
	t_jit_object *attr,*mop,*o;
	t_symbol *atsym;
	t_atom a[1];

	atsym = gensym("jit_attr_offset");

	_xray_jit_cumsum_class = jit_class_new("xray_jit_cumsum",(method)xray_jit_cumsum_new,(method)xray_jit_cumsum_free,
		sizeof(t_xray_jit_cumsum),0L);

	//add mop
	mop = jit_object_new(_jit_sym_jit_mop, 1, 1);
	jit_atom_setsym(a, _jit_sym_float32);

	o = jit_object_method(mop,_jit_sym_getinput,1);
	jit_object_method(o,_jit_sym_types,1,a);

	o = jit_object_method(mop,_jit_sym_getoutput,1);
	jit_object_method(o,_jit_sym_types,1,a);

	jit_class_addadornment(_xray_jit_cumsum_class,mop);

	//add methods
	jit_class_addmethod(_xray_jit_cumsum_class, (method)xray_jit_cumsum_matrix_calc, 		"matrix_calc", 		A_CANT, 0L);

	//add attributes
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;

	//dimmode
	attr = jit_object_new(atsym,"dimmode",_jit_sym_char,attrflags,
		(method)0L,(method)0L,calcoffset(t_xray_jit_cumsum,dimmode));
	jit_class_addattr(_xray_jit_cumsum_class,attr);

	jit_class_register(_xray_jit_cumsum_class);

	return JIT_ERR_NONE;
}