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

Tiles / Shaped Angular Gradients

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.

3 of 3 messages available
Toggle history

Please log in to manage your subscriptions.

Tiles / Shaped Angular Gradients Christopher Howard 09 Aug 10:32
  Tiles / Shaped Angular Gradients Øyvind Kolås 09 Aug 12:17
   Tiles / Shaped Angular Gradients Bill Skaggs 10 Aug 02:33
Christopher Howard
2012-08-09 10:32:07 UTC (over 12 years ago)

Tiles / Shaped Angular Gradients

Hi. I sent an e-mail recently asking for information about the Gimp algorithm for generating the shaped angular gradients over arbitrary free shapes on the canvas. I did more digging in the source code and discovered the pertinent function in app/gimpdrawable-blend.c:

code: --------
(gdouble x,
gdouble y) {
Tile *tile;
gfloat value;
gint ix = CLAMP (x, 0.0, distR.w - 0.7); gint iy = CLAMP (y, 0.0, distR.h - 0.7);

tile = tile_manager_get_tile (distR.tiles, ix, iy, TRUE, FALSE);

value = 1.0 - *((gfloat *) tile_data_pointer (tile, ix, iy));

tile_release (tile, FALSE);

return value; }
--------

However, this is rather obscure to me because it depends on a global PixelRegion data structure and "Tiles" for that structure being calculated before hand. Is there some one who could give me any helpful words of insight on this subject?

I am rather curious, imagining that if I where to write a function for calculating the value of any pixel in a shaped angular gradient in an arbitrary enclosed path, it would have something to do with finding the closest points in the enclosing path and actually calculating angles. But so far I haven't found anything like that in the Gimp code.

frigidcode.com
indicium.us
Øyvind Kolås
2012-08-09 12:17:53 UTC (over 12 years ago)

Tiles / Shaped Angular Gradients

On Thu, Aug 9, 2012 at 12:32 PM, Christopher Howard wrote:

PixelRegion data structure and "Tiles" for that structure being calculated before hand. Is there some one who could give me any helpful words of insight on this subject?

It sounds like there is a full "grayscale" pixel buffer with a (probably normalized) distance to the border stored for each pixel.

/ --
http://pippin.gimp.org/

gimp-developer-list mailing list
gimp-developer-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gimp-developer-list
Bill Skaggs
2012-08-10 02:33:53 UTC (over 12 years ago)

Tiles / Shaped Angular Gradients

I don't think that's the code that does the work. I believe the actual functional code is in app/paint-funcs/paint-funcs.c, in the function called shapeburst_region(). Good luck understanding it.

-- Bill