Forums > Jitter

Convert matrix to float


d_s
October 19, 2006 | 12:47 am

Hi There,

I have a matrix from a jit.histogram object and want to multiply all the values in that matrix by a float, say 0.65 When I use jit.op to do this I get integer math. I know this is a dumb question… just need to find the type converter object and for some reason I’m not seeing it.

thanks,
d_s

patch:

#P window setfont "Sans Serif" 9.;
#P flonum 826 465 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 779 488 57 9109513 jit.op @op *;
#P newex 757 17 58 9109513 r mainmetro;
#P message 994 48 146 9109513 importmovie map_test_vs01.psd;
#P button 954 54 15 0;
#P newex 954 80 130 9109513 jit.matrix map 1 char 320 240;
#P user jit.cellblock 779 534 1245 574 3 9 256 1 32 17 0 1 1 0 0 0 1 1 1 0 0 0 255 255 255 0 0 0 0 0 0 191 191 191 0 0 0 215 215 240 1 1 1 0 4 0 0 0;
#P comment 931 369 113 9109513 Presence in each zone.;
#P user jit.cellblock 827 403 1293 443 3 9 256 1 32 17 0 1 1 0 0 0 1 1 1 0 0 0 255 255 255 0 0 0 0 0 0 191 191 191 0 0 0 215 215 240 1 1 1 0 4 0 0 0;
#P newex 779 366 145 9109513 jit.histogram 1 long @autoclear 1;
#P user jit.pwindow 776 197 162 122 1 0 0 0 1 0;
#P newex 777 152 57 9109513 jit.op @op *;
#P message 793 47 149 9109513 importmovie map_test_allwhite.tif;
#P button 753 53 15 0;
#P newex 753 79 130 9109513 jit.matrix map 1 char 320 240;
#P comment 818 22 130 9109513 get max pixel count per zone;
#P connect 13 0 2 0;
#P fasten 3 0 1 0 798 72 758 72;
#P connect 2 0 1 0;
#P connect 1 0 4 0;
#P connect 4 0 5 0;
#P connect 4 0 6 0;
#P connect 6 0 14 0;
#P connect 14 0 9 0;
#P connect 10 0 4 1;
#P connect 15 0 14 1;
#P fasten 6 0 7 0 784 394 832 394;
#P fasten 12 0 10 0 999 73 959 73;
#P connect 11 0 10 0;
#P window clipboard copycount 16;



d_s
October 19, 2006 | 12:54 am

Nevermind… figured it out. Pipe the histogram output into a matrix of type float32.


Viewing 2 posts - 1 through 2 (of 2 total)