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;
I tried that and separator, still the problem persists.
Thanks for the try! ;)
..b..
Mathieu Bouchard wrote:
On Wed, 15 Aug 2007, B. Bogart wrote:
Any ideas for workaround would be appreciated.
[pix_separator] ?
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801, Montréal QC Canada
GEM-dev mailing list GEM-dev@iem.at http://lists.puredata.info/listinfo/gem-dev
Hallo Gem-devs!
Is there a possibility to get the current framerate of Gem (in a e.g. pix_ object) ?
As far as I understand the GEM code this should be stored in the GemMan (Base/GemMan.h) class in the static variable float GemMan::fps. However, when I try to access this variable from my pix object I always get 0 as framerate (and yes, I started rendering before that).
Has anyone an idea ?
Many thanks, LG Georg
Did you turn on profiling with a 'profile 1' message to the gemwin?
On 8/16/07, Georg Holzmann grh@mur.at wrote:
Hallo Gem-devs!
Is there a possibility to get the current framerate of Gem (in a e.g. pix_ object) ?
As far as I understand the GEM code this should be stored in the GemMan (Base/GemMan.h) class in the static variable float GemMan::fps. However, when I try to access this variable from my pix object I always get 0 as framerate (and yes, I started rendering before that).
Has anyone an idea ?
Many thanks, LG Georg
GEM-dev mailing list GEM-dev@iem.at http://lists.puredata.info/listinfo/gem-dev
Hallo chris!
Did you turn on profiling with a 'profile 1' message to the gemwin?
I just tried this but also with 'profile 1' I cannot get the framerate (is still zero), I only get lots of "GEM: time: 0,102756" messages in the console.
I try to read the framerate with float framerate = GemMan::fps;
Thanks, LG Georg
I have only used the 'fps' feature on Window and OSX. Maybe this is not implemented on Linux?
On 8/16/07, Georg Holzmann grh@mur.at wrote:
Hallo chris!
Did you turn on profiling with a 'profile 1' message to the gemwin?
I just tried this but also with 'profile 1' I cannot get the framerate (is still zero), I only get lots of "GEM: time: 0,102756" messages in the console.
I try to read the framerate with float framerate = GemMan::fps;
Thanks, LG Georg
Hallo!
chris clepper schrieb:
I have only used the 'fps' feature on Window and OSX. Maybe this is not implemented on Linux?
Yes, thats not supported on linux. However, I just recognized that I need something else.
One can calculate the framerate like this: ( 0.0 != s_deltime) ? (1000. / s_deltime) : 0.0 ); where s_deltime is a static variable in GemMan.cpp, so I cannot access it from outside unfortunately ...
Should/Can I add a getFramerate method to GemMan class ? (I really need this for video file writing, because with some APIs you have to set the framerate bevor recording ...)
LG Georg
Hallo!
I implemented a static getFramerate Method in GemMan now, so it's possible to query the framerate.
Can someone commit this into CVS ? (diffs attached)
Thanks, LG Georg
10,11c10,11 < // Copyright (c) Gï¿œnther Geiger. < // Copyright (c) 2001-2002 IOhannes m zmoelnig. forum::fï¿œr::umlï¿œute ---
// Copyright (c) Günther Geiger. // Copyright (c) 2001-2002 IOhannes m zmoelnig. forum::für::umläute
100d99 < double GemMan::s_deltime = 50.; 111a111
static double s_deltime = 50.;
1503,1511d1502 < // get Framerate < // < ///////////////////////////////////////////////////////// < float GemMan :: getFramerate() < { < return (s_deltime != 0.0) ? (1000. / s_deltime) : 0.0; < } < < ///////////////////////////////////////////////////////// 1645c1636 < post("frame rate: %f", getFramerate() ); ---
post("frame rate: %f", (0.0 != s_deltime) ? 1000. / s_deltime : 0.0);
9,10c9,10 < Copyright (c) Gï¿œnther Geiger. geiger@epy.co.at < Copyright (c) 2001-2002 IOhannes m zmoelnig. forum::fï¿œr::umlï¿œute. IEM. zmoelnig@iem.kug.ac.at ---
Copyright (c) Günther Geiger. geiger@epy.co.at Copyright (c) 2001-2002 IOhannes m zmoelnig. forum::für::umläute. IEM. zmoelnig@iem.kug.ac.at
127,130d126 < // Get the frame rate < static float getFramerate(); < < ////////// 244,245d239 < < static double s_deltime;
Now I get what you want to do. You just want the framerate the gemwin is set to and not the actual real-world times. The framerate output from the gemwin object and the Quicktime recording objects use real-time timers since Pd's logical time is not useful for profiling or dealing with other APIs.
Since you just want a single time value can't you have this set at the patch level? I tried this with the QT recordings but it didn't work well at all because the actual time between frames can vary quite a bit.
On 8/18/07, Georg Holzmann grh@mur.at wrote:
Hallo!
I implemented a static getFramerate Method in GemMan now, so it's possible to query the framerate.
Can someone commit this into CVS ? (diffs attached)
Thanks, LG Georg
10,11c10,11 < // Copyright (c) G�nther Geiger. < // Copyright (c) 2001-2002 IOhannes m zmoelnig. forum::f�r::uml�ute
// Copyright (c) Günther Geiger. // Copyright (c) 2001-2002 IOhannes m zmoelnig. forum::für::umläute
100d99 < double GemMan::s_deltime = 50.; 111a111
static double s_deltime = 50.;
1503,1511d1502 < // get Framerate < // < ///////////////////////////////////////////////////////// < float GemMan :: getFramerate() < { < return (s_deltime != 0.0) ? (1000. / s_deltime) : 0.0; < } < < ///////////////////////////////////////////////////////// 1645c1636
< post("frame rate: %f", getFramerate() );
post("frame rate: %f", (0.0 != s_deltime) ? 1000. / s_deltime : 0.0);
9,10c9,10 < Copyright (c) G�nther Geiger. geiger@epy.co.at < Copyright (c) 2001-2002 IOhannes m zmoelnig. forum::f�r::uml�ute. IEM. zmoelnig@iem.kug.ac.at
Copyright (c) Günther Geiger. geiger@epy.co.at Copyright (c) 2001-2002 IOhannes m zmoelnig. forum::für::umläute.
IEM. zmoelnig@iem.kug.ac.at 127,130d126 < // Get the frame rate < static float getFramerate(); < < ////////// 244,245d239 < < static double s_deltime;
Hallo!
Now I get what you want to do. You just want the framerate the gemwin is set to and not the actual real-world times. The framerate output
yes !
Since you just want a single time value can't you have this set at the patch level?
well, I could, but I think this is not very user friendly (in gstreamer you need this for read and write object - so one would have to send the Gem framerate to th object before writing or reading a video file ...)
I tried this with the QT recordings but it didn't work well at all because the actual time between frames can vary quite a bit.
yes, but thats no problem in the gstreamer case. the time can vary between the single frames ...
LG Georg
pix_separator after pix_buffer_read will work has done so for me in the past. pix_buffer read does not create a new copy of the buffer contents to send along the chain, so any object that alters a pix_ stream will alter buffer contents.
On 8/15/07, B. Bogart ben@ekran.org wrote:
I tried that and separator, still the problem persists.
Thanks for the try! ;)
..b..
Mathieu Bouchard wrote:
On Wed, 15 Aug 2007, B. Bogart wrote:
Any ideas for workaround would be appreciated.
[pix_separator] ?
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801, Montréal QC Canada
GEM-dev mailing list GEM-dev@iem.at http://lists.puredata.info/listinfo/gem-dev
GEM-dev mailing list GEM-dev@iem.at http://lists.puredata.info/listinfo/gem-dev
On Thu, 16 Aug 2007, chris clepper wrote:
On 8/15/07, B. Bogart ben@ekran.org wrote:
I tried that and separator, still the problem persists. Thanks for the try! ;)
pix_separator after pix_buffer_read will work has done so for me in the past. pix_buffer read does not create a new copy of the buffer contents to send along the chain, so any object that alters a pix_ stream will alter buffer contents.
If [pix_separator] does not work, it is because it has to be used in combination with [t a a] so that the separator is applied in the right order. Using two [pix_separator] and no ordering will also work, but perhaps will also cause an unnecessary copy (?).
(does that help Ben?)
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801, Montréal QC Canada