Hey all,
I'm using pix_buffers to store images, and using various gemchains with pix_buffer_read to represent those same images in different ways.
The problem I'm having is that it seems that putting a pix_mask below pix_buffer_read will actually add that alpha channel to the pix_buffer. The contents of the image actually change.
I expect pix_buffer_read to only read, and never alter the contents of the buffer.
I tried a bunch of methods, but no matter what I do the only way to clear the alpha added by pix_buffer_read is to reload an image into pix_buffer using pix_buffer_write.
Perhaps a new object pix_stripalpha ?
Attached is a demo patch.
Any ideas for workaround would be appreciated.
.b.
#N canvas 474 380 716 404 10; #X obj 20 23 gemhead; #X obj 35 360 rectangle 5.333 4; #X obj 23 49 translateXYZ 5.333 0 0; #X obj 32 175 pix_buffer_write buffer; #X obj 273 22 gemhead; #X obj 288 335 pix_texture; #X obj 288 359 rectangle 2.6666 2; #X obj 255 66 translateXYZ 8 -2 0; #X obj 87 132 hradio 15 1 0 4 empty empty empty 0 -6 0 8 -262144 -1 -1 0; #X obj 344 108 hradio 15 1 0 4 empty empty empty 0 -6 0 8 -262144 -1 -1 1; #X floatatom 168 129 5 0 0 0 - - -; #X floatatom 301 107 5 0 0 0 - - -; #X obj 282 234 pix_mask; #X obj 334 209 pix_buffer_read video-mask; #X obj 339 182 gemhead; #X msg 505 180 0; #X obj 287 310 alpha; #X obj 566 24 gemhead; #X obj 637 110 hradio 15 1 0 4 empty empty empty 0 -6 0 8 -262144 -1 -1 1; #X floatatom 594 109 5 0 0 0 - - -; #X obj 536 142 pix_buffer_read buffer; #X obj 544 272 rectangle 2.6666 2; #X obj 540 207 alpha; #X obj 548 68 translateXYZ 8 2 0; #X obj 249 30 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1 ; #X obj 538 27 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1 ; #X obj 35 263 pix_texture; #X obj 32 91 pix_image test-image.jpg; #X obj 86 24 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1 ; #X obj 264 263 pix_texture; #X obj 243 140 pix_buffer_read buffer; #X obj 544 248 pix_texture; #X obj 232 196 spigot 1; #X obj 292 171 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1; #X connect 0 0 2 0; #X connect 2 0 27 0; #X connect 3 0 26 0; #X connect 4 0 7 0; #X connect 5 0 6 0; #X connect 7 0 30 0; #X connect 8 0 3 1; #X connect 9 0 30 1; #X connect 10 0 3 1; #X connect 11 0 30 1; #X connect 12 0 29 0; #X connect 13 0 12 1; #X connect 14 0 13 0; #X connect 15 0 13 1; #X connect 16 0 5 0; #X connect 17 0 23 0; #X connect 18 0 20 1; #X connect 19 0 20 1; #X connect 20 0 22 0; #X connect 22 0 31 0; #X connect 23 0 20 0; #X connect 24 0 4 0; #X connect 25 0 17 0; #X connect 26 0 1 0; #X connect 27 0 3 0; #X connect 28 0 0 0; #X connect 29 0 16 0; #X connect 30 0 32 0; #X connect 31 0 21 0; #X connect 32 0 12 0; #X connect 33 0 32 1;