----- Forwarded message from Mukund Sivaraman <m...@mukund.org> -----

Date: Thu, 7 Apr 2011 17:42:23 +0530
From: Mukund Sivaraman <m...@mukund.org>
To: shivani maheshwari <shivani.mah...@gmail.com>
Cc: gimp-developer <gimp-developer@lists.xcf.berkeley.edu>
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<n_pixels; 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 -----

Attachment: pgpr0KVc8cfSP.pgp
Description: PGP signature

_______________________________________________
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer

Reply via email to