Idea For Discussion - Offscreen Window Grab App Launcher & Embedment /Menu Bar Interrogator Super Hack Provider Plugin

This is the concept...

A QC patch launches a arbitrary app from file path input, in a viewable secondary QC Editor app window... in the Setting panel of the patch! One can control x/y pixel width and height, as well as offset translations somewhere in all of this, similar to the v002 screen capture patch. During all of this, the app is only viewable in this largish settings panel, or perhaps a bigger GUI hack, that launches a unique window.

One autoconfigures controls for the patch in a way similar to a composition loader. After "configuring" all of the parameters of said app would be available via the app's menubar are available as inputs or outputs (if applicable) to the QC patch.

One can minimize of close this app Viewer window, and the QC provider patch, would still output the image. The Viewer window is just for the luxury of seeing the actual window of the app one will eventually be "offscreen grabbing" from.

The app file itself, should be able to be embedded in the composition.

Now, the idea, is that it would be a universal way of getting visual input for other apps "into" QC, without having to worry about doing a screen grab in a traditional sense, or having to make sure that windows always open in the same place so that the image can get piped into QC (via something like v002 screengrab). If the menu bar, or perhaps other controls, of an app can be used to dynamically configure input/ouput ports on a QC patch, it would provide a modest level of interactivity as well.

I see this as a provider type of patch, that would be able to be plugged into any standard QC renderer. It would be really useful for launching Processing app windows, and grabbing the visual result into QC, or maybe things like Ogre, or various gaming engines.

I'm going to label this as "semi-started", since a few of the hurdles are already sort of done...

cybero's picture
Re: Idea For Discussion - Offscreen Window Grab App ...

That sounds like a really interesting idea. Like you say, a lot of what's required is pretty much in place, or looks like it can be manipulated to do what you're asking.

BTW, would this possibly have some sort of cross over with the published enquiry I made regarding QC replicating the kind of out of the main viewer window transparent Flash animation on the recent vimeo of the tostito's salsa advert - corny of me [pun intended] see - the answer is probably no to that one - yeah?

Actually - come to think of it, couldn't one make a QB to do the transparent animation and make that the app that is called upon by the central animating composition? Albeit the case that the QB app might contain separate animation instructions , unlike the usual Flash construct, which does that all in all, as evidenced by the vimeo post pointed to above.

Slightly different from what you are actually referring to , I know, doesn't need the same patches you referred to neither.

vade's picture
Re: Idea For Discussion - Offscreen Window Grab App ...

You can do this now easily with some legwork. Just draw to a transparent GL view that is layer ordered to be on top of its parent window, which is whatever you want your app to be. Like you said, Quartz Builder can do some of this now, but really you'd probably want to do some of this in Cocoa.

cybero's picture
Re: Idea For Discussion - Offscreen Window Grab App ...

Cheers for the heads up, thought it might be feasible, just love that out of the movie player salsa ad :-) Cups of Cocoa do beckon. Plain.

vade's picture
Re: Idea For Discussion - Offscreen Window Grab App ...

So not gonna happen. I can't tell you how many caveats this has, and how slow it would be. The closest you could get is the CGWindowList API which allows you to capture windows from applications regardless of them being on screen or not (or, hidden), but to get all of the menu items, non standard controls that an app my have or use, as well as work around apps that can't draw offscreen, and to capture all of their output without anything else, provide all the input ports, handle modal windows/dialogs that pop up. Oh, and CGWindowList apis read back from the GPU and totally peg the Window Server. I had a version of v002 screen capature using that, CPU would be ~ 40-50% and the window server would stutter.

The best you could do is possible have a second user running in fast user switching and somehow VNC into that from the 1st user. Not sure if thats even possible.

gtoledo3's picture
Re: Idea For Discussion - Offscreen Window Grab App ...

Is using CGWindowList/pegging the window server totally unavoidable? If a window is in something like an alternate Desktop area, like Spaces or the older YouControl Desktops, and isn't in the chosen "space", is it still considered offscreen?

Usefulness wise, it would be killer, even if one couldn't turn menu items into ports. Embedding the needed apps in composition (like a processing pde file and runner) would also be extremely slick, and I'm sure that can be done. I just don't know if a generic app-runner is possible in QC via a plugin, much less the issue of how to deal with menu items...

I know this is totally a non-standard idea. I've simply been using the v002 screen grab with Processing sketches and QC some, and it would be so eloquent to be able to "not" have to see the Processing window/app, and to not have to worry about "where" a Processing window pops up, and if QC will be grabbing correctly. It's something that, visually, can be extremely nice, but it's lack of portability, and the fact that one can't hit a button and have all windows pop up at once and always be in the same place, makes it a total no-go.

Porting something like Processing language to QC would be amazing and really handy (I'm aware of the OpenFrameworks plugin, but I haven't checked it out, and am not as familiar with OpenFrameworks as I am Processing, though I've used it as it's progressed through various versions)... but it seems like maybe there is a way to do a one shoe fits all, broad stroke, sort of solution for using other types of graphic programing apps that generate visual output with QC.

BTW, do I have to sign up to that one repository to download the actual project for the OpenFrameworks plugin? As is, it isn't listed in the downloads...