#N canvas 350 148 668 577 10;
#X declare -lib Gem;
#X text 452 8 GEM object;
#X obj 9 263 cnv 15 430 250 empty empty empty 20 12 0 14 #e0e0e0 #404040 0;
#X text 40 265 Inlets:;
#X obj 9 227 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0;
#X text 18 226 Arguments:;
#X obj 8 56 cnv 15 430 165 empty empty empty 20 12 0 14 #e0e0e0 #404040 0;
#X obj 452 75 cnv 15 200 250 empty empty empty 20 12 0 14 #dce4fc #404040 0;
#X text 461 54 Example:;
#X obj 457 120 cnv 15 190 150 empty empty empty 20 12 0 14 #14e814 #404040 0;
#X text 71 31 Class: pix object;
#X text 29 57 Description: a storage place for a number of images;
#X text 11 79 [pix_buffer] is a named storage place for images. It is quite similar to Pd's [table] object (but you cannot open it and have a look at it's contents).;
#X text 50 11 Synopsis: [pix_buffer];
#X text 23 281 Inlet 1: bang: get the size of the buffer in frames;
#X text 12 123 The images stored in the [pix_buffer] can have different dimensions and colourspaces. Memory is reserved on demand \, but you can preallocate memory with the [allocate( message.;
#X text 23 481 Outlet 1: int: size of the buffer;
#X msg 464 128 bang;
#X floatatom 464 303 5 0 0 0 - - - 0;
#X msg 505 154 allocate 256 256 4;
#X text 462 426 see also:;
#X obj 475 478 pix_buffer_read;
#X obj 474 453 pix_buffer_write;
#X text 64 237 list: <buffer_name> <size>;
#X obj 464 240 pix_buffer depot 10;
#X text 10 170 To write data to the [pix_buffer] or get images from it \, you can use separate objects [pix_buffer_write] and [pix_buffer_read] or the [open( message.;
#X obj 505 80 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000;
#N canvas 0 22 450 300 openpanel 0;
#X obj 114 62 inlet;
#X obj 121 254 outlet;
#X obj 114 125 openpanel;
#X obj 114 199 t b a;
#X msg 114 162 set open \$1 0;
#X connect 0 0 2 0;
#X connect 2 0 4 0;
#X connect 3 0 1 0;
#X connect 3 1 1 0;
#X connect 4 0 3 0;
#X restore 505 97 pd openpanel;
#X text 23 300 Inlet 1: message: open <filename> <index>: put an image into the pix_buffer at the given index;
#X msg 505 132 open somefile.jpg 0;
#X msg 506 174 resize 15;
#X text 23 384 Inlet 1: message: resize <size>: re-allocate slots in the buffer (slots will survive this);
#X text 23 333 Inlet 1: message: allocate <xsize> <ysize> <bytes_per_pixel>: assume that all images in the pix_buffer will have the given dimension and preallocate memory for them (pixes will be set to black);
#X msg 506 193 copy 0 2;
#X msg 506 212 save /tmp/out.jpg 2;
#X text 23 414 Inlet 1: message: copy <src> <target>: copy a pix from slot <src> to slot <target>;
#X text 23 444 Inlet 1: message: save <filename> <index>: save image in given slot to harddisk.;
#N canvas 484 243 450 300 META 0;
#X obj 10 25 declare -lib Gem;
#X text 10 45 DESCRIPTION a storage place for a number of images;
#X text 10 65 KEYWORDS Gem pix image;
#X text 20 85 INLET_0 bang open allocate resize copy save;
#X text 20 105 OUTLET_0 int;
#X text 10 125 AUTHOR IOhannes m zmölnig;
#X text 10 145 LICENSE GPL v2;
#X restore 548 8 pd META;
#X obj 464 277 route float;
#X obj 587 240 r \$0-ctl;
#N canvas 6 49 515 369 print 0;
#X obj 102 176 inlet;
#X obj 102 198 s \$0-info;
#X obj 102 220 r \$0-infoprint;
#X obj 102 242 print INFO;
#X text 62 90 actually you can just hook a [print] to the 3rd outlet.;
#X text 64 115 here it's a bit more complicated \, as we want to filter out the messages generated from the [pd PROPERTIES] window.;
#N canvas 664 456 450 465 logic 0;
#X obj 223 19 r \$0load-ctl;
#X obj 242 184 s \$0-ctl;
#X obj 83 119 r \$0-info;
#X obj 353 19 r \$0save-ctl;
#X obj 353 42 t b a b;
#X obj 83 142 list prepend 0;
#X obj 83 188 s \$0-infoprint;
#X obj 122 380 s \$0load-info;
#X obj 147 400 s \$0save-info;
#X msg 223 64 0;
#X msg 262 64 1;
#X msg 392 66 2;
#X msg 353 65 0;
#X obj 353 88 t f;
#X obj 223 42 t b b b;
#X msg 242 151 loadbackend;
#X msg 372 156 savebackend;
#X obj 223 105 t a;
#X obj 156 261 fudiformat -u;
#X obj 188 305 fudiparse;
#X obj 83 165 route 0;
#X obj 122 209 list split 1;
#X obj 122 328 list append;
#X obj 122 351 route 1 2;
#X obj 156 284 list split 4;
#X obj 156 235 list trim;
#X connect 0 0 14 0;
#X connect 2 0 5 0;
#X connect 3 0 4 0;
#X connect 4 0 12 0;
#X connect 4 1 16 0;
#X connect 4 2 11 0;
#X connect 5 0 20 0;
#X connect 9 0 17 0;
#X connect 10 0 17 0;
#X connect 11 0 13 0;
#X connect 12 0 13 0;
#X connect 13 0 17 0;
#X connect 14 0 9 0;
#X connect 14 1 15 0;
#X connect 14 2 10 0;
#X connect 15 0 1 0;
#X connect 16 0 1 0;
#X connect 17 0 5 1;
#X connect 18 0 24 0;
#X connect 19 0 22 1;
#X connect 20 0 6 0;
#X connect 20 1 21 0;
#X connect 21 0 22 0;
#X connect 21 1 25 0;
#X connect 22 0 23 0;
#X connect 23 0 7 0;
#X connect 23 1 8 0;
#X connect 24 1 19 0;
#X connect 25 0 18 0;
#X restore 347 257 pd logic;
#X connect 0 0 1 0;
#X connect 2 0 3 0;
#X restore 543 277 pd print;
#X obj 67 549 _backendinfo \$0save imagesaver;
#X obj 67 523 _backendinfo \$0load imageloader;
#X text 244 524 loading images;
#X text 244 551 saving images;
#X connect 16 0 23 0;
#X connect 18 0 23 0;
#X connect 23 0 37 0;
#X connect 25 0 26 0;
#X connect 26 0 28 0;
#X connect 28 0 23 0;
#X connect 29 0 23 0;
#X connect 32 0 23 0;
#X connect 33 0 23 0;
#X connect 37 0 17 0;
#X connect 37 1 39 0;
#X connect 38 0 23 0;
