Re: Detecting "closure" of selection

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

 



Thinking off the top of my head, you could make a histogram call to
the selection "channel" at 255 (fully selected) and see if the
returned pixel count equals the number of pixels (width x height).



On 10/9/10, Ofnuts <ofnuts@xxxxxxxxxxx> wrote:
>   On 10/10/2010 00:22, David Gowers (kampu) wrote:
>> On Sun, Oct 10, 2010 at 7:47 AM, Ofnuts<ofnuts@xxxxxxxxxxx>  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
>>
>
> There are indeed many tools that behave the same way if the selection is
> empty of complete, but gimp_selection_is_empty
> <http://developer.gimp.org/api/2.0/libgimp/libgimp-gimpselection.html#gimp-selection-is-empty>()
> return False when the selection is complete, alas.
>
>
> --
> Bertrand
>
>
_______________________________________________
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