Martin, Thanks for your insight. I will look into that. It seems like sprintf/atoi is what I need to be looking at. Alain
From: martin.peach@sympatico.ca Date: 2007/05/29 Tue AM 11:51:36 EDT To: pd-list@iem.at CC: Tim Boykett tim@timesup.org, IOhannes m zmoelnig zmoelnig@iem.at,
Subject: Re: Re: [PD] opencv motion tracker external HELP!
I dont think I quite understood. I tried:
#define FRAMEOUT frame
IplImage *frame = 0;
x->x_outlet = outlet_new(&x->x_obj, &s_anything); outlet_anything(x->x_outlet, FRAMEOUT);
with the same results. Maybe someone can dumb it down for me?
You can only work with atoms in pd's message system, and each atom usually contains a bang, a
float or a symbol. You could convert the pointer to a float but it probably won't work because the pointer is a large integer that won't be accurately represented as a float. You could convert the pointer to a symbol using something like:
char symstr[10]; t_symbol sym; sprintf(symstr, "%p", frame); sym = gensym(symstr); ...then send sym through the outlet and convert it back to a pointer at the receiving end by extracting
the string from the s_name field of the symbol and passing it to atol().
Martin