[GEM-dev] Output two images from pix_ object

IOhannes m zmoelnig zmoelnig at iem.at
Wed Nov 16 09:25:31 CET 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2011-11-15 23:51, Matthias Kronlachner wrote:
> hi!
> 
> you can find an example how to do two outputs from pix_ object in my
> pix_freenect external.
> http://www.matthiaskronlachner.com/wp-content/uploads/2011/11/pix_freenect_0.03.zip
> 
> 
> i made an additional inlet and outlet for gemstate plus the methods that
> get called, 2 pixBlock and an additional GemState.
> 
> so the pieces of code that are interesting:
> constructor:
>   m_depthinlet  = inlet_new(this->x_obj, &this->x_obj->ob_pd,
> gensym("gem_state"), gensym("depth_state"));
>   m_depthoutlet = outlet_new(this->x_obj, 0);
> 
> setupCallback:
>   class_addmethod(classPtr, (t_method)(&pix_freenect::renderDepthCallback),
>                   gensym("depth_state"), A_GIMME, A_NULL);
> 
> -> renderDepthCallback() calls the rendering method for the second
> output -> renderDepth(int argc, t_atom*argv);

most of the code you show deals with how to make a 2nd *inlet* for
gemstates, which is exemplified in the GemPixDualObject base clasee.

the complicated thing about having a 2nd *outlet* is of course to
generate a valid GemCache (afair just creating a new one should be
sufficient for most cases; you might want to copy things like the
"dirty" flags over to the "main" m_cache after processing of the 2nd
chain is done) and a valid GemState.
and then generate a Pd-message containing those two.

there should be a GemOutlet class derived from RTE::Outlet, that handles
most of those things for you. (at least the part with generating a valid
Pd message from a given GemCache&GemState)

fgamsdr
IOhannes
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7Dc3YACgkQkX2Xpv6ydvTZMwCfX5JoqwYP6s3HG9zpnLWEs1cR
8X0AoO8OFwHgv/2Qu9NOLJcRHah530Ul
=Lexz
-----END PGP SIGNATURE-----

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3636 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.puredata.info/pipermail/gem-dev/attachments/20111116/a797d167/attachment.bin>


More information about the GEM-dev mailing list