Beispiel #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;
}
Beispiel #2
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;
}
Beispiel #3
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;
}
Beispiel #4
0
t_jit_err cv_jit_moments_init(void) 
{
	long attrflags=0;
	t_jit_object *attr,*mop;
	
	_cv_jit_moments_class = jit_class_new("cv_jit_moments",(method)cv_jit_moments_new,(method)cv_jit_moments_free, sizeof(t_cv_jit_moments),0L);
		
	//add mop
	mop = jit_object_new(_jit_sym_jit_mop,1,0);
	jit_class_addadornment(_cv_jit_moments_class,mop);
	//add methods
	jit_class_addmethod(_cv_jit_moments_class, (method)cv_jit_moments_matrix_calc, 		"matrix_calc", 		A_CANT, 0L);
	//add attributes	
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_OPAQUE_USER;
	
	attr = jit_object_new(_jit_sym_jit_attr_offset_array,"moments",_jit_sym_float32,7,attrflags,
		(method)0L,(method)0L,calcoffset(t_cv_jit_moments,momcount),calcoffset(t_cv_jit_moments,moments));
	jit_class_addattr(_cv_jit_moments_class,attr);
	
	attr = jit_object_new(_jit_sym_jit_attr_offset_array,"hu",_jit_sym_float32,7,attrflags,
		(method)0L,(method)0L,calcoffset(t_cv_jit_moments,momcount),calcoffset(t_cv_jit_moments,hu));
	jit_class_addattr(_cv_jit_moments_class,attr);
	
	attr = jit_object_new(_jit_sym_jit_attr_offset_array,"centroids",_jit_sym_float32,2,attrflags,
		(method)0L,(method)0L,calcoffset(t_cv_jit_moments,centcount),calcoffset(t_cv_jit_moments,centroids));
	jit_class_addattr(_cv_jit_moments_class,attr);
	
	attr = jit_object_new(	_jit_sym_jit_attr_offset,"mass",_jit_sym_float32,attrflags,(method)0L,(method)0L,calcoffset(t_cv_jit_moments,mass));			
	jit_class_addattr(_cv_jit_moments_class,attr);
	
	//Register class
	jit_class_register(_cv_jit_moments_class);

	return JIT_ERR_NONE;
}
Beispiel #5
0
t_jit_err jit_tml_OpenNI_init(void) 
{
	long attrflags=0;
	t_jit_object *attr;
	t_jit_object *mop, *o;
	
	//Create class with given constructors & destructors
	_jit_tml_OpenNI_class = jit_class_new("jit_tml_OpenNI",(method)jit_tml_OpenNI_new,(method)jit_tml_OpenNI_free,
		sizeof(t_jit_tml_OpenNI),A_CANT,0L); //A_CANT = untyped

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

	// 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_OpenNI_class,mop);
	
	// add methods
	jit_class_addmethod(_jit_tml_OpenNI_class, (method)jit_tml_OpenNI_matrix_calc, "matrix_calc", A_CANT, 0L);
	
	
	jit_class_addmethod(_jit_tml_OpenNI_class, (method)jit_tml_OpenNI_open, "open", A_DEFLONG, 0L);
	
	
	
	
	
	//Done!	
	jit_class_register(_jit_tml_OpenNI_class);

	return JIT_ERR_NONE;
}
Beispiel #6
0
t_jit_err jit_split_init(void) 
{
	long attrflags=0;
	t_jit_object *attr;	
	t_jit_object *mop;	
	
	_jit_split_class = jit_class_new("jit_split",(method)jit_split_new,(method)jit_split_free,
		sizeof(t_jit_split),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_split_class,mop);
	//add methods
	jit_class_addmethod(_jit_split_class, (method)jit_split_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,"splitdim",_jit_sym_char,attrflags, 
		(method)0L,(method)0L,calcoffset(t_jit_split,splitdim));
	jit_class_addattr(_jit_split_class,attr);
	attr = jit_object_new(_jit_sym_jit_attr_offset,"autoclear",_jit_sym_char,attrflags, 
		(method)0L,(method)0L,calcoffset(t_jit_split,autoclear));
	jit_class_addattr(_jit_split_class,attr);
	attr = jit_object_new(_jit_sym_jit_attr_offset,"splitpoint",_jit_sym_long,attrflags, 
		(method)0L,(method)0L,calcoffset(t_jit_split,splitpoint));
	jit_class_addattr(_jit_split_class,attr);

	//add methods
		
	jit_class_register(_jit_split_class);

	return JIT_ERR_NONE;
}
Beispiel #7
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;
}
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;
}
Beispiel #9
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;
}
Beispiel #10
0
t_jit_err jit_submatrix_init(void) 
{
	long attrflags=0;
	t_jit_object *attr,*mop,*o;
	
	_jit_submatrix_class = jit_class_new("jit_submatrix",(method)jit_submatrix_new,(method)jit_submatrix_free,
		sizeof(t_jit_submatrix),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_submatrix_class,mop);
	//add methods
	jit_class_addmethod(_jit_submatrix_class, (method)jit_submatrix_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,"dim",_jit_sym_long,JIT_MATRIX_MAX_DIMCOUNT,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_submatrix,dimcount),calcoffset(t_jit_submatrix,dim));
	object_addattr_parse(attr,"category",_jit_sym_symbol,0,"MOP");
	jit_class_addattr(_jit_submatrix_class,attr);
	attr = jit_object_new(_jit_sym_jit_attr_offset_array,"offset",_jit_sym_long,JIT_MATRIX_MAX_DIMCOUNT,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_submatrix,offsetcount),calcoffset(t_jit_submatrix,offset));
	jit_class_addattr(_jit_submatrix_class,attr);
	
	jit_class_register(_jit_submatrix_class);

	return JIT_ERR_NONE;
}
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;
}
Beispiel #12
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;
	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);
	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);
	
	jit_class_register(_jit_map_class);

	return JIT_ERR_NONE;
}
Beispiel #13
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;
}
Beispiel #14
0
t_jit_err jit_tml_fakeDepth_init(void) 
{
    long attrflags=0;
    t_jit_object *attr;
    t_jit_object *mop, *o;
	
	
    _jit_tml_fakeDepth_class = jit_class_new("jit_tml_fakeDepth",(method)jit_tml_fakeDepth_new,(method)jit_tml_fakeDepth_free,
						 sizeof(t_jit_tml_fakeDepth),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_tml_fakeDepth_class,mop);
	
    // add methods
    jit_class_addmethod(_jit_tml_fakeDepth_class, (method)jit_tml_fakeDepth_matrix_calc, "matrix_calc", A_CANT, 0L);
	
	//Add attributes
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;	

		
    jit_class_register(_jit_tml_fakeDepth_class);

    return JIT_ERR_NONE;
}
Beispiel #15
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;
}
Beispiel #16
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;
}
Beispiel #17
0
t_jit_err
PenizeJitInit(void) 

	{
	const int	kJitterInlets	= 1,	// One inlet for Jitter Matrices
				kJitterOutlets	= 0;	// No outlets for Jitter Matrices
										// The Max shell object will create outlets for
										// sending out the results of our calculations, but
										// that's none of our business.
	
	// 1) Set up Matrix Operator
	gPenizeJitClass = jit_class_new((char*) kMaxClassName,
									(method) PenizeJitNew,
									(method) PenizeJitFree,		// ?? Could be NIL ??
									sizeof(jcobPenize),
									A_CANT, 0L
									); 
	jit_class_addadornment(
				gPenizeJitClass,
				jit_object_new(_jit_sym_jit_mop, kJitterInlets, kJitterOutlets)
				);
	
	// 2) Add methods
	jit_class_addmethod(gPenizeJitClass, (method) PenizeJitMCalc, "matrix_calc", A_CANT, 0L);
	
	// 3) Add attributes (if any)
	AddPenizeAttribute("diffs", calcoffset(jcobPenize, changeResults));
	
	// 4) Register the class
	//	This must happen last, after methods & attributes have been added
	jit_class_register(gPenizeJitClass);
	
	return JIT_ERR_NONE;
	}
Beispiel #18
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;
}
Beispiel #19
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;
}
Beispiel #20
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;
}
Beispiel #21
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;
}
Beispiel #22
0
t_jit_err jit_SDIF_buffer_init(void) {
	void *mop;
	
	_jit_SDIF_buffer_class = jit_class_new("jit_SDIF_buffer",(method)jit_SDIF_buffer_new,(method)jit_SDIF_buffer_free,
		sizeof(t_jit_SDIF_buffer),0L); 

	//add mop
	mop = jit_object_new(_jit_sym_jit_mop,0,1); 
	jit_class_addadornment(_jit_SDIF_buffer_class,mop);
	//add methods
	jit_class_addmethod(_jit_SDIF_buffer_class, (method)jit_SDIF_buffer_matrix_calc, "matrix_calc", A_CANT, 0L);

	jit_class_register(_jit_SDIF_buffer_class);

	return JIT_ERR_NONE;
}
Beispiel #23
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;
}
Beispiel #24
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;
}
Beispiel #25
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;
}
Beispiel #26
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;
}
t_jit_err jit_realsense_grab_init(void) 
{
	t_jit_object	*mop;
	
	s_jit_realsense_grab_class = jit_class_new("jit_realsense_grab", (method)jit_realsense_grab_new, (method)jit_realsense_grab_free, sizeof(t_jit_realsense_grab), 0);

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

	jit_class_addadornment(s_jit_realsense_grab_class, mop);

	// add method(s)
	jit_class_addmethod(s_jit_realsense_grab_class, (method)jit_realsense_grab_matrix_calc, "matrix_calc", A_CANT, 0);

	// finalize class
	jit_class_register(s_jit_realsense_grab_class);
	return JIT_ERR_NONE;
}
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;
}
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;
}
Beispiel #30
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;
}