Re: [Gimp-developer] [Patch] Speed up blending code

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

 



Hi,

Daniel Egger <de@xxxxxxxxxx> writes:

>    for (y = PR->y; y < endy; y++)
>      for (x = PR->x; x < endx; x++)
>        {
>          GimpRGB  color;
>
>          gradient_render_pixel (x, y, &color, rbd);
>
>          gradient_dither (dest, dither_rand, color.r);
>          gradient_dither (dest, dither_rand, color.g);
>          gradient_dither (dest, dither_rand, color.b);
>          gradient_dither (dest, dither_rand, color.a);
>        }

Should probably note that

  gradient_dither (dest, rng, value)

expands to 

{
  gdouble ftmp = value * 255.0;
  gint    itmp = ftmp;

  if (g_rand_double (rng) > ftmp - itmp)
    *dest++ = itmp;
  else
    *dest++ = MIN (itmp + 1, 255);
}


Sven

[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