[PD-dev] opencv externals data type conversion

Nose Hair nosehair911 at bellsouth.net
Wed May 30 02:50:37 CEST 2007


I think I figured it out.  It looks like I have to use t_symbol *sym
instead of t_symbol sym and the outlet has to be x->outlet_symbol(x- 
 >x_outlet0, &*sym).  That seemed to work.  The weird problem I am  
having now it I get an error with the return(void *)x; I get error:
Error: return-statement with a value, in function returning 'void'.
Now I see return(void *)x; on almost all the external codes so I  
don't get it.  I am also getting an error on the void your_class_setup 
(void) { part too.
Error: a function-definition is not allowed here before '{' token.
I am confused. Any help would be apreciated.
Thanks,
Alain

On May 29, 2007, at 4:15 PM, <nosehair911 at bellsouth.net> wrote:

> I am trying to write a set of externals based on the opencv  
> library.  My main interest is in the motion
> tracking aspect of opencv.  I am new to programing and I am having  
> a tough time converting the opencv
> IplImage data type to the Pd symbol data type in order to send it  
> out of outlets and in to inlets. Martin
> suggested I try something like this:
> char symstr[10];
> t_symbol sym;
> sprintf(symstr, "%p", frame);
> sym = gensym(symstr);
> and then send sym through the outlet and convert it back at the  
> receiving end by extracting the sting
> from the s_name field and passing it to atol().  But I get this  
> error when I use sym = gensym(symstr);
> no match for 'operator=' in 'sym = gensym(((char*)(& symstr)))'.   
> Does anyone know how to get around
> this?
> Thanks,
> Alain
>
>
> _______________________________________________
> PD-dev mailing list
> PD-dev at iem.at
> http://lists.puredata.info/listinfo/pd-dev





More information about the Pd-dev mailing list