IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27360


Ignore:
Timestamp:
Mar 19, 2010, 2:32:11 PM (16 years ago)
Author:
bills
Message:

handle case of vertical left edge

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/magic/remove/src/diffedpixels.c

    r27348 r27360  
    11#include "streaksremove.h"
    22#include "pmAstrometryWCS.h"
     3
     4#define DEBUG_PRINT 1
    35
    46static void addTouchedPixels(streakFiles *sf, psString fileName);
     
    125127
    126128    // put the corners in the desired order (see comments below)
    127 
    128129    nameCorners(pt);
    129130    psString type;
     
    246247          0--------------
    247248                 A                  right boundary: line 1_2 y < pt2.y
    248                    1                                line 2_3  y >= pt.y
     249                   1                                line 2_3 y >= pt2.y
    249250**************************
    250251
     
    311312        tr = pt[0];
    312313    }
    313     if (tl.y >= tr.y) {
    314         // Type 1 (or 3 which is equivalent)
     314    int type = 0;
     315    int type3 = 0;
     316    if (round(tl.x) == round(bl.x)) {
     317        type3 = 1;
     318        if (tl.y <= tr.y) {
     319            type = 1;
     320        } else {
     321            type = 2;
     322        }
     323    } else if (tl.y >= tr.y) {
     324        type = 1;
     325    } else {
     326        type = 2;
     327    }
     328    if (type == 1) {
    315329        pt[0] = bl;
    316330        pt[1] = br;
     
    361375        streaksExit("", PS_EXIT_PROG_ERROR);
    362376    }
     377
    363378    // pt2 is below or at the same y as pt3
    364     if (pt[2].y > pt[3].y) {
     379    // This can happen with some strange shapes. Accept this with type3
     380    // since our edge conditions are still satisfied
     381    if (!type3 && (pt[2].y > pt[3].y)) {
    365382        fprintf(stderr, "ERROR calculating diff overlap\n");
    366383        fprintf(stderr, "pt[2].y (%f) > pt[3].y (%f)\n", pt[2].y, pt[3].y);
Note: See TracChangeset for help on using the changeset viewer.