Run Rev's within() function--Was: Problem with mask

Wilhelm Sanke sanke at hrz.uni-kassel.de
Sun Oct 26 12:57:20 EDT 2008


James Hurley wrote on Sat Oct 25, 2008:

> Wilhelm,
>
> I think the following script, placed in the card of a new stack,  
> gives the clearest idea of what the problem is. As you mouse around   
> the graphic you can see the mouse corrdinates as well as the results  
> of the user-defined within function and Run Rev's within() function.
>
> You can easily see precisely how the Run Rev within() function works.  
> It definitely excludes the right and bottom edges of a square, but  
> includes the top and left edges. Whatever happens when using the  
> within() funciton to construct a mask (or for whatever purpose) has  
> to be reconciled to these basic results.
>
> Jim Hurley


Jim,

I see your results demonstrating the difference between the two within 
functions. The question is, *how* can we use these insights to avoid the 
edges? Although I have tried all sorts of things (as using "0 to 
theight-1" instead of " 1 to theight" etc. or setting absolute points in 
the mask as opposed to "put after") I have nothing to offer here apart 
from workarounds.

If you really "flip" the created mask (the mask itself cannot of course  
be flipped like an image, you have to script this) you get the edges on 
the opposite side, again meaning, that it is not the application of the 
mask to the cropped image that causes the edges, but the edges are 
already part of the mask.

As a variation of my workaround with "double masks" I have now used a 
somewhat faster approach, in putting only a few lines from the top and 
the left into the opposite side, which is possible because the mask 
basically is symmetrical.--

I am out of home and office hiding in a secluded place for a few days 
until the presidential elections in the U.S. I will monitor the 
communication on this list with my cellphone  (not an iPhone), but I 
have to climb the dunes to get connected.

Best regards,

Wilhelm Sanke






More information about the use-livecode mailing list