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

Detecting "closure" of selection

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.

4 of 4 messages available
Toggle history

Please log in to manage your subscriptions.

Detecting "closure" of selection Ofnuts 09 Oct 21:17
  Detecting "closure" of selection Owen 09 Oct 21:24
  Detecting "closure" of selection David Gowers (kampu) 09 Oct 22:22
  Detecting "closure" of selection saulgoode@flashingtwelve.brickfilms.com 10 Oct 02:01
Ofnuts
2010-10-09 21:17:03 UTC (about 14 years ago)

Detecting "closure" of selection

Assume I have a selection on small area (for instance a 20px circle), and I invert it. Now, if I grow the selection by a sufficient amount (10px in this case), everything gets selected.

Is there a practical, fast way, to detect this case, i.e, that the selection covers the whole layer (or image?) and that no pixels remain unselected? I assume that inverting the selection again and testing for empty would work, but that would be two selection inversions in the normal case and that may be a bit costly.

Owen
2010-10-09 21:24:46 UTC (about 14 years ago)

Detecting "closure" of selection

Assume I have a selection on small area (for instance a 20px circle),
and I invert it. Now, if I grow the selection by a sufficient amount (10px in this case), everything gets selected.

Is there a practical, fast way, to detect this case, i.e, that the selection covers the whole layer (or image?) and that no pixels remain unselected? I assume that inverting the selection again and testing for
empty would work, but that would be two selection inversions in the normal case and that may be a bit costly.

Select->all?

David Gowers (kampu)
2010-10-09 22:22:07 UTC (about 14 years ago)

Detecting "closure" of selection

On Sun, Oct 10, 2010 at 7:47 AM, Ofnuts wrote:

?Assume I have a selection on small area (for instance a 20px circle), and I invert it. Now, if I grow the selection by a sufficient amount (10px in this case), everything gets selected.

Is there a practical, fast way, to detect this case, i.e, that the selection covers the whole layer (or image?) and that no pixels remain unselected? I assume that inverting the selection again and testing for empty would work, but that would be two selection inversions in the normal case and that may be a bit costly.

Testing for empty and for full are the same operation (an empty sel is equivalent to a full one)

HTH

Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
saulgoode@flashingtwelve.brickfilms.com
2010-10-10 02:01:14 UTC (about 14 years ago)

Detecting "closure" of selection

Quoting Ofnuts :

Is there a practical, fast way, to detect this case, i.e, that the selection covers the whole layer (or image?) and that no pixels remain unselected? I assume that inverting the selection again and testing for empty would work, but that would be two selection inversions in the normal case and that may be a bit costly.

The following appears to be about twice as fast as the two inversion approach.

(let ((count (cdddr (gimp-histogram (car (gimp-image-get-selection image)) HISTOGRAM-VALUE 255 255)))) (= (car count) (cadr count)) ; compare num of all pixels to all white pixels )