[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 -----