I am trying to understand the siox-tool code. While looking at the code, I 
discovered the following:

static inline void threshold_mask (TileManager *mask, gint x, gint y, gint 
width, gint height)
  PixelRegion region;
  gpointer    pr;
  gint        row, col;

  pixel_region_init (&region, mask, x, y, width, height, TRUE);

  for (pr = pixel_regions_register (1, &region);
       pr != NULL; pr = pixel_regions_process (pr))
        Iterate over all pixels in the region and do something...

Can someone explain to me why the code iterates over all pixels in a region 
and then over all regions and not just over all pixels in a layer? What are 
PixelRegions actually, what are they used for and why they are needed here? 
(I had a look at http://developer.gimp.org/api/2.0/app/app-pixel-region.html 
but this doesn't explain what they are for)

Thank you very much in advance,
Gimp-developer mailing list

Reply via email to