Пример #1
0
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;
}
Пример #2
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;
}
Пример #3
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;
}
Пример #4
0
t_jit_err jit_gl_simple_init(void)
{
    long ob3d_flags = JIT_OB3D_NO_MATRIXOUTPUT; // no matrix output
    void *ob3d;

    _jit_gl_simple_class = jit_class_new("jit_gl_simple",
                                         (method)jit_gl_simple_new, (method)jit_gl_simple_free,
                                         sizeof(t_jit_gl_simple),A_DEFSYM,0L);

    // set up object extension for 3d object, customized with flags
    ob3d = jit_ob3d_setup(_jit_gl_simple_class,
                          calcoffset(t_jit_gl_simple, ob3d),
                          ob3d_flags);

    // define our OB3D draw method.  called in automatic mode by
    // jit.gl.render or otherwise through ob3d when banged. this
    // method is A_CANT because our draw setup needs to happen
    // in the ob3d beforehand to initialize OpenGL state
    jit_class_addmethod(_jit_gl_simple_class,
                        (method)jit_gl_simple_draw, "ob3d_draw", A_CANT, 0L);

    // define our dest_closing and dest_changed methods.
    // these methods are called by jit.gl.render when the
    // destination context closes or changes: for example, when
    // the user moves the window from one monitor to another. Any
    // resources your object keeps in the OpenGL machine
    // (e.g. textures, display lists, vertex shaders, etc.)
    // will need to be freed when closing, and rebuilt when it has
    // changed. In this object, these functions do nothing, and
    // could be omitted.
    jit_class_addmethod(_jit_gl_simple_class,
                        (method)jit_gl_simple_dest_closing, "dest_closing", A_CANT, 0L);
    jit_class_addmethod(_jit_gl_simple_class,
                        (method)jit_gl_simple_dest_changed, "dest_changed", A_CANT, 0L);

    // must register for ob3d use
    jit_class_addmethod(_jit_gl_simple_class,
                        (method)jit_object_register, "register", A_CANT, 0L);

    jit_class_register(_jit_gl_simple_class);

    return JIT_ERR_NONE;
}
Пример #5
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;
}
Пример #6
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;
}
Пример #7
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;

	// 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);

	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);

	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);

	jit_class_register(_jit_gradient_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;
}
Пример #9
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;
}
Пример #10
0
t_jit_err cv_jit_blobs_centroids_init(void) 
{
	t_jit_object *mop,*output;
	t_symbol *atsym;
	
	atsym = gensym("jit_attr_offset");
	
	_cv_jit_blobs_centroids_class = jit_class_new("cv_jit_blobs_centroids",(method)cv_jit_blobs_centroids_new,(method)cv_jit_blobs_centroids_free,
		sizeof(t_cv_jit_blobs_centroids),0L); 

	//add mop
	mop = jit_object_new(_jit_sym_jit_mop,1,1);  //Object has one input and one output
	output = jit_object_method(mop,_jit_sym_getoutput,1); //Get a pointer to the output matrix

   	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
   	
   	jit_attr_setlong(output,_jit_sym_minplanecount,3); //Output has 3 planes: centroid coordinates + mass
  	jit_attr_setlong(output,_jit_sym_maxplanecount,3);
  	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_centroids_class,mop);
	
	
	//add methods
	jit_class_addmethod(_cv_jit_blobs_centroids_class, (method)cv_jit_blobs_centroids_matrix_calc, 		"matrix_calc", 		A_CANT, 0L);	

	//add attributes	
	
	/*No attributes for this object*/
		
	jit_class_register(_cv_jit_blobs_centroids_class);

	return JIT_ERR_NONE;
}
Пример #11
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;
}
Пример #12
0
t_jit_err xray_jit_colormap_init(void) 
{
	long attrflags=0;
	t_jit_object *attr,*mop,*o;
	t_symbol *atsym;
	t_atom a[2];
	
	atsym = gensym("jit_attr_offset");
	
	_xray_jit_colormap_class = jit_class_new("xray_jit_colormap",(method)xray_jit_colormap_new,(method)xray_jit_colormap_free,
		sizeof(t_xray_jit_colormap),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_char);
	jit_atom_setsym(a+1,_jit_sym_long);
	
	o = jit_object_method(mop,_jit_sym_getoutput,1);
	jit_object_method(o,_jit_sym_types,2,a);
	
	jit_class_addadornment(_xray_jit_colormap_class,mop);
	
	//add methods
	jit_class_addmethod(_xray_jit_colormap_class, (method)xray_jit_colormap_matrix_calc, 		"matrix_calc", 		A_CANT, 0L);
	
	//add attributes	
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;
	
	//mode
	attr = jit_object_new(atsym,"mode",_jit_sym_char,attrflags,
		(method)0L,(method)0L,calcoffset(t_xray_jit_colormap,mode));
	jit_class_addattr(_xray_jit_colormap_class,attr);
	
	jit_class_register(_xray_jit_colormap_class);

	return JIT_ERR_NONE;
}
Пример #13
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;
}
Пример #14
0
t_jit_err cv_jit_mass_init(void) 
{
	long attrflags=0;
	t_jit_object *attr,*mop;
	
	_cv_jit_mass_class = jit_class_new("cv_jit_mass",(method)cv_jit_mass_new,(method)cv_jit_mass_free,
		sizeof(t_cv_jit_mass),0L);

	//add mop
	mop = jit_object_new(_jit_sym_jit_mop,1,0);
	jit_class_addadornment(_cv_jit_mass_class,mop);
	//add methods
	jit_class_addmethod(_cv_jit_mass_class, (method)cv_jit_mass_matrix_calc, 		"matrix_calc", 		A_CANT, 0L);
	//add attributes	
	attrflags = JIT_ATTR_SET_OPAQUE_USER | JIT_ATTR_GET_OPAQUE_USER;
	attr = jit_object_new(_jit_sym_jit_attr_offset_array,"Mass",_jit_sym_atom,JIT_MATRIX_MAX_PLANECOUNT,attrflags,
		(method)0L,(method)0L,calcoffset(t_cv_jit_mass,planecount),calcoffset(t_cv_jit_mass,Mass));
	jit_class_addattr(_cv_jit_mass_class,attr);
	
	jit_class_register(_cv_jit_mass_class);

	return JIT_ERR_NONE;
}
Пример #15
0
t_jit_err jit_thin_init(void) 
{
	long attrflags=0;
	t_jit_object *attr,*mop,*o;
	t_symbol *atsym;
	
	atsym = gensym("jit_attr_offset");
	
	_jit_thin_class = jit_class_new("jit_thin",(method)jit_thin_new,(method)jit_thin_free,
		sizeof(t_jit_thin),0L);

	//add mop
	mop = jit_object_new(_jit_sym_jit_mop,1,1);
	jit_mop_output_nolink(mop,1);	
	jit_class_addadornment(_jit_thin_class,mop);
	o = jit_object_method(mop,_jit_sym_getoutput,1);
	//add methods
	jit_class_addmethod(_jit_thin_class, (method)jit_thin_matrix_calc, 		"matrix_calc", 		A_CANT, 0L);	

	jit_class_register(_jit_thin_class);

	return JIT_ERR_NONE;
}
Пример #16
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;
}
Пример #17
0
t_jit_err jit_charmap_init(void) 
{	
	t_atom a;
	void *o,*mop;
	
	_jit_charmap_class = jit_class_new("jit_charmap",(method)jit_charmap_new,(method)jit_charmap_free,
		sizeof(t_jit_charmap),0L);
	
	//add mop
	mop = jit_object_new(_jit_sym_jit_mop,2,1);
	jit_mop_single_type(mop,_jit_sym_char);	
	o = jit_object_method(mop,_jit_sym_getinput,2);
	jit_attr_setlong(o,_jit_sym_dimlink,0);
	jit_atom_setlong(&a,256);
	jit_object_method(o,_jit_sym_mindim,1,&a);
	jit_object_method(o,_jit_sym_maxdim,1,&a);
	jit_class_addadornment(_jit_charmap_class,mop);
	//add methods
	jit_class_addmethod(_jit_charmap_class, (method)jit_charmap_matrix_calc, 		"matrix_calc", 		A_CANT, 0L);

	jit_class_register(_jit_charmap_class);

	return JIT_ERR_NONE;
}
Пример #18
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;
}
Пример #19
0
t_jit_err jit_pcl_concavehull_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_concavehull_class = jit_class_new("jit_pcl_concavehull", (method)jit_pcl_concavehull_new, (method)jit_pcl_concavehull_free, sizeof(t_jit_pcl_concavehull), 0);
    
    // add matrix operator (mop)
    // args are  num inputs and num outputs
    mop = (t_jit_object *)jit_object_new(_jit_sym_jit_mop, 1, 1);
    jit_mop_input_nolink(mop,1);
    
    
    attr = (t_jit_object *)jit_object_method(mop, _jit_sym_getinput, 1);
    jit_attr_setlong(attr,_jit_sym_dimlink,0);
    jit_attr_setlong(attr,_jit_sym_typelink,0);
    jit_attr_setlong(attr,_jit_sym_planelink,0);
    jit_object_method(attr,_jit_sym_ioproc,jit_mop_ioproc_copy_adapt);
    jit_atom_setsym(a, _jit_sym_float32);
    jit_object_method(attr, _jit_sym_types,1, a);
    
    attr = (t_jit_object *)jit_object_method(mop, _jit_sym_getoutput, 1);
    jit_attr_setlong(attr, _jit_sym_dimlink,0);
    
    jit_class_addadornment(s_jit_pcl_concavehull_class, mop);
    
    
    
    // add method(s)
    jit_class_addmethod(s_jit_pcl_concavehull_class, (method)jit_pcl_concavehull_matrix_calc, "matrix_calc", A_CANT, 0);
    
    // add attribute(s)
    attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,
                                          "leafsize",
                                          _jit_sym_float64,
                                          attrflags,
                                          (method)NULL, (method)NULL,
                                          calcoffset(t_jit_pcl_concavehull, leafsize));
    
    jit_class_addattr(s_jit_pcl_concavehull_class, attr);
    
    attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,
                                          "npoints",
                                          _jit_sym_long,
                                          attrflags,
                                          (method)NULL, (method)NULL,
                                          calcoffset(t_jit_pcl_concavehull, npoints));
    jit_attr_addfilterget_clip(attr, 1, 10000, true, false);
    jit_class_addattr(s_jit_pcl_concavehull_class, attr);

    attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,
                                          "stdthresh",
                                          _jit_sym_float64,
                                          attrflags,
                                          (method)NULL, (method)NULL,
                                          calcoffset(t_jit_pcl_concavehull, stdthresh));
    
    jit_class_addattr(s_jit_pcl_concavehull_class, attr);
    
    attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,
                                          "alpha",
                                          _jit_sym_float64,
                                          attrflags,
                                          (method)NULL, (method)NULL,
                                          calcoffset(t_jit_pcl_concavehull, alpha));
    
    jit_class_addattr(s_jit_pcl_concavehull_class, attr);
    
    // finalize class
    jit_class_register(s_jit_pcl_concavehull_class);
    return JIT_ERR_NONE;
}
Пример #20
0
t_jit_err xray_jit_levelsetseg_init(void)
{
	long attrflags=0;
	t_jit_object *attr,*mop,*o;
	t_symbol *atsym;

	atsym = gensym("jit_attr_offset");

	_xray_jit_levelsetseg_class = jit_class_new("xray_jit_levelsetseg",(method)xray_jit_levelsetseg_new,(method)xray_jit_levelsetseg_free,
		sizeof(t_xray_jit_levelsetseg),0L);

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

	jit_class_addadornment(_xray_jit_levelsetseg_class,mop);

	//add methods
	jit_class_addmethod(_xray_jit_levelsetseg_class, (method)xray_jit_levelsetseg_matrix_calc, 		"matrix_calc", 		A_CANT, 0L);

	//add attributes
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;

	//evolve
	attr = (t_jit_object*)jit_object_new(_jit_sym_jit_attr_offset,"evolve",_jit_sym_char,attrflags,
		(method)0L,(method)0L,calcoffset(t_xray_jit_levelsetseg, evolve));
	jit_class_addattr(_xray_jit_levelsetseg_class,attr);

	//smooth
	attr = (t_jit_object*)jit_object_new(_jit_sym_jit_attr_offset,"smooth",_jit_sym_char,attrflags,
		(method)0L,(method)0L,calcoffset(t_xray_jit_levelsetseg, smooth));
	jit_class_addattr(_xray_jit_levelsetseg_class,attr);

	//radius
	attr = (t_jit_object*)jit_object_new(_jit_sym_jit_attr_offset,"radius",_jit_sym_long,attrflags,
		(method)0L,(method)0L,calcoffset(t_xray_jit_levelsetseg, radius));
	jit_class_addattr(_xray_jit_levelsetseg_class,attr);

	//point
	attr = (t_jit_object*)jit_object_new(_jit_sym_jit_attr_offset_array,"point",_jit_sym_long,6,attrflags,
		(method)0L,(method)xray_jit_levelsetseg_point,calcoffset(t_xray_jit_levelsetseg,pointcount),calcoffset(t_xray_jit_levelsetseg,point));
	jit_class_addattr(_xray_jit_levelsetseg_class,attr);

	//Na
	attr = (t_jit_object*)jit_object_new(_jit_sym_jit_attr_offset,"Na",_jit_sym_long,attrflags,
		(method)0L,(method)0L,calcoffset(t_xray_jit_levelsetseg,Na));
	jit_class_addattr(_xray_jit_levelsetseg_class,attr);

	//Ng
	attr = (t_jit_object*)jit_object_new(_jit_sym_jit_attr_offset,"Ng",_jit_sym_long,attrflags,
		(method)0L,(method)xray_jit_levelsetseg_Ng,calcoffset(t_xray_jit_levelsetseg,Ng));
	jit_class_addattr(_xray_jit_levelsetseg_class,attr);

	//Ns
	attr = (t_jit_object*)jit_object_new(_jit_sym_jit_attr_offset,"Ns",_jit_sym_long,attrflags,
		(method)0L,(method)0L,calcoffset(t_xray_jit_levelsetseg,Ns));
	jit_class_addattr(_xray_jit_levelsetseg_class,attr);

	//cycles
	attr = (t_jit_object*)jit_object_new(_jit_sym_jit_attr_offset,"cycles",_jit_sym_long,attrflags,
		(method)0L,(method)0L,calcoffset(t_xray_jit_levelsetseg,cycles));
	jit_class_addattr(_xray_jit_levelsetseg_class,attr);

	jit_class_register(_xray_jit_levelsetseg_class);

	return JIT_ERR_NONE;
}
Пример #21
0
t_jit_err cv_jit_shift_init(void) 
{
	long attrflags=0;
	t_jit_object *attr,*mop;
	t_symbol *atsym;
	
	atsym = gensym("jit_attr_offset");
	
	_cv_jit_shift_class = jit_class_new("cv_jit_shift",(method)cv_jit_shift_new,(method)cv_jit_shift_free,
		sizeof(t_cv_jit_shift),0L); 

	//add mop
	mop = (t_jit_object *)jit_object_new(_jit_sym_jit_mop,1,0);  //Object has one input and no Jitter output
	jit_mop_single_type(mop,_jit_sym_char);   //Set input type and planecount
   	jit_mop_single_planecount(mop,1);  
	jit_class_addadornment(_cv_jit_shift_class,mop);
	
	//add methods
	jit_class_addmethod(_cv_jit_shift_class, (method)cv_jit_shift_matrix_calc, 		"matrix_calc", 		A_CANT, 0L);

	//add attributes	
	attrflags = JIT_ATTR_SET_OPAQUE_USER | JIT_ATTR_GET_OPAQUE_USER;
	//box: the resulting bounding rectangle, passed to the Max wrapper
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset_array,"box",_jit_sym_atom,4,attrflags,
		(method)0L,(method)0L,calcoffset(t_cv_jit_shift,boxcount),calcoffset(t_cv_jit_shift,box));
	jit_class_addattr(_cv_jit_shift_class,attr);
	
	//vertices: the rotated frame that bounds the object
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset_array,"vertices",_jit_sym_atom,4,attrflags,
		(method)0L,(method)0L,calcoffset(t_cv_jit_shift,framecount),calcoffset(t_cv_jit_shift,frame));
	jit_class_addattr(_cv_jit_shift_class,attr);
	
	//Mass: the area's mass
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,"mass",_jit_sym_float32,attrflags,
		(method)0L,(method)0L,calcoffset(t_cv_jit_shift,mass));
	jit_class_addattr(_cv_jit_shift_class,attr);
	
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;
	//rect: the start bounding rectangle
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset_array,"rect",_jit_sym_long,4,attrflags,
		(method)0L,(method)0L,calcoffset(t_cv_jit_shift,rectcount),calcoffset(t_cv_jit_shift,rect));
	jit_class_addattr(_cv_jit_shift_class,attr);
	
	//Maximum number of iterations
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,"maxiters",_jit_sym_long,attrflags,
		(method)0L,(method)0L,calcoffset(t_cv_jit_shift,maxiters));
	jit_class_addattr(_cv_jit_shift_class,attr);
	
	//The minimum displacement
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,"distance",_jit_sym_float64,attrflags,
		(method)0L,(method)0L,calcoffset(t_cv_jit_shift,epsilon));
	jit_class_addattr(_cv_jit_shift_class,attr);
	
	//The mode, 0: meanshift -- 1: camshift
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,"mode",_jit_sym_char,attrflags,
		(method)0L,(method)0L,calcoffset(t_cv_jit_shift,mode));
	jit_attr_addfilterset_clip(attr,0,1,TRUE,TRUE);
	jit_class_addattr(_cv_jit_shift_class,attr);
			
	jit_class_register(_cv_jit_shift_class);

	return JIT_ERR_NONE;
}
t_jit_err jit_openlase_trace_init(void) 
{
	long attrflags=0;
	t_jit_object *attr, *mop;
	
	_jit_openlase_trace_class = jit_class_new("jit_openlase_trace",(method)jit_openlase_trace_new,(method)jit_openlase_trace_free,
		sizeof(t_jit_openlase_trace),0L);

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

	//add attributes	
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;	
	CLASS_STICKY_ATTR(_jit_openlase_trace_class,"category",0,"Laser");
	CLASS_STICKY_ATTR(_jit_openlase_trace_class,"basic",0,"1");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset, "rate", _jit_sym_long, attrflags,
						  (method)0L, (method)0L, calcoffset(t_jit_openlase_trace, params.rate));
	jit_class_addattr(_jit_openlase_trace_class,attr);
	CLASS_ATTR_LABEL(_jit_openlase_trace_class, "rate", 0, "rate: Speed of Laser Scanner (Hz)");

	attr = jit_object_new(_jit_sym_jit_attr_offset, "on_speed", _jit_sym_float32, attrflags,
						  (method)0L, (method)0L, calcoffset(t_jit_openlase_trace, params.on_speed));
	jit_class_addattr(_jit_openlase_trace_class,attr);
	CLASS_ATTR_LABEL(_jit_openlase_trace_class, "on_speed", 0, "");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset, "off_speed", _jit_sym_float32, attrflags,
						  (method)0L, (method)0L, calcoffset(t_jit_openlase_trace, params.off_speed));
	jit_class_addattr(_jit_openlase_trace_class,attr);
	CLASS_ATTR_LABEL(_jit_openlase_trace_class, "off_speed", 0, "");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset, "start_wait", _jit_sym_long, attrflags,
						  (method)0L, (method)0L, calcoffset(t_jit_openlase_trace, params.start_wait));
	jit_class_addattr(_jit_openlase_trace_class,attr);
	CLASS_ATTR_LABEL(_jit_openlase_trace_class, "start_wait", 0, "");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset, "end_wait", _jit_sym_long, attrflags,
						  (method)0L, (method)0L, calcoffset(t_jit_openlase_trace, params.end_wait));
	jit_class_addattr(_jit_openlase_trace_class, attr);
	CLASS_ATTR_LABEL(_jit_openlase_trace_class, "end_wait", 0, "");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset, "start_dwell", _jit_sym_long, attrflags,
						  (method)0L, (method)0L, calcoffset(t_jit_openlase_trace, params.start_dwell));
	jit_class_addattr(_jit_openlase_trace_class, attr);
	CLASS_ATTR_LABEL(_jit_openlase_trace_class, "start_dwell", 0, "");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset, "end_dwell", _jit_sym_long, attrflags,
						  (method)0L, (method)0L, calcoffset(t_jit_openlase_trace, params.end_dwell));
	jit_class_addattr(_jit_openlase_trace_class, attr);
	CLASS_ATTR_LABEL(_jit_openlase_trace_class, "end_dwell", 0, "");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset, "corner_dwell", _jit_sym_long, attrflags,
						  (method)0L, (method)0L, calcoffset(t_jit_openlase_trace, params.corner_dwell));
	jit_class_addattr(_jit_openlase_trace_class, attr);
	CLASS_ATTR_LABEL(_jit_openlase_trace_class, "corner_dwell", 0, "");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset, "min_length", _jit_sym_long, attrflags,
						  (method)0L, (method)0L, calcoffset(t_jit_openlase_trace, params.min_length));
	jit_class_addattr(_jit_openlase_trace_class, attr);
	CLASS_ATTR_LABEL(_jit_openlase_trace_class, "min_length", 0, "");

	attr = jit_object_new(_jit_sym_jit_attr_offset, "overscan", _jit_sym_float32, attrflags,
						  (method)0L, (method)0L, calcoffset(t_jit_openlase_trace, overscan));
	jit_class_addattr(_jit_openlase_trace_class, attr);
	CLASS_ATTR_LABEL(_jit_openlase_trace_class, "overscan", 0, "");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset, "aspect", _jit_sym_float32, attrflags,
						  (method)0L, (method)0L, calcoffset(t_jit_openlase_trace, aspect));
	jit_class_addattr(_jit_openlase_trace_class, attr);
	CLASS_ATTR_LABEL(_jit_openlase_trace_class, "aspect", 0, "");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset, "decimate", _jit_sym_long, attrflags,
						  (method)0L, (method)0L, calcoffset(t_jit_openlase_trace, decimate));
	jit_class_addattr(_jit_openlase_trace_class, attr);
	CLASS_ATTR_LABEL(_jit_openlase_trace_class, "decimate", 0, "");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset, "snap_pix", _jit_sym_long, attrflags,
						  (method)0L, (method)0L, calcoffset(t_jit_openlase_trace, snap_pix));
	jit_class_addattr(_jit_openlase_trace_class, attr);
	CLASS_ATTR_LABEL(_jit_openlase_trace_class, "snap_pix", 0, "");
	
	CLASS_STICKY_ATTR_CLEAR(_jit_openlase_trace_class, "category");
	CLASS_STICKY_ATTR_CLEAR(_jit_openlase_trace_class, "basic");
	
	jit_class_register(_jit_openlase_trace_class);
	return JIT_ERR_NONE;
}
Пример #23
0
t_jit_err jit_gl_hap_init(void) 
{
	void *ob3d;
	void *attr;
	long attrflags=0;
	long ob3d_flags = JIT_OB3D_NO_ROTATION_SCALE;
	ob3d_flags |= JIT_OB3D_NO_POLY_VARS;
	ob3d_flags |= JIT_OB3D_NO_BLEND;
	ob3d_flags |= JIT_OB3D_NO_TEXTURE;
	ob3d_flags |= JIT_OB3D_NO_MATRIXOUTPUT;
	ob3d_flags |= JIT_OB3D_AUTO_ONLY;
	ob3d_flags |= JIT_OB3D_NO_DEPTH;
	ob3d_flags |= JIT_OB3D_NO_ANTIALIAS;
	ob3d_flags |= JIT_OB3D_NO_FOG;
	ob3d_flags |= JIT_OB3D_NO_LIGHTING_MATERIAL;
	ob3d_flags |= JIT_OB3D_NO_SHADER;
	ob3d_flags |= JIT_OB3D_NO_BOUNDS;
	ob3d_flags |= JIT_OB3D_NO_COLOR;	
	
	_jit_gl_hap_class = jit_class_new("jit_gl_hap", 
		(method)jit_gl_hap_new, (method)jit_gl_hap_free,
		sizeof(t_jit_gl_hap),A_DEFSYM,0L);
	
	ob3d = jit_ob3d_setup(_jit_gl_hap_class, calcoffset(t_jit_gl_hap, ob3d), ob3d_flags);

	jit_class_addmethod(_jit_gl_hap_class, (method)jit_gl_hap_draw,			"ob3d_draw", A_CANT, 0L);
	jit_class_addmethod(_jit_gl_hap_class, (method)jit_gl_hap_dest_closing, "dest_closing", A_CANT, 0L);
	jit_class_addmethod(_jit_gl_hap_class, (method)jit_gl_hap_dest_changed, "dest_changed", A_CANT, 0L);
	jit_class_addmethod(_jit_gl_hap_class, (method)jit_object_register,		"register", A_CANT, 0L);

	jit_class_addmethod(_jit_gl_hap_class, (method)jit_gl_hap_read,			"read", A_GIMME, 0);
	jit_class_addmethod(_jit_gl_hap_class, (method)jit_gl_hap_sendoutput,	"sendoutput", A_DEFER_LOW, 0L);
	
	jit_class_addmethod(_jit_gl_hap_class, (method)jit_gl_hap_dispose,	"dispose",	A_USURP_LOW, 0L);
	jit_class_addmethod(_jit_gl_hap_class, (method)jit_gl_hap_start,	"start",	A_DEFER_LOW, 0L);
	jit_class_addmethod(_jit_gl_hap_class, (method)jit_gl_hap_stop,		"stop",		A_DEFER_LOW, 0L);
	jit_class_addmethod(_jit_gl_hap_class, (method)jit_gl_hap_jump,		"jump",		A_DEFER_LOW, 0L);
	jit_class_addmethod(_jit_gl_hap_class, (method)jit_gl_hap_frame,	"frame",	A_DEFER_LOW, 0L);
	jit_class_addmethod(_jit_gl_hap_class, (method)jit_gl_hap_clear_looppoints,	"clear_looppoints", A_DEFER_LOW, 0L);
	jit_class_addmethod(_jit_gl_hap_class, (method)jit_gl_hap_loadram,	"loadram",	A_DEFER_LOW, 0L);
	jit_class_addmethod(_jit_gl_hap_class, (method)jit_gl_hap_loadram,	"unloadram",A_DEFER_LOW, 0L);
	
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;
	
	//attr = jit_object_new(_jit_sym_jit_attr_offset,"adapt",_jit_sym_char,attrflags,
	//	(method)0L,(method)0L,calcoffset(t_jit_gl_hap,adapt));
	//jit_class_addattr(_jit_gl_hap_class,attr);
	//object_addattr_parse(attr,"style",_jit_sym_symbol,0,"onoff");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset_array,"dim",_jit_sym_long,2,attrflags,
		(method)0L,(method)0L,0,calcoffset(t_jit_gl_hap,dim));
	jit_class_addattr(_jit_gl_hap_class,attr);
	
	//attr = jit_object_new(_jit_sym_jit_attr_offset_array,"rect",_jit_sym_float32,4,attrflags,
	//	(method)0L,(method)0L,0,calcoffset(t_jit_gl_hap,rect));
	//jit_class_addattr(_jit_gl_hap_class,attr);
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"time",_jit_sym_long,attrflags,
		(method)jit_gl_hap_time_get,(method)jit_gl_hap_time_set,0L);
	jit_class_addattr(_jit_gl_hap_class,attr);
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"loop",_jit_sym_char,attrflags,
		(method)0L,(method)jit_gl_hap_loop_set,calcoffset(t_jit_gl_hap,loop));
	jit_class_addattr(_jit_gl_hap_class,attr);
	object_addattr_parse(attr,"style",_jit_sym_symbol,0,"enumindex");
	object_addattr_parse(attr,"enumvals",_jit_sym_atom,0,"off normal palindrome playback-limits");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"autostart",_jit_sym_char,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_gl_hap,autostart));
	jit_class_addattr(_jit_gl_hap_class,attr);
	object_addattr_parse(attr,"style",_jit_sym_symbol,0,"onoff");
		
	attr = jit_object_new(_jit_sym_jit_attr_offset,"rate",_jit_sym_float32,attrflags,
		(method)0L,(method)jit_gl_hap_rate_set,calcoffset(t_jit_gl_hap,rate));
	jit_class_addattr(_jit_gl_hap_class,attr);
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"vol",_jit_sym_float32,attrflags,
		(method)0L,(method)jit_gl_hap_vol_set,calcoffset(t_jit_gl_hap,vol));
	jit_class_addattr(_jit_gl_hap_class,attr);	
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"rate_preserves_pitch",_jit_sym_char,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_gl_hap,rate_preserves_pitch));
	jit_class_addattr(_jit_gl_hap_class,attr);
	object_addattr_parse(attr,"style",_jit_sym_symbol,0,"onoff");
		
	attr = jit_object_new(_jit_sym_jit_attr_offset,"loopstart",_jit_sym_long,attrflags,
		(method)0L,(method)jit_gl_hap_loopstart,calcoffset(t_jit_gl_hap,looppoints[0]));
	jit_class_addattr(_jit_gl_hap_class,attr);
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"loopend",_jit_sym_long,attrflags,
		(method)0L,(method)jit_gl_hap_loopend,calcoffset(t_jit_gl_hap,looppoints[1]));
	jit_class_addattr(_jit_gl_hap_class,attr);
	
	attr = jit_object_new(_jit_sym_jit_attr_offset_array,"looppoints",_jit_sym_long,2,attrflags,
		(method)0L,(method)jit_gl_hap_looppoints,0,calcoffset(t_jit_gl_hap,looppoints));
	jit_class_addattr(_jit_gl_hap_class,attr);
		
	attr = jit_object_new(_jit_sym_jit_attr_offset,"loopreport",_jit_sym_char,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_gl_hap,loopreport));
	jit_class_addattr(_jit_gl_hap_class,attr);
	object_addattr_parse(attr,"style",_jit_sym_symbol,0,"onoff");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"framereport",_jit_sym_char,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_gl_hap, framereport));
	jit_class_addattr(_jit_gl_hap_class,attr);
	object_addattr_parse(attr,"style",_jit_sym_symbol,0,"onoff");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"out_name",_jit_sym_symbol, attrflags,
		(method)jit_gl_hap_getattr_out_name,(method)jit_gl_hap_setattr_out_name,0);
	jit_class_addattr(_jit_gl_hap_class,attr);	

	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_OPAQUE_USER;
	attr = jit_object_new(_jit_sym_jit_attr_offset,"fps",_jit_sym_float32,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_gl_hap,fps));
	jit_class_addattr(_jit_gl_hap_class,attr);
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"duration",_jit_sym_long,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_gl_hap,duration));
	jit_class_addattr(_jit_gl_hap_class,attr);
			
	attr = jit_object_new(_jit_sym_jit_attr_offset,"timescale",_jit_sym_long,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_gl_hap,timescale));
	jit_class_addattr(_jit_gl_hap_class,attr);
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"framecount",_jit_sym_long,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_gl_hap,framecount));
	jit_class_addattr(_jit_gl_hap_class,attr);
				
	// hide default ob3d attrs that aren't used
	attrflags = JIT_ATTR_GET_OPAQUE_USER | JIT_ATTR_SET_OPAQUE_USER;
	attr = jit_object_new(_jit_sym_jit_attr_offset_array,"position",_jit_sym_float32,3,attrflags,
		(method)0L,(method)0L,0,0);
	jit_class_addattr(_jit_gl_hap_class,attr);
	attr = jit_object_new(_jit_sym_jit_attr_offset_array,"anchor",_jit_sym_float32,3,attrflags,
		(method)0L,(method)0L,0,0);
	jit_class_addattr(_jit_gl_hap_class,attr);
	attr = jit_object_new(_jit_sym_jit_attr_offset,"anim",_jit_sym_symbol, attrflags,
		(method)0L,(method)0L,0);
	jit_class_addattr(_jit_gl_hap_class,attr);
	attr = jit_object_new(_jit_sym_jit_attr_offset,"animmode",_jit_sym_symbol, attrflags,
		(method)0L,(method)0L,0);
	jit_class_addattr(_jit_gl_hap_class,attr);
	attr = jit_object_new(_jit_sym_jit_attr_offset,"filterclass",_jit_sym_symbol, attrflags,
		(method)0L,(method)0L,0);
	jit_class_addattr(_jit_gl_hap_class,attr);
	attr = jit_object_new(_jit_sym_jit_attr_offset,"layer",_jit_sym_long,attrflags,
		(method)0L,(method)0L,0L);
	jit_class_addattr(_jit_gl_hap_class,attr);
	
	jit_class_register(_jit_gl_hap_class);

	ps_bind = gensym("bind");
	ps_unbind = gensym("unbind");
	ps_width = gensym("width");
	ps_height = gensym("height");
	ps_glid = gensym("glid");	
	ps_draw = gensym("draw");

	return JIT_ERR_NONE;
}
Пример #24
0
t_jit_err jit_tml_constellations_init(void) 
{
	long attrflags=0;
	t_jit_object *attr;
	t_jit_object *mop, *o;
	
	//Create class with given constructors & destructors
	_jit_tml_constellations_class = jit_class_new("jit_tml_constellations",(method)jit_tml_constellations_new,(method)jit_tml_constellations_free,
		sizeof(t_jit_tml_constellations),A_CANT,0L); //A_CANT = untyped

	// 2 matrix input / 3 matrix output
	mop = (t_jit_object*)jit_object_new(_jit_sym_jit_mop,2,3);

	// 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_constellations_class,mop);
	
	// add methods
	jit_class_addmethod(_jit_tml_constellations_class, (method)jit_tml_constellations_matrix_calc, "matrix_calc", A_CANT, 0L);
	
	// Add attribute -- invert (0 or 1) - go from white/black to black/white
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;
	attr = (t_jit_object*)jit_object_new(_jit_sym_jit_attr_offset, "invert", _jit_sym_long,
							attrflags, (method)0L,
							(method)jit_tml_constellations_setInvert,
							calcoffset(t_jit_tml_constellations, invert));
	jit_class_addattr(_jit_tml_constellations_class, attr);
	
	
	// Add attribute -- minimum blob size (since blobs get huge)
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;
	attr = (t_jit_object*)jit_object_new(_jit_sym_jit_attr_offset, "minBlobSize", _jit_sym_long,
							attrflags, (method)0L,
							(method)jit_tml_constellations_setMinBlobSize,
							calcoffset(t_jit_tml_constellations, minBlobSize));
	jit_class_addattr(_jit_tml_constellations_class, attr);
	
	
	// Add attribute -- threshold (error)
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;
	attr = (t_jit_object*)jit_object_new(_jit_sym_jit_attr_offset, "threshold", _jit_sym_long,
							attrflags, (method)0L,
							(method)jit_tml_constellations_setThreshold,
							calcoffset(t_jit_tml_constellations, threshold));
	jit_class_addattr(_jit_tml_constellations_class, attr);
	
	
	// Add attribute -- threshold on the movement
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;
	attr = (t_jit_object*)jit_object_new(_jit_sym_jit_attr_offset, "movementThreshold", _jit_sym_long,
							attrflags, (method)0L,
							(method)jit_tml_constellations_setMovementThreshold,
							calcoffset(t_jit_tml_constellations, movementThreshold));
	jit_class_addattr(_jit_tml_constellations_class, attr);
	
	
	// Add attribute -- rate of learning (how many frames until stability?)
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;
	attr = (t_jit_object*)jit_object_new(_jit_sym_jit_attr_offset, "learnRate", _jit_sym_long,
							attrflags, (method)0L,
							(method)jit_tml_constellations_setLearnRate,
							calcoffset(t_jit_tml_constellations, learnRate));
	jit_class_addattr(_jit_tml_constellations_class, attr);
	
	
	// Add attribute -- ptCount - the number of points to use for outline.
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;
	attr = (t_jit_object*)jit_object_new(_jit_sym_jit_attr_offset, "ptCount", _jit_sym_long,
							attrflags, (method)0L,
							(method)jit_tml_constellations_setPtCount,
							calcoffset(t_jit_tml_constellations, ptCount));
	jit_class_addattr(_jit_tml_constellations_class, attr);
	
	
	// Add attribute -- grays (error)
	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)jit_tml_constellations_setRadius,
							calcoffset(t_jit_tml_constellations, radius));
	jit_class_addattr(_jit_tml_constellations_class, attr);
	
	//Done!	
	jit_class_register(_jit_tml_constellations_class);

	return JIT_ERR_NONE;
}
Пример #25
0
t_jit_err jit_freenect_grab_init(void)
{
	long attrflags=0;
	t_jit_object *attr;
	t_jit_object *mop,*output;
	t_atom a[4];
	
	global_id=0;
	x_systhread = NULL;
	x_systhread_cancel=FALSE;
	freenect_active=FALSE;
	open_device_count=0;
	
	s_rgb = gensym("rgb");
	s_RGB = gensym("RGB");
	s_ir = gensym("ir");
	s_IR = gensym("IR");
	
	_jit_freenect_grab_class = jit_class_new("jit_freenect_grab",(method)jit_freenect_grab_new,
											 (method)jit_freenect_grab_free, sizeof(t_jit_freenect_grab),0L);
  	
	//add mop
	mop = (t_jit_object *)jit_object_new(_jit_sym_jit_mop,0,2); //0 inputs, 2 outputs
	
	//Prepare depth image, all values are hard-coded, may need to be queried for safety?
	output = jit_object_method(mop,_jit_sym_getoutput,1);
		
	jit_atom_setsym(a,_jit_sym_float32); //default
	jit_atom_setsym(a+1,_jit_sym_long);
	jit_atom_setsym(a+2,_jit_sym_float64);
	jit_object_method(output,_jit_sym_types,3,a);
	
	jit_atom_setlong(&a[0], DEPTH_WIDTH);
	jit_atom_setlong(&a[1], DEPTH_HEIGHT);
	
	jit_object_method(output, _jit_sym_mindim, 2, a);  //Two dimensions, sizes in atom array
	jit_object_method(output, _jit_sym_maxdim, 2, a);
	
	//Prepare RGB image
	output = jit_object_method(mop,_jit_sym_getoutput,2);
	
	jit_atom_setsym(a,_jit_sym_char); //default
	jit_object_method(output,_jit_sym_types,1,a);
	
	jit_attr_setlong(output,_jit_sym_minplanecount,4);
	jit_attr_setlong(output,_jit_sym_maxplanecount,4);
	
	jit_atom_setlong(&a[0], RGB_WIDTH);
	jit_atom_setlong(&a[1], RGB_HEIGHT);
	
	jit_object_method(output, _jit_sym_mindim, 2, a);
	jit_object_method(output, _jit_sym_maxdim, 2, a);
	
	jit_class_addadornment(_jit_freenect_grab_class,mop);
	
	//add methods
	jit_class_addmethod(_jit_freenect_grab_class, (method)jit_freenect_grab_open, "open", A_GIMME, 0L);
	jit_class_addmethod(_jit_freenect_grab_class, (method)jit_freenect_grab_close, "close", A_GIMME, 0L);
	
	jit_class_addmethod(_jit_freenect_grab_class, (method)jit_freenect_grab_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,"unique",_jit_sym_char,
										  attrflags,(method)NULL,(method)NULL,calcoffset(t_jit_freenect_grab,unique));
	jit_attr_addfilterset_clip(attr,0,1,TRUE,TRUE);
	jit_class_addattr(_jit_freenect_grab_class,attr);
	
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,"threshold",_jit_sym_float32,
										  attrflags,(method)NULL,(method)NULL,calcoffset(t_jit_freenect_grab,threshold));
	jit_attr_addfilterset_clip(attr,0,0,TRUE,FALSE);
	jit_class_addattr(_jit_freenect_grab_class,attr);
	
	//attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,"cleardepth",_jit_sym_char,
										  attrflags,(method)NULL,(method)NULL,calcoffset(t_jit_freenect_grab,clear_depth));
	jit_attr_addfilterset_clip(attr,0,1,TRUE,TRUE);
	jit_class_addattr(_jit_freenect_grab_class,attr);
	
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,"mode",_jit_sym_char,
										  attrflags,(method)NULL,(method)jit_freenect_grab_set_mode,calcoffset(t_jit_freenect_grab,mode));
	jit_class_addattr(_jit_freenect_grab_class,attr);
	
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,"format",_jit_sym_atom,
										  attrflags,(method)NULL,(method)jit_freenect_grab_set_format,calcoffset(t_jit_freenect_grab,format));
	jit_class_addattr(_jit_freenect_grab_class,attr);
	
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,"tilt",_jit_sym_long,
										  attrflags,(method)jit_freenect_grab_get_tilt,(method)jit_freenect_grab_set_tilt,
										  calcoffset(t_jit_freenect_grab,tilt));
	jit_class_addattr(_jit_freenect_grab_class,attr);
	
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,"aligndepth",_jit_sym_char,
										  attrflags,(method)NULL,(method)NULL,calcoffset(t_jit_freenect_grab,aligndepth));
	jit_attr_addfilterset_clip(attr,0,1,TRUE,TRUE);
	jit_class_addattr(_jit_freenect_grab_class,attr);
	
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_OPAQUE;
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,"index",_jit_sym_long,
										  attrflags,(method)NULL,(method)NULL,calcoffset(t_jit_freenect_grab,index));
	jit_class_addattr(_jit_freenect_grab_class,attr);
	
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,"ndevices",_jit_sym_long,
										  attrflags,(method)jit_freenect_grab_get_ndevices,(method)NULL,calcoffset(t_jit_freenect_grab,ndevices));
	jit_class_addattr(_jit_freenect_grab_class,attr);
	
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset_array, "accel", _jit_sym_float64, 3, 
										  attrflags, (method)jit_freenect_grab_get_accel,(method)NULL, 
										  calcoffset(t_jit_freenect_grab, accelcount),calcoffset(t_jit_freenect_grab,mks_accel));
	jit_class_addattr(_jit_freenect_grab_class,attr);

	
	attrflags = JIT_ATTR_GET_OPAQUE_USER | JIT_ATTR_SET_OPAQUE_USER;
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,"has_frames",_jit_sym_char,
										  attrflags,(method)NULL,(method)NULL,calcoffset(t_jit_freenect_grab,has_frames));
	jit_class_addattr(_jit_freenect_grab_class,attr);
	
	jit_class_register(_jit_freenect_grab_class);
	
	post("jit.freenect.grab: Copyright 2010, Jean-Marc Pelletier, Nenad Popov and Andrew Roth. Built on %s",DEBUG_TIMESTAMP);
	return JIT_ERR_NONE;
}
Пример #26
0
t_jit_err jit_keyscreen_init(void)
{
	long attrflags=0;
	t_jit_object *attr, *mop;

	_jit_keyscreen_class = jit_class_new("jit_keyscreen",(method)jit_keyscreen_new,(method)jit_keyscreen_free,
										 sizeof(t_jit_keyscreen),0L);

	//add mop
	mop = jit_object_new(_jit_sym_jit_mop,3,1);
	jit_mop_single_type(mop,_jit_sym_char);
	jit_mop_single_planecount(mop,4);
	jit_class_addadornment(_jit_keyscreen_class,mop);

	//add methods
	jit_class_addmethod(_jit_keyscreen_class, (method)jit_keyscreen_matrix_calc, 		"matrix_calc", 		A_CANT, 0L);


	//add attributes
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;

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

	// mode -- switches keying states
	attr = jit_object_new(_jit_sym_jit_attr_offset,"mode",_jit_sym_long,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_keyscreen,mode));
	jit_class_addattr(_jit_keyscreen_class,attr);
	CLASS_ATTR_LABEL(_jit_keyscreen_class,"mode",0,"Keying Mode");
	CLASS_ATTR_ENUMINDEX3(_jit_keyscreen_class, "mode", 0, "Wrap", "Clip", "Fold");

	// key,target,mask -- switches who gets keyed with whom by whom
	attr = jit_object_new(_jit_sym_jit_attr_offset,"key",_jit_sym_long,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_keyscreen,key));
	jit_class_addattr(_jit_keyscreen_class,attr);
	CLASS_ATTR_LABEL(_jit_keyscreen_class,"key",0,"Key Input");

	attr = jit_object_new(_jit_sym_jit_attr_offset,"target",_jit_sym_long,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_keyscreen,target));
	jit_class_addattr(_jit_keyscreen_class,attr);
	CLASS_ATTR_LABEL(_jit_keyscreen_class,"target",0,"Target Input");

	attr = jit_object_new(_jit_sym_jit_attr_offset,"mask",_jit_sym_long,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_keyscreen,mask));
	jit_class_addattr(_jit_keyscreen_class,attr);
	CLASS_ATTR_LABEL(_jit_keyscreen_class,"mask",0,"Mask Input");

	// red, green, blue, tols -- changes colors and tolerances of the key
	attr = jit_object_new(_jit_sym_jit_attr_offset,"alpha",_jit_sym_float32,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_keyscreen,alpha));
	jit_class_addattr(_jit_keyscreen_class,attr);
	CLASS_ATTR_LABEL(_jit_keyscreen_class,"alpha",0,"Alpha");

	attr = jit_object_new(_jit_sym_jit_attr_offset,"red",_jit_sym_float32,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_keyscreen,red));
	jit_class_addattr(_jit_keyscreen_class,attr);
	CLASS_ATTR_LABEL(_jit_keyscreen_class,"red",0,"Red");

	attr = jit_object_new(_jit_sym_jit_attr_offset,"green",_jit_sym_float32,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_keyscreen,green));
	jit_class_addattr(_jit_keyscreen_class,attr);
	CLASS_ATTR_LABEL(_jit_keyscreen_class,"green",0,"Green");

	attr = jit_object_new(_jit_sym_jit_attr_offset,"blue",_jit_sym_float32,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_keyscreen,blue));
	jit_class_addattr(_jit_keyscreen_class,attr);
	CLASS_ATTR_LABEL(_jit_keyscreen_class,"blue",0,"Blue");

	attr = jit_object_new(_jit_sym_jit_attr_offset,"alphatol",_jit_sym_float32,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_keyscreen,alphatol));
	jit_class_addattr(_jit_keyscreen_class,attr);
	CLASS_ATTR_LABEL(_jit_keyscreen_class,"alphatol",0,"Alpha Tolerance");

	attr = jit_object_new(_jit_sym_jit_attr_offset,"redtol",_jit_sym_float32,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_keyscreen,redtol));
	jit_class_addattr(_jit_keyscreen_class,attr);
	CLASS_ATTR_LABEL(_jit_keyscreen_class,"redtol",0,"Red Tolerance");

	attr = jit_object_new(_jit_sym_jit_attr_offset,"greentol",_jit_sym_float32,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_keyscreen,greentol));
	jit_class_addattr(_jit_keyscreen_class,attr);
	CLASS_ATTR_LABEL(_jit_keyscreen_class,"greentol",0,"Green Tolerance");

	attr = jit_object_new(_jit_sym_jit_attr_offset,"bluetol",_jit_sym_float32,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_keyscreen,bluetol));
	jit_class_addattr(_jit_keyscreen_class,attr);
	CLASS_ATTR_LABEL(_jit_keyscreen_class,"bluetol",0,"Blue Tolerance");

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

	jit_class_register(_jit_keyscreen_class);

	return JIT_ERR_NONE;
}
Пример #27
0
t_jit_err cv_jit_opticalflow_init(void) 
{
	long attrflags=0;
	t_jit_object *attr,*mop;
	//t_symbol *atsym;
	
	//atsym = gensym("jit_attr_offset");
	
	_cv_jit_opticalflow_class = jit_class_new("cv_jit_opticalflow",(method)cv_jit_opticalflow_new,(method)cv_jit_opticalflow_free, sizeof(t_cv_jit_opticalflow),0L);
   	
	//add mop
	mop = (t_jit_object *)jit_object_new(_jit_sym_jit_mop,1,2);
	jit_mop_single_type(mop,_jit_sym_float32);	
	jit_mop_single_planecount(mop,2);
   	   	
	jit_class_addadornment(_cv_jit_opticalflow_class,mop);
	
	//add methods
	jit_class_addmethod(_cv_jit_opticalflow_class, (method)cv_jit_opticalflow_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,"method",_jit_sym_atom,attrflags,(method)cv_jit_opticalflow_get_method,(method)cv_jit_opticalflow_set_method,calcoffset(t_cv_jit_opticalflow,method));
	jit_class_addattr(_cv_jit_opticalflow_class,attr);
	
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,"use_previous",_jit_sym_long,attrflags,(method)0L,(method)cv_jit_opticalflow_set_use_previous,calcoffset(t_cv_jit_opticalflow,use_previous));
	jit_class_addattr(_cv_jit_opticalflow_class,attr);
	
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,"bm_max_range",_jit_sym_long,attrflags,(method)0L,(method)cv_jit_opticalflow_set_bm_max_range,calcoffset(t_cv_jit_opticalflow,bm_max_range));
	jit_class_addattr(_cv_jit_opticalflow_class,attr);
	
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,"bm_block_size",_jit_sym_long,attrflags,(method)0L,(method)cv_jit_opticalflow_set_bm_block_size,calcoffset(t_cv_jit_opticalflow,bm_block_size));
	jit_class_addattr(_cv_jit_opticalflow_class,attr);
	
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,"bm_shift_size",_jit_sym_long,attrflags,(method)0L,(method)cv_jit_opticalflow_set_bm_shift_size,calcoffset(t_cv_jit_opticalflow,bm_shift_size));
	jit_class_addattr(_cv_jit_opticalflow_class,attr);
	
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,"lk_window_size",_jit_sym_long,attrflags,(method)0L,(method)cv_jit_opticalflow_set_lk_window_size,calcoffset(t_cv_jit_opticalflow,lk_window_size));
	jit_class_addattr(_cv_jit_opticalflow_class,attr);
	
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,"hs_lambda",_jit_sym_float64,attrflags,(method)0L,(method)cv_jit_opticalflow_set_hs_lambda,calcoffset(t_cv_jit_opticalflow,hs_lambda));
	jit_class_addattr(_cv_jit_opticalflow_class,attr);
	
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,"fb_window_size",_jit_sym_long,attrflags,(method)0L,(method)cv_jit_opticalflow_set_fb_window_size,calcoffset(t_cv_jit_opticalflow,fb_window_size));
	jit_class_addattr(_cv_jit_opticalflow_class,attr);
	
	
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_OPAQUE; //Those parameters are better left to their default values
	
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,"fb_poly_n",_jit_sym_long,attrflags,(method)0L,(method)cv_jit_opticalflow_set_fb_poly_n,calcoffset(t_cv_jit_opticalflow,fb_poly_n));
	jit_class_addattr(_cv_jit_opticalflow_class,attr);
	
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,"fb_iterations",_jit_sym_long,attrflags,(method)0L,(method)cv_jit_opticalflow_set_fb_iterations,calcoffset(t_cv_jit_opticalflow,fb_iterations));
	jit_class_addattr(_cv_jit_opticalflow_class,attr);
	
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,"fb_poly_sigma",_jit_sym_float64,attrflags,(method)0L,(method)cv_jit_opticalflow_set_fb_poly_sigma,calcoffset(t_cv_jit_opticalflow,fb_poly_sigma));
	jit_class_addattr(_cv_jit_opticalflow_class,attr);
	
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,"fb_pyramid_scale",_jit_sym_float64,attrflags,(method)0L,(method)cv_jit_opticalflow_set_fb_pyramid_scale,calcoffset(t_cv_jit_opticalflow,fb_pyramid_scale));
	jit_class_addattr(_cv_jit_opticalflow_class,attr);
	
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,"fb_levels",_jit_sym_long,attrflags,(method)0L,(method)cv_jit_opticalflow_set_fb_levels,calcoffset(t_cv_jit_opticalflow,fb_levels));
	jit_class_addattr(_cv_jit_opticalflow_class,attr);
	
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,"hs_epsilon",_jit_sym_float64,attrflags,(method)0L,(method)cv_jit_opticalflow_set_hs_epsilon,calcoffset(t_cv_jit_opticalflow,hs_epsilon));
	jit_class_addattr(_cv_jit_opticalflow_class,attr);
	
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset,"hs_max_iterations",_jit_sym_long,attrflags,(method)0L,(method)cv_jit_opticalflow_set_hs_max_iterations,calcoffset(t_cv_jit_opticalflow,hs_max_iterations));
	jit_class_addattr(_cv_jit_opticalflow_class,attr);
			
	jit_class_register(_cv_jit_opticalflow_class);

	return JIT_ERR_NONE;
}
Пример #28
0
t_jit_err jit_print_init(void)
{
	long attrflags=0;
	t_jit_object *attr;
	t_jit_object *mop;

	_jit_print_class = jit_class_new("jit_print",(method)jit_print_new,(method)jit_print_free,
									 sizeof(t_jit_print),0L);

	//add mop
	mop = jit_object_new(_jit_sym_jit_mop,1,1);
	jit_class_addadornment(_jit_print_class,mop);
	//add methods
	jit_class_addmethod(_jit_print_class, (method)jit_print_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,"precision",_jit_sym_char,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_print,precision));
	jit_attr_addfilterset_clip(attr,0,0,TRUE,FALSE);	//clip to 0-x
	jit_class_addattr(_jit_print_class,attr);
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"Precision");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"fieldwidth",_jit_sym_char,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_print,fieldwidth));
	jit_attr_addfilterset_clip(attr,0,0,TRUE,FALSE);	//clip to 0-x
	jit_class_addattr(_jit_print_class,attr);
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"\"Field Width\"");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"mode",_jit_sym_char,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_print,mode));
	jit_attr_addfilterset_clip(attr,0,2,TRUE,TRUE);	//clip to 0-2
	jit_class_addattr(_jit_print_class,attr);
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"Mode");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"zeropad",_jit_sym_char,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_print,zeropad));
	jit_attr_addfilterset_clip(attr,0,1,TRUE,TRUE);	//clip to 0-1
	jit_class_addattr(_jit_print_class,attr);
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"\"Zero Pad\"");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"planedelim",_jit_sym_symbol,attrflags,
						  (method)jit_print_planedelim_get,(method)jit_print_planedelim_set,0L);
	jit_class_addattr(_jit_print_class,attr);
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"\"Plane Delimiter\"");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"coldelim",_jit_sym_symbol,attrflags,
						  (method)jit_print_coldelim_get,(method)jit_print_coldelim_set,0L);
	jit_class_addattr(_jit_print_class,attr);
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"\"Column Delimiter\"");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"rowdelim",_jit_sym_symbol,attrflags,
						  (method)jit_print_rowdelim_get,(method)jit_print_rowdelim_set,0L);
	jit_class_addattr(_jit_print_class,attr);
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"\"Row Delimiter\"");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"title",_jit_sym_symbol,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_print, title));
	jit_class_addattr(_jit_print_class,attr);
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"Title");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"info",_jit_sym_char,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_print, info));
	jit_attr_addfilterset_clip(attr,0,2,TRUE,TRUE);	//clip to 0-1
	jit_class_addattr(_jit_print_class,attr);
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"Info");
	

	jit_class_register(_jit_print_class);
	ps_null = gensym("");
	ps_tab = gensym("tab");
	ps_cr = gensym("cr");
	ps_space = gensym("space");

	return JIT_ERR_NONE;
}
Пример #29
0
t_jit_err jit_gl_videoplane_init(void) 
{
	long attrflags=0;
	long ob3d_flags=0;
	t_jit_object *attr;
	void * ob3d;
	
	_jit_gl_videoplane_class = jit_class_new("jit_gl_videoplane", (method)jit_gl_videoplane_new, (method)jit_gl_videoplane_free,
		sizeof(t_jit_gl_videoplane),A_DEFSYM,0L);
	
	jit_class_addmethod(_jit_gl_videoplane_class, (method)jit_gl_videoplane_jit_matrix,		"jit_matrix", 			A_USURP_LOW, 0);	
	jit_class_addmethod(_jit_gl_videoplane_class, (method)jit_gl_videoplane_sendtexture,	"sendtexture", 			A_DEFER_LOW, 0);	

	// set up object extension for 3d object, customized with flags
	ob3d = jit_ob3d_setup(_jit_gl_videoplane_class, calcoffset(t_jit_gl_videoplane, ob3d), ob3d_flags);

	// 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,2,attrflags,
		(method)0L,(method)jit_gl_videoplane_dim,0/*fix*/,calcoffset(t_jit_gl_videoplane,dim));
	jit_attr_addfilterset_clip(attr,2,0,TRUE,FALSE);
	jit_class_addattr(_jit_gl_videoplane_class,attr);	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"displaylist",_jit_sym_char,attrflags,
		(method)0L,(method)jit_gl_videoplane_displaylist,calcoffset(t_jit_gl_videoplane, displaylist));	
	jit_class_addattr(_jit_gl_videoplane_class,attr);	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"gridmode",_jit_sym_char,attrflags,
		(method)0L,(method)jit_gl_videoplane_attr_rebuild,calcoffset(t_jit_gl_videoplane, gridmode));	
	jit_class_addattr(_jit_gl_videoplane_class,attr);	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"interp",_jit_sym_long,attrflags,
		(method)0L,(method)jit_gl_videoplane_interp,calcoffset(t_jit_gl_videoplane, interp));	
	jit_class_addattr(_jit_gl_videoplane_class,attr);	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"nudge",_jit_sym_float32,attrflags,
		(method)0L,(method)jit_gl_videoplane_attr_rebuild,calcoffset(t_jit_gl_videoplane, nudge));	
	jit_class_addattr(_jit_gl_videoplane_class,attr);
	attr = jit_object_new(_jit_sym_jit_attr_offset,"tex_offset_x",_jit_sym_float32,attrflags,
		(method)0L,(method)jit_gl_videoplane_attr_rebuild,calcoffset(t_jit_gl_videoplane, tex_offset_x));	
	jit_class_addattr(_jit_gl_videoplane_class,attr);
	attr = jit_object_new(_jit_sym_jit_attr_offset,"tex_offset_y",_jit_sym_float32,attrflags,
		(method)0L,(method)jit_gl_videoplane_attr_rebuild,calcoffset(t_jit_gl_videoplane, tex_offset_y));	
	jit_class_addattr(_jit_gl_videoplane_class,attr);
	attr = jit_object_new(_jit_sym_jit_attr_offset,"tex_scale_x",_jit_sym_float32,attrflags,
		(method)0L,(method)jit_gl_videoplane_attr_rebuild,calcoffset(t_jit_gl_videoplane, tex_scale_x));	
	jit_class_addattr(_jit_gl_videoplane_class,attr);
	attr = jit_object_new(_jit_sym_jit_attr_offset,"tex_scale_y",_jit_sym_float32,attrflags,
		(method)0L,(method)jit_gl_videoplane_attr_rebuild,calcoffset(t_jit_gl_videoplane, tex_scale_y));	
	jit_class_addattr(_jit_gl_videoplane_class,attr); 				
	attr = jit_object_new(_jit_sym_jit_attr_offset,"rect_tex",_jit_sym_long,attrflags,
		(method)0L,(method)jit_gl_videoplane_rect_tex,calcoffset(t_jit_gl_videoplane, rect_tex));	
	jit_class_addattr(_jit_gl_videoplane_class,attr);	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"client_storage",_jit_sym_long,attrflags,
		(method)0L,(method)jit_gl_videoplane_client_storage,calcoffset(t_jit_gl_videoplane, client_storage));	
	jit_class_addattr(_jit_gl_videoplane_class,attr);	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"colormode",_jit_sym_symbol,attrflags,
		(method)0L,(method)jit_gl_videoplane_colormode,calcoffset(t_jit_gl_videoplane, colormode));	
	jit_class_addattr(_jit_gl_videoplane_class,attr);
	CLASS_ATTR_ENUM(_jit_gl_videoplane_class,"colormode",0,"argb uyvy");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"texturename",_jit_sym_symbol,attrflags,
		(method)0L,(method)jit_gl_videoplane_texturename,calcoffset(t_jit_gl_videoplane, texturename));	
	jit_class_addattr(_jit_gl_videoplane_class,attr);	

	// define our OB3D draw method.  called in automatic mode by 
	// jit.gl.render or otherwise through ob3d when banged. this 
	// method is A_CANT because our draw setup needs to happen 
	// in the ob3d beforehand to initialize OpenGL state 
	jit_class_addmethod(_jit_gl_videoplane_class, (method)jit_gl_videoplane_draw, "ob3d_draw", A_CANT, 0L);
	
	// define our dest_closing and dest_changed methods. 
	// these methods are called by jit.gl.render when the 
	// destination context closes or changes: for example, when 
	// the user moves the window from one monitor to another. Any 
	// resources your object keeps in the OpenGL machine 
	// (e.g. textures, display lists, vertex shaders, etc.) 
	// will need to be freed when closing, and rebuilt when it has 
	// changed. 
	jit_class_addmethod(_jit_gl_videoplane_class, (method)jit_gl_videoplane_dest_changed, "dest_changed",	A_CANT, 0L);
	jit_class_addmethod(_jit_gl_videoplane_class, (method)jit_gl_videoplane_dest_closing, "dest_closing",	A_CANT, 0L);

	// rebuild_geometry is called if texture units or other 
	// attributes change requiring a rebuild
	jit_class_addmethod(_jit_gl_videoplane_class, (method)jit_gl_videoplane_rebuild_geometry, "rebuild_geometry", 0L);
	
	// must register for ob3d	
	jit_class_addmethod(_jit_gl_videoplane_class, (method)jit_object_register, 				"register",		A_CANT, 0L);

	jit_class_register(_jit_gl_videoplane_class);

	ps_bind				= gensym("bind");
	ps_unbind			= gensym("unbind");
	ps_jit_gl_texture	= gensym("jit_gl_texture");
	ps_rectangle		= gensym("rectangle");
	ps_colormode		= gensym("colormode");
	ps_mode				= gensym("mode");
	ps_static			= gensym("static");
	ps_dynamic			= gensym("dynamic");
	ps_drawto			= gensym("drawto");
	ps_texture			= gensym("texture");
	ps_filter			= gensym("filter");
	ps_linear			= gensym("linear");
	ps_nearest			= gensym("nearest");

	ps_gridmode			= gensym("gridmode");
	ps_nudge			= gensym("nudge");
	ps_tex_offset_x		= gensym("tex_offset_x");
	ps_tex_offset_y		= gensym("tex_offset_y");
	ps_tex_scale_x		= gensym("tex_scale_x");
	ps_tex_scale_y		= gensym("tex_scale_y");


	return JIT_ERR_NONE;
}
Пример #30
0
t_jit_err jit_boids2d_init(void) 
{
	long attrflags=0;
	t_jit_object *attr,*mop,*o;
	t_symbol *atsym;
	
	atsym = gensym("jit_attr_offset");
	
	_jit_boids2d_class = jit_class_new("jit_boids2d",(method)jit_boids2d_new,(method)jit_boids2d_free,
		sizeof(t_jit_boids2d),0L); 

	//add mop
	mop = jit_object_new(_jit_sym_jit_mop,0,1);
	o = jit_object_method(mop,_jit_sym_getoutput,1);
	jit_attr_setlong(o,_jit_sym_dimlink,0);
	
	jit_class_addadornment(_jit_boids2d_class,mop);
	//add methods
	jit_class_addmethod(_jit_boids2d_class, (method)jit_boids2d_matrix_calc, 		"matrix_calc", 		A_CANT, 0L);
	jit_class_addmethod(_jit_boids2d_class, (method)Flock_reset, 					"init", 			A_USURP_LOW, 0L);
	jit_class_addmethod(_jit_boids2d_class, (method)Flock_resetBoids, 				"reset", 			A_USURP_LOW, 0L);

	//add attributes	
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;
	
	//mode
	attr = jit_object_new(atsym,"mode",_jit_sym_char,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_boids2d,mode));
	jit_class_addattr(_jit_boids2d_class,attr);
	
	//number
	attr = jit_object_new(atsym,"number",_jit_sym_long,attrflags,
		(method)0L,(method)jit_boids2d_number,calcoffset(t_jit_boids2d,number));
	jit_class_addattr(_jit_boids2d_class,attr);
	
	//neighbors
	attr = jit_object_new(atsym,"neighbors",_jit_sym_long,attrflags,
		(method)0L,(method)jit_boids2d_neighbors,calcoffset(t_jit_boids2d,neighbors));
	jit_class_addattr(_jit_boids2d_class,attr);

	//flyrect
	attr = jit_object_new(_jit_sym_jit_attr_offset_array,"flyrect",_jit_sym_float64,4,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_boids2d,flyRectCount),calcoffset(t_jit_boids2d,flyrect));
	jit_class_addattr(_jit_boids2d_class,attr);
	
	//minspeed
	attr = jit_object_new(atsym,"minspeed",_jit_sym_float64,attrflags,
		(method)0L,(method)jit_boids2d_minspeed,calcoffset(t_jit_boids2d,minspeed));
	jit_class_addattr(_jit_boids2d_class,attr);
	
	//maxspeed
	attr = jit_object_new(atsym,"maxspeed",_jit_sym_float64,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_boids2d,maxspeed));
	jit_class_addattr(_jit_boids2d_class,attr);
	
	//center
	attr = jit_object_new(atsym,"center",_jit_sym_float64,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_boids2d,center));
	jit_class_addattr(_jit_boids2d_class,attr);
	
	//attract
	attr = jit_object_new(atsym,"attract",_jit_sym_float64,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_boids2d,attract));
	jit_class_addattr(_jit_boids2d_class,attr);
	
	//match
	attr = jit_object_new(atsym,"match",_jit_sym_float64,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_boids2d,match));
	jit_class_addattr(_jit_boids2d_class,attr);
	
	//avoid
	attr = jit_object_new(atsym,"avoid",_jit_sym_float64,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_boids2d,avoid));
	jit_class_addattr(_jit_boids2d_class,attr);
	
	//repel
	attr = jit_object_new(atsym,"repel",_jit_sym_float64,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_boids2d,repel));
	jit_class_addattr(_jit_boids2d_class,attr);
	
	//edgedist
	attr = jit_object_new(atsym,"edgedist",_jit_sym_float64,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_boids2d,edgedist));
	jit_class_addattr(_jit_boids2d_class,attr);
	
	//speed
	attr = jit_object_new(atsym,"speed",_jit_sym_float64,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_boids2d,speed));
	jit_class_addattr(_jit_boids2d_class,attr);
	
	//inertia
	attr = jit_object_new(atsym,"inertia",_jit_sym_float64,attrflags,
		(method)0L,(method)jit_boids2d_inertia,calcoffset(t_jit_boids2d,inertia));
	jit_class_addattr(_jit_boids2d_class,attr);
	
	//accel
	attr = jit_object_new(atsym,"accel",_jit_sym_float64,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_boids2d,accel));
	jit_class_addattr(_jit_boids2d_class,attr);
	
	//prefdist
	attr = jit_object_new(atsym,"prefdist",_jit_sym_float64,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_boids2d,prefdist));
	jit_class_addattr(_jit_boids2d_class,attr);
	
	//centerPt
	attr = jit_object_new(_jit_sym_jit_attr_offset_array,"centerPt",_jit_sym_float64,2,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_boids2d,centerPtCount),calcoffset(t_jit_boids2d,centerPt));
	jit_class_addattr(_jit_boids2d_class,attr);
	
	//attractpt.
	attr = jit_object_new(_jit_sym_jit_attr_offset_array,"attractpt",_jit_sym_float64,2,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_boids2d,attractPtCount),calcoffset(t_jit_boids2d,attractpt));
	jit_class_addattr(_jit_boids2d_class,attr);



	//set_pos.
	attr = jit_object_new(_jit_sym_jit_attr_offset_array,"set_pos",_jit_sym_float64,2,attrflags,
		(method)0L,(method)jit_boids2d_set_pos,calcoffset(t_jit_boids2d,set_pos));
	jit_class_addattr(_jit_boids2d_class,attr);
	//set_dir.
	attr = jit_object_new(_jit_sym_jit_attr_offset_array,"set_dir",_jit_sym_float64,2,attrflags,
		(method)0L,(method)jit_boids2d_set_dir,calcoffset(t_jit_boids2d,set_pos));
	jit_class_addattr(_jit_boids2d_class,attr);
	//set_speed
	attr = jit_object_new(atsym,"set_speed",_jit_sym_float64,attrflags,
		(method)0L,(method)jit_boids2d_set_speed,calcoffset(t_jit_boids2d,set_speed));
	jit_class_addattr(_jit_boids2d_class,attr);
	//set_speed
	attr = jit_object_new(atsym,"set_speedinv",_jit_sym_float64,attrflags,
		(method)0L,(method)jit_boids2d_set_speedinv,calcoffset(t_jit_boids2d,set_speedinv));
	jit_class_addattr(_jit_boids2d_class,attr);
	//number
	attr = jit_object_new(atsym,"set",_jit_sym_long,attrflags,
		(method)0L,(method)jit_boids2d_set,calcoffset(t_jit_boids2d,set));
	jit_class_addattr(_jit_boids2d_class,attr);
	
	
	
	jit_class_register(_jit_boids2d_class);

	return JIT_ERR_NONE;
}