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_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; }
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; }
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; }
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; }
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; }
t_jit_err jit_field_mesh_init(void) { long attrflags=0; t_jit_object *attr; _jit_field_mesh_class = jit_class_new("jit_field_mesh",(method)jit_field_mesh_new,(method)jit_field_mesh_free, sizeof(t_jit_field_mesh),0L); // add attributes attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW; jit_class_addmethod(_jit_field_mesh_class, (method)jit_field_mesh_jit_field, "jit_field", A_GIMME, 0L); jit_class_addmethod(_jit_field_mesh_class, (method)jit_field_mesh_get_vertex_matrix, "get_vertex_matrix", A_CANT, 0L); jit_class_addmethod(_jit_field_mesh_class, (method)jit_field_mesh_get_normal_matrix, "get_normal_matrix", A_CANT, 0L); jit_class_addmethod(_jit_field_mesh_class, (method)jit_field_mesh_get_index_matrix, "get_index_matrix", A_CANT, 0L); jit_class_addmethod(_jit_field_mesh_class, (method)jit_field_mesh_volume_to_mesh, "volume_to_mesh", A_CANT, 0L); attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset, "isolevel", _jit_sym_float32, attrflags, (method)0L, (method)0L, calcoffset(t_jit_field_mesh, isolevel)); jit_class_addattr(_jit_field_mesh_class, (t_jit_object*)attr); attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset, "mode", _jit_sym_symbol, attrflags, (method)0L, (method)0L, calcoffset(t_jit_field_mesh, mode)); jit_class_addattr(_jit_field_mesh_class, (t_jit_object*)attr); CLASS_ATTR_ENUM((t_class *)_jit_field_mesh_class, "mode", 0, "mesh particles"); jit_class_register(_jit_field_mesh_class); return JIT_ERR_NONE; }
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; }
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; }
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; }
void main(void) { void *p,*q,*attr; long attrflags; jit_unpack_init(); setup(&max_jit_unpack_class, max_jit_unpack_new, (method)max_jit_unpack_free, (short)sizeof(t_max_jit_unpack), 0L, A_GIMME, 0); p = max_jit_classex_setup(calcoffset(t_max_jit_unpack,obex)); q = jit_class_findbyname(gensym("jit_unpack")); addmess((method)max_jit_unpack_jit_matrix, "jit_matrix", A_GIMME,0); //place at beginning for speed max_jit_classex_mop_wrap(p,q,MAX_JIT_MOP_FLAGS_OWN_JIT_MATRIX); // max_jit_classex_mop_wrap(p,q,0); max_jit_classex_standard_wrap(p,q,0); 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)max_jit_mop_gettype,(method)max_jit_mop_type,0/*custom*/); object_addattr_parse(attr,"category",_jit_sym_symbol,0,"MOP"); max_jit_classex_addattr(p,attr); attr = jit_object_new(_jit_sym_jit_attr_offset_array,"dim",_jit_sym_long,JIT_MATRIX_MAX_DIMCOUNT,attrflags, (method)max_jit_mop_getdim,(method)max_jit_mop_dim,0/*custom*/); object_addattr_parse(attr,"category",_jit_sym_symbol,0,"MOP"); max_jit_classex_addattr(p,attr); addmess((method)max_jit_mop_assist, "assist", A_CANT,0); addmess((method)max_jit_mop_variable_anything, "anything", A_GIMME, 0); }
t_jit_err jit_field_sphere_init(void) { long attrflags=0; t_jit_object *attr; _jit_field_sphere_class = jit_class_new("jit_field_sphere",(method)jit_field_sphere_new,(method)jit_field_sphere_free, sizeof(t_jit_field_sphere),0L); // add attributes attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW; jit_class_addmethod(_jit_field_sphere_class, (method)jit_field_sphere_create, "create", A_GIMME, 0L); jit_class_addmethod(_jit_field_sphere_class, (method)jit_field_sphere_getfield, "getfield", A_CANT, 0L); attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset_array, "center", _jit_sym_float32, 3, attrflags, (method)0L, (method)0L, NULL, calcoffset(t_jit_field_sphere, center)); jit_class_addattr(_jit_field_sphere_class, attr); attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset, "radius", _jit_sym_float32, attrflags, (method)0L, (method)0L, calcoffset(t_jit_field_sphere, radius)); jit_class_addattr(_jit_field_sphere_class, (t_jit_object*)attr); attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset, "halfwidth", _jit_sym_float32, attrflags, (method)0L, (method)0L, calcoffset(t_jit_field_sphere, halfwidth)); jit_class_addattr(_jit_field_sphere_class, (t_jit_object*)attr); jit_class_register(_jit_field_sphere_class); return JIT_ERR_NONE; }
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 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; }
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; }
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; }
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; }
t_jit_gl_hap *jit_gl_hap_new(t_symbol * dest_name) { t_jit_gl_hap *x; if (x = (t_jit_gl_hap *)jit_object_alloc(_jit_gl_hap_class)) { jit_ob3d_new(x, dest_name); jit_gl_hap_new_native(x); x->has_video = 0; x->file = _jit_sym_nothing; x->texoutput = jit_object_new(gensym("jit_gl_texture"), dest_name); jit_attr_setsym(x->texoutput,gensym("defaultimage"),gensym("black")); jit_attr_setsym(x->texoutput,_jit_sym_name,jit_symbol_unique()); jit_attr_setlong(x->texoutput, gensym("flip"), 0); x->hapglsl = jit_object_new(gensym("jit_gl_shader"), dest_name); x->buffer = NULL; x->hap_format = JIT_GL_HAP_PF_NONE; x->useshader = 0; x->validframe = 0; x->movieloaded = 0; x->deletetex = 0; x->texture = 0; x->dim[0] = x->dim[1] = 0; x->backingWidth = x->backingHeight = 0; x->roundedWidth = x->roundedHeight = 0; x->internalFormat = x->newInternalFormat = 0; x->newDataLength = x->rowLength = 0; x->target = 0; x->fboid = 0; x->direction = 1; x->suppress_loopnotify=0; x->userloop = 0; x->prevtime = 0; x->flipped = 0; x->adapt = 1; x->fps = 0; x->duration = 0; x->timescale = 0; x->framecount = 0; x->loop = JIT_GL_HAP_LOOP_ON; x->loopflags = 0; x->autostart = 1; x->rate = 1; x->vol = 1; x->rate_preserves_pitch = 1; x->looppoints[0] = x->looppoints[1] = -1; x->loopreport = 0; x->framereport = 0; } else { x = NULL; } return x; }
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; }
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; }
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; }
void *max_jit_scissors_new(t_symbol *s, long argc, t_atom *argv) { t_max_jit_scissors *x; void *o, *p, *mop; t_jit_matrix_info info; long i; if (x=(t_max_jit_scissors *)max_jit_obex_new(max_jit_scissors_class, gensym("jit_scissors"))) { if (o=jit_object_new(gensym("jit_scissors"))) { max_jit_obex_jitob_set(x, o); max_jit_obex_dumpout_set(x, outlet_new(x, NULL)); max_jit_mop_setup(x); max_jit_mop_inputs(x); max_jit_attr_args(x, argc, argv); // get attr args to know rows and cols x->maxn = jit_attr_getlong(o, ps_rows) * jit_attr_getlong(o, ps_columns); max_jit_mop_variable_addoutputs(x, x->maxn); max_jit_mop_outputs(x); // don't forget the nolink! mop = max_jit_obex_adornment_get(x, _jit_sym_jit_mop); for (i = 1; i <= x->maxn; i++) jit_mop_output_nolink(mop, i); jit_attr_setlong(o, gensym("max"), x->maxn); max_jit_mop_matrix_args(x, argc, argv); // now set matrix info } else { jit_object_error((t_object *)x,"jit.scissors: could not allocate object"); freeobject((t_object *) x); x = NULL; } } return (x); }
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; }
void main(void) { void *p,*q,*attr; long attrflags; setup(&max_jit_op_class, max_jit_op_new, (method)max_jit_op_free, (short)sizeof(t_max_jit_op), 0L, A_GIMME, 0); p = max_jit_classex_setup(calcoffset(t_max_jit_op,obex)); q = jit_class_findbyname(gensym("jit_op")); addmess((method)max_jit_op_jit_matrix, "jit_matrix", A_GIMME, 0); max_jit_classex_mop_wrap(p,q,MAX_JIT_MOP_FLAGS_OWN_JIT_MATRIX); max_jit_classex_mop_mproc(p,q,max_jit_op_mproc); //custom mproc max_jit_classex_standard_wrap(p,q,0); attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW ; attr = jit_object_new(_jit_sym_jit_attr_offset_array,"val",_jit_sym_atom,JIT_MATRIX_MAX_PLANECOUNT,attrflags, (method)0,(method)max_jit_op_val,calcoffset(t_max_jit_op,valcount),calcoffset(t_max_jit_op,val)); max_jit_classex_addattr(p,attr); addint((method)max_jit_op_int); addfloat((method)max_jit_op_float); addmess((method)max_jit_op_list, "list", A_GIMME, 0); addmess((method)max_jit_mop_assist, "assist", A_CANT,0); }
void *max_jit_submatrix_new(t_symbol *s, long argc, t_atom *argv) { t_max_jit_submatrix *x; void *o,*m,*mop,*p; t_jit_matrix_info info; if (x=(t_max_jit_submatrix *)max_jit_obex_new(max_jit_submatrix_class,gensym("jit_submatrix"))) { if (o=jit_object_new(gensym("jit_submatrix"))) { max_jit_obex_jitob_set(x,o); max_jit_obex_dumpout_set(x,outlet_new(x,NULL)); max_jit_mop_setup(x); max_jit_mop_inputs(x); max_jit_mop_outputs(x); mop=max_jit_obex_adornment_get(x,_jit_sym_jit_mop); jit_attr_setlong(mop,gensym("adapt"),0); jit_attr_setlong(mop,gensym("caninplace"),0); jit_attr_setlong(mop,gensym("outputmode"),1); //make the output matrix a data reference w/NULL data pointer m = max_jit_mop_getoutput(x,1); jit_object_method(m,_jit_sym_getinfo,&info); jit_object_method(m,gensym("freedata")); info.flags = JIT_MATRIX_DATA_REFERENCE; info.size = 0; p = NULL; jit_object_method(m,_jit_sym_setinfo_ex,&info); jit_object_method(m,_jit_sym_data,p); max_jit_attr_args(x,argc,argv); } else { jit_object_error((t_object *)x,"jit.submatrix: could not allocate object"); freeobject((t_object *) x); x = NULL; } } return (x); }
void *max_jit_str_op_new(t_symbol *s, long argc, t_atom *argv) { t_max_jit_str_op *x; void *o, *m; t_jit_matrix_info info; if (x=(t_max_jit_str_op *)max_jit_obex_new(max_jit_str_op_class,gensym("jit_str_op"))) { if (o=jit_object_new(gensym("jit_str_op"))) { max_jit_mop_setup_simple(x,o,argc,argv); m = max_jit_mop_getinput(x, 2); jit_object_method(m, _jit_sym_getinfo, &info); info.type = _jit_sym_char; info.planecount = 1; info.dimcount = 1; info.dim[0] = 1; jit_object_method(m, _jit_sym_setinfo, &info); max_jit_attr_args(x,argc,argv); } else { jit_object_error((t_object *)x,"jit.str.op: could not allocate object"); freeobject(x); x = NULL; } } return (x); }
t_xray_jit_cellcoords *xray_jit_cellcoords_new(void) { t_xray_jit_cellcoords *x; t_jit_matrix_info info; void *m; if (x=(t_xray_jit_cellcoords *)jit_object_alloc(_xray_jit_cellcoords_class)) { x->plane = 0; x->out_mode = 0; //initialize internal matrix jit_matrix_info_default(&info); info.type = _jit_sym_char; info.planecount = 2; x->temp_name = jit_symbol_unique(); m = jit_object_new(_jit_sym_jit_matrix, &info); m = jit_object_method(m, _jit_sym_register, x->temp_name); //Register matrix name if(!m) error("could not allocate internal matrix!"); jit_object_attach(x->temp_name, x); x->temp = m; } else { x = NULL; } return x; }
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; }
void *max_jit_ys_pixelweightmat_new(t_symbol *s, long argc, t_atom *argv) { t_max_jit_ys_pixelweightmat *x; void *o; if (x=(t_max_jit_ys_pixelweightmat *)max_jit_obex_new(max_jit_ys_pixelweightmat_class,gensym("jit_ys_pixelweightmat"))) { if (o=jit_object_new(gensym("jit_ys_pixelweightmat"))) { // add aditional non-matrix output //x->mapout = outlet_new(x, 0L); // alocate buffer for outlet //x->mapout_buff = jit_getbytes(sizeof(long)*MAX_OUT); // create matrix outlet? max_jit_mop_setup_simple(x,o,argc,argv); max_jit_attr_args(x,argc,argv); } else { error("jit.change: could not allocate object"); freeobject(x); } } return (x); }
void *max_jit_gl_videoplane_new(t_symbol *s, long argc, t_atom *argv) { t_max_jit_gl_videoplane *x; void *jit_ob; long attrstart; t_symbol *dest_name_sym = _jit_sym_nothing; if (x = (t_max_jit_gl_videoplane *)max_jit_obex_new(max_jit_gl_videoplane_class, gensym("jit_gl_videoplane"))) { //get normal args attrstart = max_jit_attr_args_offset(argc,argv); if (attrstart&&argv) { jit_atom_arg_getsym(&dest_name_sym, 0, attrstart, argv); } if (jit_ob = jit_object_new(gensym("jit_gl_videoplane"), dest_name_sym)) { max_jit_obex_jitob_set(x, jit_ob); max_jit_obex_dumpout_set(x, outlet_new(x,NULL)); max_jit_attr_args(x, argc, argv); // attach the jit object's ob3d to a new outlet for sending drawing messages. max_jit_ob3d_attach(x, jit_ob, outlet_new(x, "jit_matrix")); } else { jit_object_error((t_object *)x,"jit.gl.videoplane: could not allocate object"); freeobject((t_object *)x); x = NULL; } } return (x); }