Re: [clutter] pyclutter: Texture from pixbuf
On Tue, Oct 14, 2008 at 08:34:55PM +0100, Emmanuele Bassi wrote: I'd really, *really* don't want to have GdkPixbufLoader functionality in Clutter: it would be useless replication. you can already use the loader API by simply including gdk-pixbuf.h and compiling against libgdkpixbuf; the code to do that is pretty trivial[0][1]. That's what I do already, sorry for the misunderstanding. should gdk-pixbuf be split from gtk+ so that you don't need to build the latter to get the former installed? it can be a solution. a different packaging would also solve the issue - it's not like you need gdk-pixbuf from trunk: the API does not change, and the bug fixing is pretty spread out being an old library. This might be a good idea, but unfortunately both solutions are out of scope here. :wq buz -- USER ERROR: replace user and press any key to continue. GnuPG Fingerprint: 2FFF FC48 C7DF 1EA0 00A0 FD53 8C35 FD2E 6908 7B82 signature.asc Description: Digital signature
Re: [clutter] pyclutter: Texture from pixbuf
On Tue, 2008-10-14 at 11:36 +0300, Tero Saarni wrote: How can I create Texture from pixbuf on clutter 0.8.2 + pyclutter bindings from SVN? the ChangeLog has all the details, but in short: tex = clutter.Texture(filename=redhand.png) if you need to just load files, ClutterTexture already does that without exposing the GdkPixbuf API. Texture(filename=redhand.png) works but I have the image as pixbuf originally. don't. if you really need, use the set_from_rgb_data() method with the various values from GdkPixbuf: there's a direct mapping from what's required from ClutterTexture (width, height, rowstride, alpha channel and pixel data) to what GdkPixbuf provides. ciao, Emmanuele. -- Emmanuele Bassi, Intel Open Source Technology Center -- Emmanuele Bassi, Intel Open Source Technology Center -- To unsubscribe send a mail to [EMAIL PROTECTED]
Re: [clutter] pyclutter: Texture from pixbuf
On Tue, Oct 14, 2008 at 04:03:58PM +0100, Emmanuele Bassi wrote: don't. if you really need, use the set_from_rgb_data() method with the various values from GdkPixbuf: there's a direct mapping from what's required from ClutterTexture (width, height, rowstride, alpha channel and pixel data) to what GdkPixbuf provides. The main advantage of using GdkPixbuf for image loading is the PixbufLoader. At least on my system I get some hickups in the clutter mainloop when loading (very large) images with clutter. Would be nice to have this in clutter too :) :wq buz -- Don't trust reality. After all, it's only a collective hunch. GnuPG Fingerprint: 2FFF FC48 C7DF 1EA0 00A0 FD53 8C35 FD2E 6908 7B82 signature.asc Description: Digital signature
Re: [clutter] pyclutter: Texture from pixbuf
On Tue, 2008-10-14 at 18:10 +0200, Bastian Winkler wrote: On Tue, Oct 14, 2008 at 04:03:58PM +0100, Emmanuele Bassi wrote: don't. if you really need, use the set_from_rgb_data() method with the various values from GdkPixbuf: there's a direct mapping from what's required from ClutterTexture (width, height, rowstride, alpha channel and pixel data) to what GdkPixbuf provides. The main advantage of using GdkPixbuf for image loading is the PixbufLoader. At least on my system I get some hickups in the clutter mainloop when loading (very large) images with clutter. Would be nice to have this in clutter too :) I'd really, *really* don't want to have GdkPixbufLoader functionality in Clutter: it would be useless replication. you can already use the loader API by simply including gdk-pixbuf.h and compiling against libgdkpixbuf; the code to do that is pretty trivial[0][1]. should gdk-pixbuf be split from gtk+ so that you don't need to build the latter to get the former installed? it can be a solution. a different packaging would also solve the issue - it's not like you need gdk-pixbuf from trunk: the API does not change, and the bug fixing is pretty spread out being an old library. ciao, Emmanuele. +++ [0] it could actually go inside a Cookbook document. [1] you cannot partially upload a texture while loading, because that would not make sense; to you just need to load asynchronously, attach a callback to the ::size-prepared signal in which you set the size of the ClutterTexture actor you will use to upload the texture, and then call the set_from_rgb_data() method when you have the GdkPixbuf ready. -- Emmanuele Bassi, Intel Open Source Technology Center -- To unsubscribe send a mail to [EMAIL PROTECTED]
Re: [clutter] pyclutter: Texture from pixbuf
hi, you can try this: pb = gdk.pixbuf_new_from_file(redhand.png) if pb.props.has_alpha: bpp = 4 else: bpp = 3 tex = clutter.Texture() tex.set_from_rgb_data( pb.get_pixels(), pb.props.has_alpha, pb.props.width, pb.props.height, pb.props.rowstride, bpp, 0) so long :wq buz On Tue, Oct 14, 2008 at 11:36:14AM +0300, Tero Saarni wrote: Hi, How can I create Texture from pixbuf on clutter 0.8.2 + pyclutter bindings from SVN? Following doesn't seem to work anymore: import clutter from gtk import gdk stage = clutter.Stage() tex = clutter.Texture(gdk.pixbuf_new_from_file(redhand.png)) stage.add(tex) stage.show_all() clutter.main() Texture(filename=redhand.png) works but I have the image as pixbuf originally. -- Tero -- To unsubscribe send a mail to [EMAIL PROTECTED] -- When facts don't fit the theory, change the facts. -- Albert Einstein GnuPG Fingerprint: 2FFF FC48 C7DF 1EA0 00A0 FD53 8C35 FD2E 6908 7B82 signature.asc Description: Digital signature
Re: [clutter] pyclutter: Texture from pixbuf
On Tue, 2008-10-14 at 11:36 +0300, Tero Saarni wrote: How can I create Texture from pixbuf on clutter 0.8.2 + pyclutter bindings from SVN? the ChangeLog has all the details, but in short: tex = clutter.Texture(filename=redhand.png) if you need to just load files, ClutterTexture already does that without exposing the GdkPixbuf API. Texture(filename=redhand.png) works but I have the image as pixbuf originally. don't. if you really need, use the set_from_rgb_data() method with the various values from GdkPixbuf: there's a direct mapping from what's required from ClutterTexture (width, height, rowstride, alpha channel and pixel data) to what GdkPixbuf provides. ciao, Emmanuele. -- Emmanuele Bassi, Intel Open Source Technology Center -- Emmanuele Bassi, Intel Open Source Technology Center -- To unsubscribe send a mail to [EMAIL PROTECTED]