t_jit_openlase_trace *jit_openlase_trace_new(void)
{
	t_jit_openlase_trace *x;
		
	if (x=(t_jit_openlase_trace *)jit_object_alloc(_jit_openlase_trace_class)) {
		x->planecount = 0;
				
		x->params.rate = 12000;
		x->params.on_speed = 2.0/100.0;
		x->params.off_speed = 2.0/20.0;
		x->params.snap = 1/120.0;
		x->params.render_flags = RENDER_GRAYSCALE;
		x->params.min_length = 20;
		x->params.start_wait = 15;
		x->params.end_wait = 3;
		x->params.start_dwell = 10;
		x->params.end_dwell = 10;
		x->params.corner_dwell = 12;
		x->overscan = 0.0;
		x->aspect = 0.0;
		x->decimate = 1;
		x->snap_pix = 3;
		
		systhread_mutex_new(&x->mutex,0);
	} else {
		x = NULL;
	}
	return x;
}
Ejemplo n.º 2
0
t_jit_freenect_grab *jit_freenect_grab_new(void)
{
	t_jit_freenect_grab *x;
	
	if ((x=(t_jit_freenect_grab *)jit_object_alloc(_jit_freenect_grab_class)))
	{
		x->device = NULL;
		x->timestamp = 0;
		x->unique = 0;
		x->aligndepth = 0;
		x->mode = 3;
		x->has_frames = 0;
		x->ndevices = 0;
		x->lut.f_ptr = NULL;
		x->lut_type = NULL;
		x->tilt = 0;
		x->state = NULL;
		x->clear_depth = 0;
		x->type = NULL;
		x->threshold = 2.f;
		x->rgb = NULL;
        
		//x->x_systhread = NULL;
		x->backbuffer_mutex = NULL;
		x->x_sleeptime = 10;
		systhread_mutex_new(&x->backbuffer_mutex, 0);
		x->got_rgb=0;
		x->got_depth=0;
		x->depth_mid=NULL;
		x->depth_front=NULL;
		x->rgb_front=NULL;
		x->rgb_back=NULL;
		x->rgb_mid=NULL;
		x->depth_back=NULL;
		
		
		x->depth_back = (uint16_t*)malloc(DEPTH_WIDTH*DEPTH_HEIGHT*DEPTH_BPP);
		x->depth_mid = (uint16_t*)malloc(DEPTH_WIDTH*DEPTH_HEIGHT*DEPTH_BPP);
		x->depth_front = (uint16_t*)malloc(DEPTH_WIDTH*DEPTH_HEIGHT*DEPTH_BPP);
		x->rgb_back = (uint8_t*)malloc(RGB_WIDTH*RGB_HEIGHT*RGB_BPP);
		x->rgb_mid = (uint8_t*)malloc(RGB_WIDTH*RGB_HEIGHT*RGB_BPP);
		x->rgb_front = (uint8_t*)malloc(RGB_WIDTH*RGB_HEIGHT*RGB_BPP);
		
		x->is_open=FALSE;
		x->id=++global_id;
		
		//jit_fnect_restart_thread(x);
        //pthread_mutex_init(&x->cb_mutex, NULL);
		jit_atom_setsym(&x->format, s_rgb);
		postNesa("new freenect instance added.");//TODO: remove	
	} else {
		x = NULL;
	}
	return x;
}
Ejemplo n.º 3
0
t_jit_3m *jit_3m_new(void)
{
	t_jit_3m *x;
		
	if (x=(t_jit_3m *)jit_object_alloc(_jit_3m_class)) {
		x->planecount = 0;
		systhread_mutex_new(&x->mutex,0);
	} else {
		x = NULL;
	}	
	return x;
}
Ejemplo n.º 4
0
void *simpleparallel_new(t_symbol *s, long ac, t_atom *av)
{
	t_simpleparallel *x;

	x = (t_simpleparallel *)object_alloc(simpleparallel_class);
	x->x_outlet = outlet_new(x,NULL);
	x->x_sysparallel_task = NULL;
	systhread_mutex_new(&x->x_mutex,0);
	x->x_foo = 0;
	x->x_iterations = 5000000;
	attr_args_process(x, ac, av);

	return(x);
}
Ejemplo n.º 5
0
void *simplethread_new(void) 
{
	t_simplethread *x;

	x = (t_simplethread *)object_alloc(simplethread_class);
	x->x_outlet = outlet_new(x,NULL);
	x->x_qelem = qelem_new(x,(method)simplethread_qfn);
	x->x_systhread = NULL;
	systhread_mutex_new(&x->x_mutex,0);
	x->x_foo = 0;
	x->x_sleeptime = 1000;
	
	return(x);
}
Ejemplo n.º 6
0
void *dmxMax_new(t_symbol *s, long argc, t_atom *argv)
{
    t_dmxMax	*x;
    
    x = (t_dmxMax*)object_alloc(s_dmxMax_class);
    if (x) {
        systhread_mutex_new(&x->c_mutex, 0);
        x->c_outlet = outlet_new(x, NULL);
        //        x->c_vector = new numberVector;
        //        x->c_vector->reserve(10);
        //        dmxMax_list(x, gensym("list"), argc, argv);
    }
    return(x);
}
Ejemplo n.º 7
0
void *minimum_new(t_symbol *s, long ac, t_atom *av)
{
	t_minimum *x;

	x = object_alloc(minimum_class);
	systhread_mutex_new(&x->m_mutex, 0);
	x->m_count = 0;
	x->m_args = NULL;
	minimum_resize(x,2);
	x->m_out2 = intout(x);
	if (ac) {
		x->m_args[1] = *av;
		if (atom_gettype(av)==A_LONG) {
			x->m_args[0].a_type = x->m_outtype = A_LONG;
			x->m_out = intout(x);
			x->m_args[0].a_w.w_long = 0;
			intin(x,1);
		} else if (atom_gettype(av)==A_FLOAT) {
			x->m_args[0].a_type = x->m_outtype = A_FLOAT;
			x->m_out = floatout(x);
			x->m_args[0].a_w.w_float = 0;
			floatin(x,1);
		} else {
			x->m_outtype = A_LONG;
			intin(x,1);
			x->m_out = intout(x);
			atom_setlong(x->m_args+1,0L);
			atom_setlong(x->m_args,0L);
		}
	} else {
		x->m_outtype = A_LONG;
		intin(x,1);
		x->m_out = intout(x);
		atom_setlong(x->m_args+1,0L);
		atom_setlong(x->m_args,0L);
	}
	return x;
}