Re: [clutter] How to mask two texture

2010-05-28 Thread Samuel Degrande

Rakesh Kumar wrote:

Hi Samuel,
 
 Sorry for late reply I was on vacation.

 You have asked for two images dummy.png and dummy1.jpg.
 So for your reference I am attaching two images and 
 Also I am attaching the final out put. Please comment on

 this.
RK.



Your dummy.png is quite wholly transparent, that's why the resulting
image is also transparent.

Here is how it works:
the two images are *combined* together, so the RGBA value of the
composed image is the 'multiplication' of the two images. (the two
images are not displayed one *over* the other).

It means that the final image gets the transparency of dummy.png.

dummy.png should be a mask : white where your want to see dummy1.png,
fully transparent where you want to see the background.
(and half-transparent where you want to *add* transparency to
dummy1.png)

Do you understand ? (my english is not very good...)


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



Re: [clutter] How to mask two texture

2010-05-28 Thread Samuel Degrande

Rakesh Kumar wrote:

Thanks for your quick reply.I have just given a thought
We are modulating the two images so any way it will get 
Color of both image.I have tried alpha test also but its not worked.

I think I should try some different method.



I think you need 3 layers :
- the basic image
- composed with a second layer to add 'lightning'
- composed with a 'scissor' mask

 
Rakesh Kumar wrote:

Hi Samuel,
 
 Sorry for late reply I was on vacation.

 You have asked for two images dummy.png and dummy1.jpg.
 So for your reference I am attaching two images and 
 Also I am attaching the final out put. Please comment on

 this.
RK.




Your dummy.png is quite wholly transparent, that's why the resulting
image is also transparent.



Here is how it works:
the two images are *combined* together, so the RGBA value of the
composed image is the 'multiplication' of the two images. (the two
images are not displayed one *over* the other).



It means that the final image gets the transparency of dummy.png.



dummy.png should be a mask : white where your want to see dummy1.png,
fully transparent where you want to see the background.
(and half-transparent where you want to *add* transparency to
dummy1.png)


 
These four lines I didn't understand.





Do you understand ? (my english is not very good...)







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



Re: [clutter] How to mask two texture

2010-05-21 Thread Samuel Degrande

Rakesh Kumar wrote:

Hi Samuel,
 
 Now I am getting the masking but its also blended 
 With the stage color. Stage color is coming on masked

 Image. Any help will be appreciated.
Regards,
RK. 



How would you like it to work ? If you have transparency, then you'll
see what is displayed behind the transparent part. Or perhaps I do not
understand what you're trying to do...

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



Re: [clutter] How to mask two texture

2010-05-20 Thread Samuel Degrande

Rakesh Kumar wrote:
 
Hi Neil,
 
I have done like this but I am not getting masking in my program.

Code Snippet:In the loading image
  
Load_Image()

{
gchar **files;
files = g_new (gchar*, 1);

 files[0] = g_build_filename (/home/rakeshk4/Development/Pictureflow/, 
Dummy_Alpha_Path.png, NULL);

//path I am geeting from argument
ClutterActor *actor = clutter_texture_new_from_file (path, NULL);

CoglHandle alpha_mask_texture =  cogl_texture_new_from_file 
(files[0],COGL_TEXTURE_NONE, COGL_PIXEL_FORMAT_ANY,error);

  
Coglhandle material = clutter_texture_get_cogl_texture (CLUTTER_TEXTURE (actor));


cogl_material_set_layer (material, 1, alpha_mask_texture);
cogl_material_set_layer_combine (material, 1,
 RGBA = MODULATE (PREVIOUS, TEXTURE),
 error);

I am getting this warning meassage:
cogl_material_set_layer_combine: assertion `cogl_is_material (handle)'failed

I am using this sample.
http://github.com/pmarti/clutter-tutorial/tree/50679e5eb5ebeb9cbfaab99ceacd9e85deabf3bb/examples/full_example


Regards,
RK

Hi

Rakesh Kumar rakesh.ku...@kpitcummins.com wrote:


I have two texture one is rectangular texture and other one contains
alpha texture that is non rectangular texture ,from this i would like
to mask two texture and create new shape texture. How we can do this
in clutter.


You should be able to do this with a custom material on a ClutterTexture
using multi-texturing. Assuming you have your alpha mask texture in a
CoglHandle and your base texture in a ClutterTexture you can do
something like this:

ClutterActor *base_texture = ...;
CoglHandle alpha_mask_texture = ...;
CoglHandle material;

/* Get the material from the Clutter texture */
material =
  clutter_texture_get_cogl_texture (CLUTTER_TEXTURE (base_texture));


maaterial = clutter_texture_get_cogl_material (CLUTTER_TEXTURE 
(base_texture));


that could fix the error, afaik...


/* Add the alpha mask as a second texture layer */
cogl_material_set_layer (material, 1, alpha_mask_texture);
/* Set the combine function so that the base texture is modulated by the
   alpha component of the mask texture */
cogl_material_set_layer_combine (material, 1,
 RGBA = MODULATE (PREVIOUS, TEXTURE[A]),
 NULL);

If you need picking to work as well then you would need to subclass
ClutterTextue and override the pick method so that it draws a solid
rectangle masked by the alpha texture in a similar way.

You may want to take a look at Mutter¹ which does a similar thing to
support shaped windows.

- Neil

¹ http://ho.io/ck29




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



Re: [clutter][win32]

2009-10-26 Thread Samuel Degrande

On 26/10/2009 09:24, Konstantin Salavatov wrote:

Hello!
I've got assignment to evaluate Clutter features and abilities. Our
goal: showing several video files (or streams) simultaneously with
some some 3D and 2D effects applied. Like folding pages, rotating,
transparency changing etc.  Something like what WPF/Silverlight can
do. I was able to build v.1.0.8 using instructions from
http://www.busydoingnothing.co.uk/blog/2008/07/13#ClutterWin32 but no
one test run. All are stopped by not being able to locate some entry
point in Cairo. Also version 0.8.0 mentioned in the build guide does
not even build successfully. I've used MSys environment. So my
questions:
1) is Clutter already able to suit our needs? Is it already stable enough?
2) where is build/msvc_2k5/ directory mentioned in the stable build of
Clutter reference manual?
3) where is .net support mentioned by listing c# on the title page of
clutter-project? Is generating interop assembly already implemented?
4) where I can get good and proven build guide for current version of
Clutter for *fresh* xp build environment not yet enchanted by unix
magic tools.
Thanks,
Kostya


I've got a VS2008 build environment, based on OAH Build Team work.
Building all libs needed for Clutter is a bit complex, but I could
provide them if you need (I use master dev branch of Clutter).

Compiling one Clutter application is however quite simple.

If you're interested, you can contact me.

--
Samuel Degrande   LIFL - UMR8022 CNRS - INRIA Futurs - Bat M3
Phone: (33)3.28.77.85.30  USTL - Universite de Lille 1
   (33)3.62.53.15.70  59655 VILLENEUVE D'ASCQ CEDEX - FRANCE
[CA certs: http://igc.services.cnrs.fr/CNRS-Standard/recherche.html ]
--
To unsubscribe send a mail to clutter+unsubscr...@o-hand.com



Re: [clutter] WHERE IS clutter_sini?

2009-09-03 Thread Samuel Degrande

On 03/09/2009 10:33, Jianchun Zhou wrote:

Dear Samuel:

You said you are now porting clutter toys to clutter 1.0, have you ever
successfully port one of the toys named odo?



I did not have to port it, because Chris Lord already did it :
http://chrislord.net/files/clutter-animations-talk.zip

The new odo toys is in the 'demo' dir.

Regards.

--
Samuel Degrande   LIFL - UMR8022 CNRS - INRIA Futurs - Bat M3
Phone: (33)3.28.77.85.30  USTL - Universite de Lille 1
   (33)3.62.53.15.70  59655 VILLENEUVE D'ASCQ CEDEX - FRANCE
[CA certs: http://igc.services.cnrs.fr/CNRS-Standard/recherche.html ]
--
To unsubscribe send a mail to clutter+unsubscr...@o-hand.com



Re: [clutter] clutter_actor_animate ()

2009-08-13 Thread Samuel Degrande

On 13/08/2009 01:41, Ian Walberg wrote:

Neil,

Thanks that helps.

However I am getting this following error :-

'Cannot bind property '' objects of type 'ClutterTexture' do not have
this property'

When I try the rotation example :-

clutter_actor_animate (actor, CLUTTER_EASE_IN, 100,
  rotation-angle-z, 360,
  fixed::rotation-center-z,center,
  NULL);
Thanks

Ian



I was caught by such an error several times !!

You have to take care to provide the right type of values.
So you need, for example

clutter_actor_animate (actor, CLUTTER_EASE_IN, 100,
   rotation-angle-z, 360.0,
   fixed::rotation-center-z,center,
   NULL);

This is rather very annoying, because we are so used to implicit
type conversion...

--
Samuel Degrande   LIFL - UMR8022 CNRS - INRIA Futurs - Bat M3
Phone: (33)3.28.77.85.30  USTL - Universite de Lille 1
   (33)3.62.53.15.70  59655 VILLENEUVE D'ASCQ CEDEX - FRANCE
[CA certs: http://igc.services.cnrs.fr/CNRS-Standard/recherche.html ]
--
To unsubscribe send a mail to clutter+unsubscr...@o-hand.com



Re: [clutter] WHERE IS clutter_sini?

2009-08-13 Thread Samuel Degrande

On 13/08/2009 11:17, Jianchun Zhou wrote:

Hello, guys:

In version 1.0 I found some functions and maros were gone, like:

clutter_sini
clutter_cosi
CFX_MUL

Any idea where they are?

Thanks a million!

--
Best Regards


As far as I know, the Fixed Point API was removed, and clutter now use
floating point values internally.

So, once again AFAIK, you juste have to replace, for example :

clutter_sini(v*512) by sin(v*M_PI) and so on...
CFX_MUL(a, b) by a * b

you can also remove any float - fixed point conversions.

This is at least what I did on the clutter toys to adapt them
to 1.0 API.

I let clutter core developers to correct me if I'm wrong...

--
Samuel Degrande   LIFL - UMR8022 CNRS - INRIA Futurs - Bat M3
Phone: (33)3.28.77.85.30  USTL - Universite de Lille 1
   (33)3.62.53.15.70  59655 VILLENEUVE D'ASCQ CEDEX - FRANCE
[CA certs: http://igc.services.cnrs.fr/CNRS-Standard/recherche.html ]
--
To unsubscribe send a mail to clutter+unsubscr...@o-hand.com