Re: ossimDrect::clipToRect() bug for left handed rects

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: ossimDrect::clipToRect() bug for left handed rects

David Burken
Will check it out and put in.  We're going to re-write all the rectangle
stuff to be point, size and templated in 2.0.

I have your other patch also and will try to make time to put both in
soon...

Take care,
Dave

On 01/14/2015 09:30 PM, Bryan Bagnall wrote:

> ossimDrect::clipToRect doesn't seem to be working correctly for left
> handed rects. I think the same logic that is used for
> ossimIrect::clipToRect should be used. I swapped out the logic in
> Drect for the logic in Irect and it seems to be working. See attached
> for changes. I also made the if/else symmetric (DeMorgan's law was
> applied on one, but not the other previously)
>
>
> //---IRECTS---//
> //left handed irects
> ossimIrect a(0, 0, 10, 10);
> ossimIrect b(1, 1, 9, 9);
>
> ossimIrect result0 = a.clipToRect(b); //good .. ul=(1,1), ur=(9,1),
> lr=(9,9), ll=(1,9)
>
> //right handed irects
> ossimIrect d(0,10, 10,0,OSSIM_RIGHT_HANDED);
> ossimIrect e(-5,8,14,1,OSSIM_RIGHT_HANDED);
>
> ossimIrect result4 = d.clipToRect(e); //good ... ul=(0,8), ur=(10,8),
> lr=(10,1), ll=(0,1)
>
> //--- DRECTS - BEFORE CHANGE (after change the results are identical
> to irect) ---//
> //left handed drects
> ossimDrect a(0, 0, 10, 10);
> ossimDrect b(1, 1, 9, 9);
> ossimDrect result0 = a.clipToRect(b); // BAD - NAN  should be a good
> rect like in irect
>
> //right handed drects
> ossimDrect d(0,10, 10,0,OSSIM_RIGHT_HANDED);
> ossimDrect e(-5,8,14,1,OSSIM_RIGHT_HANDED);
> ossimDrect result4 = d.clipToRect(e); //good ... ul=(0,8), ur=(10,8),
> lr=(10,1), ll=(0,1)
>
>


------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer