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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



----- Forwarded message from Mukund Sivaraman <muks@xxxxxxxxxx> -----

Date: Thu, 7 Apr 2011 17:42:23 +0530
From: Mukund Sivaraman <muks@xxxxxxxxxx>
To: shivani maheshwari <shivani.mah.91@xxxxxxxxx>
Cc: gimp-developer <gimp-developer@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re:  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: pgpYmFhHSdWv6.pgp
Description: PGP signature

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

[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux