Re: [Gimp-developer] Using drawables with preview
[EMAIL PROTECTED] wrote: :On Sun, 2006-12-03 at 14:52 -0800, [EMAIL PROTECTED] wrote: : : What I'm writing is straightforward- it's a linear (i.e. one-dimensional) unsharp :mask. (I'm probably not the first to do this, but it's a good learning opportunity, :and it confirmed my hunch that it would work better against motion blur than the :standard version). The line is supposed to illustrate the angle and size of the :convolution. : :In that case you probably want to draw on the preview window without :fiddling with the buffers that the preview widget uses. Just connect :after the expose-event handler and use GDK or Cairo drawing API to draw :on the preview area. That's great, thanks (also to David Gowers for his response too). I'm still a relative novice with GTK- I learned what little I know in order to write this filter's dialog box- but I'll be taking a look at that. In the meantime, I've uploaded the linear unsharp mask filter code (first version) and some example images here:- http://home.freeuk.com/misacham/temp/mask.htm (Note (a) the images are fairly large and (b) Yes, I know the filter code is slow and could probably be *much* faster; one thing at a time). Like I said, I'd be very surprised if I was the first to think of this, but I wanted to play around with the idea on my own anyway. It's hardly a miracle cure for motion blur, but the results were pretty good; it certainly beats two-dimensional USM for that purpose. - [EMAIL PROTECTED] _ Get your FREE OiNK-Mail --- http://www.oink.co.uk Adopt an animal today and help support wildlife conservation --- http://www.adoption.co.uk The Rainforests. Home to half of all living species. Don't let them disappear. --- http://www.adoption.co.uk/rainforest ___ Gimp-developer mailing list Gimp-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
Re: [Gimp-developer] Using drawables with preview
Hi, On Sun, 2006-12-03 at 14:52 -0800, [EMAIL PROTECTED] wrote: What I'm writing is straightforward- it's a linear (i.e. one-dimensional) unsharp mask. (I'm probably not the first to do this, but it's a good learning opportunity, and it confirmed my hunch that it would work better against motion blur than the standard version). The line is supposed to illustrate the angle and size of the convolution. In that case you probably want to draw on the preview window without fiddling with the buffers that the preview widget uses. Just connect after the expose-event handler and use GDK or Cairo drawing API to draw on the preview area. Sven ___ Gimp-developer mailing list Gimp-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
Re: [Gimp-developer] Using drawables with preview
Hi, On Sun, 2006-12-03 at 12:05 -0800, [EMAIL PROTECTED] wrote: However, I want to annotate the PREVIEW (*without* modifying the original image's drawable) using gimp_pencil(). That requires a GimpDrawable, but rgn_out- i.e. the processed pixels which are used to create the preview's contents- is in GimpPixelRgn format. How do I draw on the output window? It would help a lot if you could simply tell us what you actually want to achieve before going into implementation details. I have the feeling that all you want to do is to draw something on the preview window. If that is true, then you definitely don't want to use gimp_pencil() or similar functions. Sven ___ Gimp-developer mailing list Gimp-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
Re: [Gimp-developer] Using drawables with preview
[EMAIL PROTECTED] wrote: :On Sun, 2006-12-03 at 12:05 -0800, [EMAIL PROTECTED] wrote: : However, I want to annotate the PREVIEW (*without* modifying the : original image's drawable) using gimp_pencil(). That requires a : GimpDrawable, but rgn_out- i.e. the processed pixels which are used to : create the preview's contents- is in GimpPixelRgn format. How do I draw : on the output window? : :It would help a lot if you could simply tell us what you actually want :to achieve before going into implementation details. I have the feeling :that all you want to do is to draw something on the preview window. That's exactly right; I realise that my original question got bogged down with specifics- sorry. Put simply, I want to use the high-level Drawable functions to draw a line or arrow on the preview window. The tutorial example only uses the pixel-level functions. It's not clear how- or if- I can use (e.g.) gimp_pencil() and friends. :If that is true, then you definitely don't want to use :gimp_pencil() or similar functions. Umm... that's *exactly* what I wanted to do. But from your reply I guess that (a) it's not possible, or (b) it's a bad idea...? - [EMAIL PROTECTED] _ Get your FREE OiNK-Mail --- http://www.oink.co.uk Adopt an animal today and help support wildlife conservation --- http://www.adoption.co.uk The Rainforests. Home to half of all living species. Don't let them disappear. --- http://www.adoption.co.uk/rainforest ___ Gimp-developer mailing list Gimp-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
Re: [Gimp-developer] Using drawables with preview
Hi, On Sun, 2006-12-03 at 13:28 -0800, [EMAIL PROTECTED] wrote: That's exactly right; I realise that my original question got bogged down with specifics- sorry. Put simply, I want to use the high-level Drawable functions to draw a line or arrow on the preview window. The tutorial example only uses the pixel-level functions. It's not clear how- or if- I can use (e.g.) gimp_pencil() and friends. :If that is true, then you definitely don't want to use :gimp_pencil() or similar functions. Umm... that's *exactly* what I wanted to do. But from your reply I guess that (a) it's not possible, or (b) it's a bad idea...? Anything is possible and there are often multiple ways to achieve one's aim. That's also the case here. But unless you give us some details about the plug-in you are writing, I can't tell which way would be best in your case. And I am not going to waste my time explaining all of them. Sven ___ Gimp-developer mailing list Gimp-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
Re: [Gimp-developer] Using drawables with preview
[EMAIL PROTECTED] wrote: : :If that is true, then you definitely don't want to use : :gimp_pencil() or similar functions. : : Umm... that's *exactly* what I wanted to do. : But from your reply I guess that (a) it's not possible, or (b) it's a bad idea...? : :Anything is possible and there are often multiple ways to achieve one's :aim. That's also the case here. But unless you give us some details :about the plug-in you are writing, I can't tell which way would be best :in your case. And I am not going to waste my time explaining all of :them. What I'm writing is straightforward- it's a linear (i.e. one-dimensional) unsharp mask. (I'm probably not the first to do this, but it's a good learning opportunity, and it confirmed my hunch that it would work better against motion blur than the standard version). The line is supposed to illustrate the angle and size of the convolution. I didn't give any specific details, nor post my code, because I assumed that- once explained- the problem would be a general one with a straightforward answer. At the time, I thought it was easier to use the standard example, which was cleaner and simpler than my code but still illustrated the point. I apologise if it sounds like I'm making a big deal of this, or that it's a major hurdle; it's not. For a one-off, it would probably be simple to write a crude pixel-based line function myself. But it would be silly to keep doing this every time *if* there was already a simple way of using the existing facilities. Anyway, I'll tidy up my code and post relevant parts here soon. In the meantime, thank you for your help. - [EMAIL PROTECTED] _ Get your FREE OiNK-Mail --- http://www.oink.co.uk Adopt an animal today and help support wildlife conservation --- http://www.adoption.co.uk The Rainforests. Home to half of all living species. Don't let them disappear. --- http://www.adoption.co.uk/rainforest ___ Gimp-developer mailing list Gimp-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
Re: [Gimp-developer] Using drawables with preview
On 12/4/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I didn't give any specific details, nor post my code, because I assumed that- once explained- the problem would be a general one with a straightforward answer. At the time, I thought it was easier to use the standard example, which was cleaner and simpler than my code but still illustrated the point. I apologise if it sounds like I'm making a big deal of this, or that it's a major hurdle; it's not. For a one-off, it would probably be simple to write a crude pixel-based line function myself. But it would be silly to keep doing this every time *if* there was already a simple way of using the existing facilities. Anyway, I'll tidy up my code and post relevant parts here soon. In the meantime, thank you for your help. - [EMAIL PROTECTED] gdk has line drawing functions which I assume are appropriate. ___ Gimp-developer mailing list Gimp-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer