[PD] From pd file color to cnv message

Roman Haefeli reduzierer at yahoo.de
Sun Mar 14 01:05:09 CET 2010


Since 24bit integer numbers cannot be fully represented with the number
format used in .pd files (and in any other textual representation in
pd), color values for the iemguis are saved as 18bit integer numbers,
where each channel occupies 6 bit. So the bit mask for those values is
the following:

((rrrrrrggggggbbbbbb)*-1)-1

whereas the 'color' message to the iemgui objects expects a 8
bit/channel number, which has this bitmask:

((rrrrrrrrggggggggbbbbbbbb)*-1)-1

So if you want to read the color values from a .pd file and send them to
the iemguis, you need to bitshift the channel parts from the 18bit
scheme to make it fit into the 24 bit scheme.

Roman



On Fri, 2010-03-12 at 19:50 -0800, Jonathan Wilkes wrote:
> Hello,
>      Can anyone tell me how to figure out what value to send a [cnv] object 
> to get it to display the colors shown in this patch?  If I try to take one 
> of those big negative values from the pd file I get a totally different 
> color.
> 
> Thanks,
> Jonathan
> 
> 
>       
> 
> 
> _______________________________________________
> Pd-list at iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list







More information about the Pd-list mailing list