#N canvas 235 64 871 645 10;
#X declare -lib Gem;
#X text 671 9 GEM object;
#X obj 8 46 cnv 15 540 100 empty empty empty 20 12 0 14 #e0e0e0 #404040 0;
#X obj 559 47 cnv 15 280 500 empty empty empty 20 12 0 14 #dce4fc #404040 0;
#X text 71 21 Class: pix object (pix source);
#X text 561 33 Example:;
#X text 50 2 Synopsis: [pix_video];
#X text 29 47 Description: open a camera and get input;
#X obj 9 182 cnv 15 540 365 empty empty empty 20 12 0 14 #e0e0e0 #404040 0;
#X obj 9 149 cnv 15 540 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0;
#X text 18 148 Arguments:;
#X text 17 486 Outlet 1: gemlist;
#X text 17 198 Inlet 1: gemlist;
#X text 16 308 Inlet 1: colorspace "RGBA|YUV|Grey": decodes the current film into the specified colorspace \, if supported by the backend., f 62;
#X text 64 159 none;
#X text 33 184 Inlet:;
#X text 33 472 Outlet:;
#X obj 717 460 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0;
#X obj 563 86 cnv 15 230 280 empty empty empty 20 12 0 14 #14e814 #404040 0;
#X text 17 216 Inlet 1: device <spec>: the number or file path to the input device;
#X text 16 339 Inlet 1: dimen <number> <number>: set various dimensions for the image (does not work on all capture devices);
#X text 15 371 Inlet 1: enumerate: list all devices to the console;
#X text 17 245 Inlet 1: backend <number>: switch between different backends \, e.g. v4l \, ieee1394 \, etc.;
#X text 16 276 Inlet 1: backend <symbol>: switch between different backends \, e.g. v4l \, v4l2 \, dv...;
#X text 13 66 [pix_video] opens a wide array of cameras \, USB to FireWire to capture cards \, as long as the camera is supported by your operating system.;
#X obj 567 58 gemhead;
#X msg 596 124 dimen 64 64;
#X msg 586 99 dimen 256 128;
#X msg 635 261 enumerate;
#X msg 641 283 dialog;
#X msg 604 153 colorspace RGBA;
#X msg 609 211 device 0;
#X msg 642 312 backend dv;
#N canvas 516 113 572 565 properties 0;
#X msg 41 203 enumProps;
#X obj 31 21 cnv 15 400 80 empty empty readProperties 20 12 0 14 #e0e0e0 #404040 0;
#X obj 39 47 hradio 15 1 0 1 \$0-propreadId \$0-propreadId empty 0 -8 0 10 #fcfcfc #000000 #000000 0;
#X obj 40 70 cnv 15 260 20 empty \$0-propreadName <none> 10 9 0 14 #c4c4fc #404040 0;
#N canvas 186 49 450 537 PropertyLogic 0;
#N canvas 586 84 774 460 id2property 0;
#X obj 353 106 r \$0-info;
#X obj 353 130 route proplist;
#X obj 353 152 route read numread;
#X obj 405 176 t b f;
#X obj 353 174 list;
#X obj 353 219 list prepend;
#X msg 353 196 \$1;
#X obj 353 239 t l l;
#X obj 95 197 list prepend;
#X obj 525 176 t b f;
#X obj 473 174 list;
#X obj 473 219 list prepend;
#X msg 473 196 \$1;
#X obj 473 239 t l l;
#X obj 473 152 route write numwrite;
#X obj 95 69 inlet readID;
#X obj 225 70 inlet writeID;
#X obj 180 378 outlet readName;
#X obj 310 356 outlet writeName;
#X obj 95 176 t b f;
#X obj 95 219 list split;
#X obj 180 316 symbol;
#X msg 180 291 symbol \$1;
#X obj 225 197 list prepend;
#X obj 225 176 t b f;
#X obj 225 219 list split;
#X obj 310 316 symbol;
#X msg 310 291 symbol \$1;
#X obj 95 91 route float;
#X obj 225 92 route float;
#X msg 432 333 number \$1;
#X msg 552 333 number \$1;
#X obj 432 353 s \$0-propreadId;
#X obj 552 353 s \$0-propwriteId;
#X obj 602 254 t f f;
#X msg 602 232 0;
#X obj 602 211 loadbang;
#X obj 123 258 route bang;
#X obj 253 258 route bang;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 2 0 4 0;
#X connect 2 1 3 0;
#X connect 2 2 14 0;
#X connect 3 0 5 1;
#X connect 3 1 30 0;
#X connect 4 0 6 0;
#X connect 5 0 7 0;
#X connect 6 0 5 0;
#X connect 7 0 8 1;
#X connect 7 1 5 1;
#X connect 8 0 20 0;
#X connect 9 0 11 1;
#X connect 9 1 31 0;
#X connect 10 0 12 0;
#X connect 11 0 13 0;
#X connect 12 0 11 0;
#X connect 13 0 23 1;
#X connect 13 1 11 1;
#X connect 14 0 10 0;
#X connect 14 1 9 0;
#X connect 15 0 28 0;
#X connect 16 0 29 0;
#X connect 19 0 8 0;
#X connect 19 1 20 1;
#X connect 20 1 37 0;
#X connect 21 0 17 0;
#X connect 22 0 21 0;
#X connect 23 0 25 0;
#X connect 24 0 23 0;
#X connect 24 1 25 1;
#X connect 25 1 38 0;
#X connect 26 0 18 0;
#X connect 27 0 26 0;
#X connect 28 0 19 0;
#X connect 29 0 24 0;
#X connect 30 0 32 0;
#X connect 31 0 33 0;
#X connect 34 0 30 0;
#X connect 34 1 31 0;
#X connect 35 0 34 0;
#X connect 36 0 35 0;
#X connect 37 1 22 0;
#X connect 38 1 27 0;
#X restore 188 192 pd id2property;
#X obj 320 407 list prepend set;
#X obj 320 429 list trim;
#X obj 320 451 t b a;
#N canvas 438 137 450 300 getProp 0;
#X obj 44 177 s \$0-propreadName;
#X msg 44 156 label \$1;
#X msg 165 156 get \$1;
#X obj 44 81 inlet;
#X obj 165 178 outlet;
#X obj 290 57 r \$0-info;
#X obj 290 79 route prop;
#N canvas 3 45 450 300 sroute 0;
#X obj 73 12 inlet;
#X obj 312 9 inlet;
#X obj 73 113 outlet;
#X obj 73 34 list split 1;
#X obj 73 56 select s;
#X obj 73 78 list prepend;
#X connect 0 0 3 0;
#X connect 1 0 4 1;
#X connect 3 0 4 0;
#X connect 3 1 5 1;
#X connect 4 0 5 0;
#X connect 5 0 2 0;
#X restore 290 113 pd sroute;
#X obj 44 123 t s s s;
#X msg 290 226 label \$1;
#X obj 290 247 s \$0-propreadValue;
#X obj 290 135 route float;
#X obj 290 157 makefilename %g;
#X obj 106 29 loadbang;
#X obj 106 51 t b b;
#X msg 106 73 symbol <none>;
#X msg 196 74 symbol --;
#X obj 353 181 symbol;
#X connect 1 0 0 0;
#X connect 2 0 4 0;
#X connect 3 0 8 0;
#X connect 5 0 6 0;
#X connect 6 0 7 0;
#X connect 7 0 11 0;
#X connect 8 0 1 0;
#X connect 8 1 2 0;
#X connect 8 2 7 1;
#X connect 9 0 10 0;
#X connect 11 0 12 0;
#X connect 11 1 17 0;
#X connect 12 0 9 0;
#X connect 13 0 14 0;
#X connect 14 0 15 0;
#X connect 14 1 16 0;
#X connect 15 0 1 0;
#X connect 16 0 9 0;
#X connect 17 0 9 0;
#X restore 320 318 pd getProp;
#X obj 172 158 r \$0-propreadId;
#X obj 282 158 r \$0-propwriteId;
#N canvas 432 95 450 467 setProp 0;
#X msg 44 156 label \$1;
#X msg 165 156 get \$1;
#X obj 44 31 inlet;
#X obj 218 324 outlet;
#X obj 290 57 r \$0-info;
#X obj 290 79 route prop;
#N canvas 4 50 450 300 sroute 0;
#X obj 73 12 inlet;
#X obj 312 9 inlet;
#X obj 73 113 outlet;
#X obj 73 34 list split 1;
#X obj 73 56 select s;
#X obj 73 78 list prepend;
#X connect 0 0 3 0;
#X connect 1 0 4 1;
#X connect 3 0 4 0;
#X connect 3 1 5 1;
#X connect 4 0 5 0;
#X connect 5 0 2 0;
#X restore 290 113 pd sroute;
#X obj 290 135 route float;
#X obj 44 177 s \$0-propwriteName;
#X obj 290 247 s \$0-propwriteValue;
#X msg 290 226 set \$1;
#X obj 50 276 r \$0-propwriteValue;
#X obj 50 298 route float;
#X obj 50 320 pack 0 s;
#X msg 50 342 set \$2 \$1;
#X obj 44 73 t s s s s;
#X obj 127 27 loadbang;
#X obj 127 49 t b b;
#X msg 127 71 symbol <none>;
#X connect 0 0 8 0;
#X connect 1 0 3 0;
#X connect 2 0 15 0;
#X connect 4 0 5 0;
#X connect 5 0 6 0;
#X connect 6 0 7 0;
#X connect 7 0 10 0;
#X connect 10 0 9 0;
#X connect 11 0 12 0;
#X connect 12 0 13 0;
#X connect 13 0 14 0;
#X connect 14 0 3 0;
#X connect 15 0 0 0;
#X connect 15 1 1 0;
#X connect 15 2 6 1;
#X connect 15 3 13 1;
#X connect 16 0 17 0;
#X connect 17 0 18 0;
#X connect 18 0 0 0;
#X restore 199 315 pd setProp;
#X obj 199 404 list prepend set;
#X obj 199 426 list trim;
#X obj 199 448 t b a;
#X obj 199 361 list prepend get;
#X obj 199 339 route get set;
#X obj 309 361 list prepend set;
#X obj 199 477 s \$0-propset;
#X obj 320 480 s \$0-propget;
#X obj 54 38 inlet;
#X obj 54 66 s \$0-ctl;
#X connect 0 0 4 0;
#X connect 0 1 7 0;
#X connect 1 0 2 0;
#X connect 2 0 3 0;
#X connect 3 0 15 0;
#X connect 3 1 15 0;
#X connect 4 0 12 0;
#X connect 5 0 0 0;
#X connect 6 0 0 1;
#X connect 7 0 12 0;
#X connect 8 0 9 0;
#X connect 9 0 10 0;
#X connect 10 0 14 0;
#X connect 10 1 14 0;
#X connect 11 0 1 0;
#X connect 12 0 11 0;
#X connect 12 1 13 0;
#X connect 13 0 8 0;
#X connect 16 0 17 0;
#X restore 41 526 pd PropertyLogic;
#X obj 310 70 cnv 15 100 20 empty \$0-propreadValue -- 10 9 0 14 #fcc4c4 #404040 0;
#X obj 31 111 cnv 15 400 80 empty empty writeProperties 20 12 0 14 #e0e0e0 #404040 0;
#X obj 39 137 hradio 15 1 0 1 \$0-propwriteId \$0-propwriteId empty 0 -8 0 10 #fcfcfc #000000 #000000 0;
#X obj 40 160 cnv 15 260 20 empty \$0-propwriteName <none> 10 9 0 14 #c4c4fc #404040 0;
#X obj 311 160 nbx 5 20 -1e+37 1e+37 0 0 \$0-propwriteValue \$0-propwriteValue empty 0 -8 0 14 #c4fcc4 #000000 #000000 0 256;
#X msg 66 315 get bus_info;
#X msg 83 392 set quality 5;
#X obj 66 294 r \$0-propget;
#X obj 83 372 r \$0-propset;
#X msg 87 340 get Hue Saturation;
#X text 208 340 you can query several properties at once;
#X text 146 295 query a (readable) property via a message "get <propname>";
#X text 161 372 set a (writable) property via a message "set <prop> <value>";
#X text 70 224 this will return 2 lists of readable and writable properties through the "info" outlet of [pix_video].;
#X text 72 257 NOTE that propertynames are always single symbols that might contain spaces (and other weird characters);
#X text 103 203 INIT: query names of all available properties;
#X text 83 423 ATOMIC setting of multiple properties;
#X msg 99 441 clearProps;
#X msg 99 503 applyProps;
#X msg 99 481 setProps Hue 10;
#X msg 99 461 setProps Contrast 40;
#X text 247 443 clear the current property list;
#X text 247 461 add values to the property list (don't apply yet);
#X text 247 479 add values to the property list (don't apply yet);
#X text 247 499 apply current property list;
#X connect 0 0 4 0;
#X connect 10 0 4 0;
#X connect 11 0 4 0;
#X connect 12 0 10 0;
#X connect 13 0 11 0;
#X connect 14 0 4 0;
#X connect 22 0 4 0;
#X connect 23 0 4 0;
#X connect 24 0 4 0;
#X connect 25 0 4 0;
#X restore 396 430 pd properties;
#X obj 618 459 t a a;
#X obj 618 480 print info;
#X obj 655 459 s \$0-info;
#X obj 586 376 t a a;
#N canvas 166 121 570 420 device 0;
#X obj 204 60 cnv 20 20 20 empty \$0-open-canvas 0 4 10 0 16 #e0e0e0 #000000 0;
#X obj 60 61 hradio 18 1 0 8 empty empty empty 0 -6 0 8 #d8fcd8 #000000 #000000 0;
#X obj 60 13 inlet;
#X msg 160 254 label \$1;
#X obj 160 232 makefilename %d;
#X obj 60 108 int;
#X obj 60 337 outlet;
#X obj 160 277 send \$0-open-canvas;
#X msg 130 170 device \$1;
#X obj 60 130 t b f;
#X obj 130 192 t a a;
#X obj 130 298 list prepend set;
#X obj 130 320 list trim;
#X obj 160 211 route device;
#X obj 130 116 loadbang;
#X msg 130 138 0;
#X connect 1 0 5 0;
#X connect 2 0 1 0;
#X connect 3 0 7 0;
#X connect 4 0 3 0;
#X connect 5 0 9 0;
#X connect 8 0 10 0;
#X connect 9 0 6 0;
#X connect 9 1 8 0;
#X connect 10 0 11 0;
#X connect 10 1 13 0;
#X connect 11 0 12 0;
#X connect 12 0 6 0;
#X connect 13 0 4 0;
#X connect 14 0 15 0;
#X connect 15 0 8 0;
#X coords 0 -1 1 1 165 20 1 60 60;
#X restore 609 187 pd device;
#X obj 36 565 cnv 15 400 30 empty empty empty 20 12 0 14 #fc8000 #404040 0;
#X text 48 565 NOTE: usually you cannot use a camera more than once at the same time!;
#X obj 563 413 cnv 15 80 30 empty empty empty 20 12 0 14 #14e814 #404040 0;
#X obj 567 418 pix_video;
#X obj 657 393 print videoctl;
#X obj 647 346 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1;
#X msg 665 345 backend \$1;
#X text 686 286 (if available);
#X text 16 388 Inlet 1: dialog: open a dialog to configure the input device (depending on backend / Operating System);
#X text 18 501 Outlet 2: info (for enumerating devices \, querying properties \, ...);
#X text 15 423 Inlet 1: enumProps \, get \, set \, clearProps \, setProps \, applyProps: interact with backend/device properties;
#X obj 657 374 r \$0-ctl;
#X text 54 600 you can use [pix_buffer] to distribute the same pix to different parts of your render-chain;
#X msg 625 235 device /dev/fw1;
#N canvas 484 243 450 300 META 0;
#X obj 10 25 declare -lib Gem;
#X text 10 45 DESCRIPTION open a camera and get input;
#X text 10 65 KEYWORDS Gem pix image;
#X text 20 85 INLET_0 gemlist device backend colorspace dimen enumerate dialog enumProps get set clearProps setProps applyProps;
#X text 20 105 OUTLET_0 gemlist;
#X text 20 125 OUTLET_1 info;
#X text 10 145 AUTHOR IOhannes m zmölnig;
#X text 10 165 LICENSE GPL-2.0-or-later;
#X restore 738 8 pd META;
#X obj 156 103 _backendinfo \$0 video;
#X obj 724 466 _gemwin;
#X obj 567 502 _pix2rectangle 3;
#X connect 24 0 41 0;
#X connect 25 0 36 0;
#X connect 26 0 36 0;
#X connect 27 0 36 0;
#X connect 28 0 36 0;
#X connect 29 0 36 0;
#X connect 30 0 36 0;
#X connect 31 0 36 0;
#X connect 33 0 34 0;
#X connect 33 1 35 0;
#X connect 36 0 41 0;
#X connect 36 1 42 0;
#X connect 37 0 30 0;
#X connect 41 0 55 0;
#X connect 41 1 33 0;
#X connect 43 0 44 0;
#X connect 44 0 36 0;
#X connect 49 0 36 0;
#X connect 51 0 36 0;
