Re: [clutter] Capturing image data from stage save as video file.

2009-06-08 Thread Jimmy Thrasher
Take a look at Yukon: https://devel.neopsis.com/projects/yukon/  It's
meant for GL capturing.

I've used it, and it works, though I've never used it for Clutter.

Jimmy

On Mon, Jun 8, 2009 at 7:00 PM, Florentfthi...@gmail.com wrote:
 the gnome-shell project has a set of hooks that allow them to capture
 the contents of the screen to make videos through GStreamer. I suggest
 you take a look at that as well.

 Very interesting, thanks for pointing it out !

 It's located in src/shell-recorder.c, and is a gstreamer plugin based
 on appsrc, and uses glReadPixel calls to grab frames. The gstreamer
 videorate element is used to smooth the capture.

 The test-recorder.c file shows an usage example.

 FLo
 --
 To unsubscribe send a mail to clutter+unsubscr...@o-hand.com


-- 
To unsubscribe send a mail to clutter+unsubscr...@o-hand.com



Re: [clutter] Animations

2009-05-25 Thread Jimmy Thrasher
Another possibility would be to remove the underlying animation logic
entirely and separate it out.

what-I-mean
The libanim library, for example
(http://github.com/jtdubs/libanim/tree/master) assumes the concept of
animation is unrelated to the actual rendering or modeling frameworks
used.  Rather, you set up values to be animated and ask it for the
values at time t.  This allows you to do animations live, or render
them frame by frame to some file, etc.  It separates concerns.
/what-I-mean

Clutter could use libanim (or similar) and build its clutter-style
animations on top of it.  There would be no need for and alpha
function or a timeline.. simply an animation (p.s. I haven't thought
this through).

Jimmy

On Mon, May 25, 2009 at 8:46 AM, Jonas Bonn jo...@southpole.se wrote:
 Hi,

 I had a short discussion with ebassi on #clutter... we decided I would send
 an email detailing what I feel are some weaknesses in the Animation
 API/implementation.  Thanks for considering this; my thoughts follow:

 

 An Animation currently keeps track of:

 timeline
 mode
 duration
 loop

 However, these four properties are actually properties of:

 i)  The underlying Alpha object (mode, timeline)
 ii)  The Alpha object's timeline (duration, loop)

 I am free to manipulate the Alpha object directly; I can call
 clutter_animation_get_alpha(...) and then set the Alpha properties directly.

 PROBLEM 1:  The Animation does not watch the Alpha object for property
 changes, so direct manipulation of the Alpha's properties results in the
 Animation becoming out of sync with its Alpha.  Concretely, this means that
 the Animation's timeline no longer mirrors the Alpha's timeline and likewise
 for the mode.

 POTENTIAL SOLUTION:  Watch Alpha for property changes and update Animation
 accordingly.

 BUT:  Why bother mirroring the properties?

 BETTER SOUTION:  Just defer to the Alpha when querying/updating Animation
 properties...

 

 The same goes for the timeline.

 PROBLEM 2:  I can manipulate the timeline externally, but the Animation does
 not watch for changes to timeline properties so the Timeline and Animation
 can get out of sync.

 POTENTIAL SOLUTION:  Watch Timeline for property changes and update
 Animation accordingly...

 BUT:  Again, why bother with the mirroring?

 BETTER SOLUTION:  Just fall through to the Alpha's Timeline for
 querying/updating properties.

 

 As it stands today, when I call clutter_animation_set_timeline(animation,
 timeline), then the timeline will be stored in both the Animation and the
 Alpha.

 PROBLEM 3:  The Alpha may have been set externally (e.g. with
 _animation_set_alpha(anim, alpha))... it should be made explicitly clear
 that setting the Animation's timeline has the side-effect of setting the
 Alpha's timeline. (This may surprise the user).

 POTENTIAL SOLUTION:  Document this.

 BUT:  Again, why bother storing the timeline in two places?

 BETTER SOLUTION:  Document explicitly that that animation_set_timeline is
 just a helper function that sets the timeline on the underlying alpha.  This
 way, there are no surprises.

 

 The API currently requires something like the following (note here the two
 calls to _set_timeline and _set_alpha with parameter NULL).

 anim = clutter_animation_new();
 clutter_animation_set_object(anim, G_OBJECT(actor));
 clutter_animation_set_duration(anim, 150);
 clutter_animation_set_mode(anim, CLUTTER_LINEAR);
 clutter_animation_set_timeline(anim, NULL);
 clutter_animation_set_alpha(anim, NULL);
 interval = clutter_interval_new(G_TYPE_UCHAR, 0, 255);
 clutter_animation_bind_interval(anim, opacity, interval);
 timeline = clutter_animation_get_timeline(anim);


 PROBLEM:  If I forget to call _set_alpha, then the animation just silently
 fails to do anything. (I ran into this... took me a while to figure out).

 SOLUTION:  An animation without an alpha is pretty useless... if the
 animation has no alpha when the user tries to run it, then we should set up
 a default alpha for him.  This ties into the following point...

 

 PROBLEM:  The two calls to _set_timeline and _set_alpha with parameter NULL
 should not be necessary as they are just invoking a default configuration.

 SOLUTION:  Make clutter_animation_get_timeline() do the right thing by
 creating the necessary underlying Alpha and Timeline if they do not already
 exist.  Then these two calls can go away.

 NOTE:  (Given this solution) Generally, the underlying Alpha and Timeline
 will already exist before clutter_animation_get_timeline is called because
 they will need to be created in order to hold the other property values...
 see the notes that follow:

 NOTES:

 _set_duration:  requires a timeline, so this function will implicity create
 an alpha and a timeline if they are not already set.
 _set_loop:  requires a timeline, so same as for _set_duration
 _set_mode:  requires an alpha, so this function will implicitly create an
 alpha if one is not already set.

 _set_timeline:  

Re: [clutter] Darken Texture

2009-05-22 Thread Jimmy Thrasher
I can see this being handy for WMs as well, for window dragging.

Perhaps it would be better to try to implement it for ClutterActor,
though.  I can see cases where it'd be nice to tint a while
ClutterGroup, or any number of other types.

Jimmy

2009/5/22 Neil Roberts n...@o-hand.com:
 I wonder if we should add a 'tint' property to ClutterTexture? It could
 take a ClutterColor and would allow this kind effect. I'm also doing
 something similar in Aisleriot to add a blue tint to the highlighted
 card so it's probably a fairly common effect.

 Regards,
 - Neil

-- 
To unsubscribe send a mail to clutter+unsubscr...@o-hand.com



[clutter] Confusion regarding offscreen rendering with GLX backend

2009-05-15 Thread Jimmy Thrasher
Hi folks,

So far life has been blissful in clutter-land.  One point of confusion
I'm seeing, though:

I'm trying to do the following:
- render a clutter stage offscreen
- on paint, or timeline new-frame, or something, render the current
offscreen buffer somewhere

However, in perusing the Clutter source, I'm not seeing that any data
is actually being put into this offscreen buffer.

Here's how I'm trying to do it:
- g_object_set(stage, offscreen, TRUE, NULL)
- clutter_actor_realize(stage)
- Drawable d = glXGetCurrentDrawable()
- use cairo or an XGetImage buffer copy (I've tried both) to render to
a different rendering context.

How do I get at the offscreen buffer, since glXGetCurrentDrawable
doesn't seem to work?

Thanks,

Jimmy
-- 
To unsubscribe send a mail to clutter+unsubscr...@o-hand.com



[clutter] Re: Confusion regarding offscreen rendering with GLX backend

2009-05-15 Thread Jimmy Thrasher
Forgive me, I forgot my version info.  I'm using git commit id:
659cd671af7387a12adb (release 0.8.8)

Jimmy

On Fri, May 15, 2009 at 10:56 AM, Jimmy Thrasher
ji...@jimmythrasher.com wrote:
 Hi folks,

 So far life has been blissful in clutter-land.  One point of confusion
 I'm seeing, though:

 I'm trying to do the following:
 - render a clutter stage offscreen
 - on paint, or timeline new-frame, or something, render the current
 offscreen buffer somewhere

 However, in perusing the Clutter source, I'm not seeing that any data
 is actually being put into this offscreen buffer.

 Here's how I'm trying to do it:
 - g_object_set(stage, offscreen, TRUE, NULL)
 - clutter_actor_realize(stage)
 - Drawable d = glXGetCurrentDrawable()
 - use cairo or an XGetImage buffer copy (I've tried both) to render to
 a different rendering context.

 How do I get at the offscreen buffer, since glXGetCurrentDrawable
 doesn't seem to work?

 Thanks,

 Jimmy

--
To unsubscribe send a mail to clutter+unsubscr...@o-hand.com