예제 #1
0
void *max_ta_jit_kinect2_new(t_symbol *s, long argc, t_atom *argv)
{
    t_max_ta_jit_kinect2	*x;
    void			*o;
    
    x = (t_max_ta_jit_kinect2 *)max_jit_object_alloc(max_ta_jit_kinect2_class, gensym("ta_jit_kinect2"));
    if (x) {
        o = jit_object_new(gensym("ta_jit_kinect2"));
        if (o) {
            max_jit_mop_setup_simple(x, o, argc, argv);
            max_jit_attr_args(x, argc, argv);
            t_atom_long depthdim[2] = {DEPTH_WIDTH, DEPTH_HEIGHT};
            t_atom_long rgbdim[2] = {RGB_WIDTH, RGB_HEIGHT};
            
            //TA: set depth matrix initial attributes
            void *output = max_jit_mop_getoutput(x, 1);
            jit_attr_setsym(output, _jit_sym_type, _jit_sym_float32);
            jit_attr_setlong_array(output, _jit_sym_dim, 2, depthdim);
            jit_attr_setlong(output, _jit_sym_planecount, 1);
            
            //TA: set rgb matrix initial attributes
            output = max_jit_mop_getoutput(x, 2);
            jit_attr_setsym(output, _jit_sym_type, _jit_sym_char);
            jit_attr_setlong_array(output, _jit_sym_dim, 2, rgbdim);
            jit_attr_setlong(output, _jit_sym_planecount, 4);

        }
        else {
            jit_object_error((t_object *)x, "ta.jit.kinect2: could not allocate object");
            object_free((t_object *)x);
            x = NULL;
        }
    }
    return (x);
}
예제 #2
0
void *max_hoa_gl_scope_new(t_symbol *s, long argc, t_atom *argv)
{
	t_max_hoa_gl_scope* x = NULL;
	t_jit_object *jit_ob = NULL;
	long attrstart;
	t_symbol *dest_name_sym = _jit_sym_nothing;
	t_atom_long order = 1;

	if ((x = (t_max_hoa_gl_scope *)max_jit_object_alloc(max_hoa_gl_scope_class, gensym("hoa_gl_scope"))))
	{
		// get first normal arg, the destination name
		attrstart = max_jit_attr_args_offset(argc,argv);
		
		if (argc >= 1 && argv)
		{
			if (atom_gettype(argv) == A_LONG)
			{
				order = jit_atom_getlong(argv);
			}
			if (argc >= 2)
			{
				jit_atom_arg_getsym(&dest_name_sym, 1, attrstart, argv);
			}
		}
		
		jit_ob = (t_jit_object*)jit_object_new(gensym("hoa_gl_scope"), dest_name_sym, x);

		// instantiate Jitter object with dest_name arg
		//if ((jit_ob = (t_jit_object*)jit_object_new(gensym("hoa_gl_scope"), dest_name_sym)))
		if (jit_ob)
		{
			// set internal jitter object instance
			max_jit_obex_jitob_set(x, jit_ob);
			
			x->f_scope = new Hoa3D::Scope(order, 100, 199);
			dsp_setup((t_pxobject *)x, x->f_scope->getNumberOfHarmonics());
			
			x->f_signals = new double[x->f_scope->getNumberOfHarmonics() * SYS_MAXBLKSIZE];
			x->f_index = 0;
			
			max_jit_attr_args(x, argc, argv);
		} 
		else 
		{
			error("hoa.gl.scope3D~: could not allocate object");
			freeobject((t_object *)x);
			x = NULL;
		}
	}
	return (x);
}
예제 #3
0
void *max_jit_gl_spout_receiver_new(t_symbol *s, long argc, t_atom *argv)
{
	UNREFERENCED_PARAMETER(s);

	t_max_jit_gl_spout_receiver *x;
	void *jit_ob;
	long attrstart;
	t_symbol *dest_name_sym = _jit_sym_nothing;

	if ((x = (t_max_jit_gl_spout_receiver *)max_jit_object_alloc(max_jit_gl_spout_receiver_class, gensym("jit_gl_spout_receiver"))))
	{
		// get first normal arg, the destination name
		attrstart = max_jit_attr_args_offset((short)argc,argv);
		if (attrstart&&argv) {
			jit_atom_arg_getsym(&dest_name_sym, 0, attrstart, argv);

		}
		
		// instantiate Jitter object with dest_name arg
		if ((jit_ob = jit_object_new(gensym("jit_gl_spout_receiver"), dest_name_sym))) {

			// set internal jitter object instance
			max_jit_obex_jitob_set(x, jit_ob);
			
			// process attribute arguments 
			max_jit_attr_args(x, (short)argc, argv);		

			// add a general purpose outlet (rightmost)
			x->dumpout = outlet_new(x,NULL);
			max_jit_obex_dumpout_set(x, x->dumpout);

			// Texture outlet
			x->texout = outlet_new(x, "jit_gl_texture");

			// For first sender detection
			x->b_Started = false;

		} 
		else {
			error("jit_gl_spout_receiver : could not allocate object");
			freeobject((t_object *)x);
			x = NULL;
		}
	}
	return (x);
}
예제 #4
0
void *max_jit_gl_spoutsender_new(t_symbol *s, long argc, t_atom *argv)
{
	// Sender
	t_max_jit_gl_spoutsender *x;
	void *jit_ob;
	long attrstart;
	t_symbol *dest_name_sym = _jit_sym_nothing;

	if ((x = (t_max_jit_gl_spoutsender *)max_jit_object_alloc(max_jit_gl_spoutsender_class, gensym("jit_gl_spoutsender"))))
	{
		// get first normal arg, the destination name
		attrstart = max_jit_attr_args_offset((SHORT)argc, argv);
		if (attrstart&&argv) 
		{
			jit_atom_arg_getsym(&dest_name_sym, 0, attrstart, argv);
		}
		
		// instantiate Jitter object with dest_name arg
		if ((jit_ob = jit_object_new(gensym("jit_gl_spoutsender"), dest_name_sym)))
		{
			// set internal jitter object instance
			max_jit_obex_jitob_set(x, jit_ob);
			
			// add a general purpose outlet (rightmost)
			max_jit_obex_dumpout_set(x, outlet_new(x,NULL));
			
			// process attribute arguments 
			max_jit_attr_args(x, (SHORT)argc, argv);
			
			// create new proxy inlet.
			max_jit_obex_proxy_new(x, 0);
		} 
		else {
			error("jit.gl.spout_sender: could not allocate object");
			freeobject((t_object *)x);
			x = NULL;
		}
	}


	return (x);
}
예제 #5
0
void *max_jit_kinect2_new(t_symbol *s, long argc, t_atom *argv)
{
	t_max_jit_kinect2	*x;
	void                *o;

	x = (t_max_jit_kinect2 *)max_jit_object_alloc(max_jit_kinect2_class, gensym("jit_kinect2"));
	if (x) {
		o = jit_object_new(gensym("jit_kinect2"));
		if (o) {
			max_jit_mop_setup_simple(x, o, argc, argv);
			max_jit_attr_args(x, argc, argv);
		}
		else {
			jit_object_error((t_object *)x, "jit.kinect2: could not allocate object");
			object_free((t_object *)x);
			x = NULL;
		}
	}
	return (x);
}
예제 #6
0
void *max_jit_leap_new(t_symbol *s, long argc, t_atom *argv)
{
	t_max_jit_leap *x;
	void *o;

	if ((x = (t_max_jit_leap *)max_jit_object_alloc(max_jit_leap_class,gensym("jit_leap"))))
	{
		if ((o = jit_object_new(gensym("jit_leap"))))
		{
			max_jit_mop_setup_simple(x,o,argc,argv);			
			max_jit_attr_args(x,argc,argv);
		}
		else
		{
			jit_object_error((t_object *)x, (char*)"jit.noise: could not allocate object");
			freeobject((t_object *) x);
			x = NULL;
		}
	}
	return (x);
}
void *o_jit_pcl_supervoxel_new(t_symbol *s, long argc, t_atom *argv)
{
    t_o_jit_pcl_supervoxel	*x;
    
    x = (t_o_jit_pcl_supervoxel *)max_jit_object_alloc((t_class *)o_jit_pcl_supervoxel_class, NULL);
    if (x)
    {
        x->disable_transform = 1;
        x->voxel_resolution = 0.008f;
        x->seed_resolution = 0.1f;
        x->color_importance = 0.2f;
        x->spatial_importance = 0.4f;
        x->normal_importance = 1.0f;

        x->outlet = outlet_new(x, "FullPacket");
        
        //no normal args, no matrices
        max_jit_attr_args(x,argc,argv); //handle attribute args
        
    }
    return (x);
}
예제 #8
0
void *max_jit_gl_cube_new(t_symbol *s, long argc, t_atom *argv)
{
	t_max_jit_gl_cube *x;
	void *jit_ob;
	long attrstart;
	t_symbol *dest_name_sym = _jit_sym_nothing;

	if ((x = (t_max_jit_gl_cube *)max_jit_object_alloc(max_jit_gl_cube_class, gensym("jit_gl_cube"))))
	{
		//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_cube"), dest_name_sym))) 
		{
			max_jit_obex_jitob_set(x, jit_ob);
			max_jit_obex_dumpout_set(x, outlet_new(x,NULL));
			
			// get attribute args. 
			// typical but not strictly necessary because this sample object has no attributes.
			max_jit_attr_args(x, argc, argv);		
			
			// attach the jit object's ob3d to a new outlet for sending drawing messages.	
			// this outlet is used in matrixoutput mode.
			max_jit_ob3d_attach(x, jit_ob, outlet_new(x, "jit_matrix"));
		} 
		else 
		{
			error("jit.gl.cube: could not allocate object");
			freeobject((t_object *)x);
			x = NULL;
		}
	}
	return (x);
}