RSS/Atom feed Twitter
Site is read-only, email is disabled

[muks@mukund.org: Re: Gimp Plugin semi-flatten ported to Gegl op.]

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

2 of 2 messages available
Toggle history

Please log in to manage your subscriptions.

[muks@mukund.org: Re: Gimp Plugin semi-flatten ported to Gegl op.] Mukund Sivaraman 07 Apr 14:27
  [muks@mukund.org: Re: Gimp Plugin semi-flatten ported to Gegl op.] Kevin Cozens 07 Apr 18:26
Mukund Sivaraman
2011-04-07 14:27:57 UTC (over 13 years ago)

[muks@mukund.org: Re: Gimp Plugin semi-flatten ported to Gegl op.]

----- Forwarded message from Mukund Sivaraman -----

Date: Thu, 7 Apr 2011 17:42:23 +0530 From: Mukund Sivaraman
To: shivani maheshwari
Cc: gimp-developer
Subject: Re: [Gimp-developer] Gimp Plugin semi-flatten ported to Gegl op. User-Agent: Mutt/1.5.21 (2010-09-15)

On Thu, Apr 07, 2011 at 05:29:59PM +0530, Mukund Sivaraman wrote:

On Thu, Apr 07, 2011 at 04:42:02PM +0530, shivani maheshwari wrote:

+ for (i=0; i
+ {
+ out_pixel[0] = (in_pixel[0] * in_pixel[3]) / 255 + (in_pixel[0] * (255-in_pixel[3])) / 255;
+ out_pixel[1] = (in_pixel[1] * in_pixel[3]) / 255 + (in_pixel[1] * (255-in_pixel[3])) / 255;
+ out_pixel[2] = (in_pixel[2] * in_pixel[3]) / 255 + (in_pixel[2] * (255-in_pixel[3])) / 255;
+ out_pixel[3] = (in_pixel[3] == 0) ? 0 : inpixel[3]; + in_pixel += 4;
+ out_pixel += 4;
+ }
+ return TRUE;

Did this code work for you? Did it semi-flatten the input?

Here's a tip. Try to understand GEGL's data formats. You can find some information here:

http://gegl.org/babl/

Try to learn the colorspaces and also the ranges of the inputs and outputs.

Most GIMP plug-ins will have to be *rewritten* for GEGL. You can adapt code, but simply copying code without following it will not work.

Mukund

----- End forwarded message -----

Kevin Cozens
2011-04-07 18:26:40 UTC (over 13 years ago)

[muks@mukund.org: Re: Gimp Plugin semi-flatten ported to Gegl op.]

On Thu, Apr 07, 2011 at 04:42:02PM +0530, shivani maheshwari wrote:

+ out_pixel[3] = (in_pixel[3] == 0) ? 0 : inpixel[3];

There is a typo in the variable name at the end of the line. It should read: out_pixel[3] = (in_pixel[3] == 0) ? 0 : in_pixel[3];

Now that I'm looking at this, it looks as if it can be simplified to: out_pixel[3] = in_pixel[3];