Forums > Jitter

[sharing is fun] uyvy fixed pipe blending was: automatic 0" and delays with send and receive to

September 23, 2006 | 7:08 pm

Here’s a simple patch that demonstrates how to alpha blend two
videoplanes together using uyvy textures and a lumalpha texture. This
is *much* more efficient that using jit.unpack/jit.pack to splice in
an alpha channel into a video matrix.

wes

#P window setfont "Sans Serif" 14.;
#P window linecount 1;
#P comment 410 56 105 196622 Alpha Channel;
#P window setfont "Sans Serif" 9.;
#P comment 137 357 72 196617 Overlay Image;
#P newex 382 217 48 196617 loadbang;
#P newex 107 217 48 196617 loadbang;
#P newex 320 54 48 196617 loadbang;
#P newex 295 311 243 196617 jit.gl.texture blend @colormode uyvy @name mov2;
#P newex 351 357 47 196617 r draw2;
#P newex 295 383 249 196617 jit.gl.videoplane blend @blend_enable 1
@automatic 0;
#P newex 20 334 76 196617 append blender;
#P newex 20 311 243 196617 jit.gl.texture blend @colormode uyvy @name mov1;
#P newex 320 160 264 196617 jit.gl.texture blend @colormode lumalpha
@name blender;
#P button 320 75 15 0;
#P newex 320 138 129 196617 jit.matrix 2 char 320 240;
#P newex 320 116 127 196617 jit.expr @expr "norm[0]";
#P newex 320 94 142 196617 jit.matrix 1 float32 320 240;
#P newex 76 357 47 196617 r draw1;
#N vpatcher 20 74 179 252;
#P window setfont "Sans Serif" 9.;
#P window linecount 0;
#P newex 48 85 30 196617 t b b;
#P window linecount 1;
#P newex 68 107 47 196617 s draw2;
#P newex 48 129 47 196617 s draw1;
#P newex 24 54 58 196617 t b b erase;
#P inlet 24 34 15 0;
#P outlet 24 85 15 0;
#P connect 1 0 2 0;
#P connect 2 0 0 0;
#P fasten 2 2 0 0 77 78 29 78;
#P connect 2 1 5 0;
#P connect 5 0 3 0;
#P connect 5 1 4 0;
#P pop;
#P newobj 20 162 41 196617 p draw;
#P newex 20 383 249 196617 jit.gl.videoplane blend @blend_enable 1 @automatic 0;
#P flonum 491 240 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 491 261 42 196617 rate $1;
#P message 382 240 83 196617 read dishes.mov;
#P message 428 262 27 196617 stop;
#P message 394 262 31 196617 start;
#P flonum 337 241 35 9 0.5 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 295 241 15 0;
#P newex 295 261 52 196617 metro 30;
#P message 458 262 31 196617 clear;
#P newex 295 288 188 196617 jit.qt.movie 320 240 @colormode uyvy;
#P flonum 221 241 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 221 262 42 196617 rate $1;
#P message 107 240 81 196617 read wheel.mov;
#P message 155 262 27 196617 stop;
#P message 121 262 31 196617 start;
#P flonum 62 241 35 9 0.5 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 20 241 15 0;
#P newex 20 261 52 196617 metro 30;
#P message 185 262 31 196617 clear;
#P newex 20 288 188 196617 jit.qt.movie 320 240 @colormode uyvy;
#P toggle 122 103 15 0;
#P message 122 123 68 196617 fullscreen $1;
#N vpatcher 30 89 166 253;
#P window setfont "Sans Serif" 9.;
#P newex 50 71 35 196617 sel 27;
#P newex 50 50 40 196617 key;
#P outlet 50 93 15 0;
#P connect 1 0 2 0;
#P connect 2 0 0 0;
#P pop;
#P newobj 122 83 33 196617 p Esc;
#P newex 122 141 84 196617 jit.window blend;
#P message 83 141 34 196617 reset;
#P newex 83 162 191 196617 jit.gl.handle blend @inherit_transform 1;
#P toggle 20 95 42 0;
#P newex 20 141 57 196617 qmetro 30;
#P newex 20 187 91 196617 jit.gl.render blend;
#P comment 408 357 62 196617 Base Image;
#P window setfont "Sans Serif" 20.;
#P comment 17 23 276 196628 uyvy Blending with lumalpha;
#P window setfont "Sans Serif" 9.;
#P comment 28 49 122 196617 Wesley Smith , 9-23-06;
#P comment 101 336 138 196617 < = compositing alpha texture;
#B frgb 44 72 220;
#P connect 32 0 31 0;
#P fasten 48 0 26 0 387 237 300 237;
#P connect 48 0 30 0;
#P connect 27 0 25 1;
#P connect 38 0 40 0;
#P connect 37 0 38 0;
#P connect 36 0 37 0;
#P connect 39 0 36 0;
#P connect 46 0 39 0;
#P fasten 44 0 43 0 356 379 300 379;
#P connect 45 0 43 0;
#P connect 23 0 45 0;
#P fasten 31 0 23 0 496 283 300 283;
#P fasten 30 0 23 0 387 283 300 283;
#P fasten 29 0 23 0 433 283 300 283;
#P fasten 28 0 23 0 399 283 300 283;
#P fasten 24 0 23 0 463 283 300 283;
#P fasten 25 0 23 0 300 286 300 286;
#P connect 26 0 25 0;
#P connect 22 0 21 0;
#P connect 11 0 9 0;
#P connect 12 0 11 0;
#P connect 10 0 12 0;
#P fasten 47 0 16 0 112 237 25 237;
#P connect 47 0 20 0;
#P connect 8 0 7 0;
#P connect 17 0 15 1;
#P fasten 35 0 33 0 81 379 25 379;
#P connect 42 0 33 0;
#P connect 41 0 42 0;
#P connect 13 0 41 0;
#P fasten 15 0 13 0 25 286 25 286;
#P fasten 14 0 13 0 190 283 25 283;
#P fasten 18 0 13 0 126 283 25 283;
#P fasten 19 0 13 0 160 283 25 283;
#P fasten 20 0 13 0 112 283 25 283;
#P fasten 21 0 13 0 226 283 25 283;
#P connect 16 0 15 0;
#P fasten 7 0 4 0 88 183 25 183;
#P connect 34 0 4 0;
#P connect 5 0 34 0;
#P connect 6 0 5 0;
#P window clipboard copycount 51;


Viewing 1 post (of 1 total)