IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 9, 2006, 6:01:43 PM (20 years ago)
Author:
magnier
Message:

two changes to the behavior of psRegionFromString:
1) [0:0,0:0] returns the region (0,0,0,0), despite minor inconsistency

with the IRAF convention

2) col1,row1 <= 0 are allowed and returned intact (to result in meaning

of 'xxx from upper end of region'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/math/psRegion.c

    r7380 r7496  
    5151    }
    5252
    53     if (col0 > col1 || row0 > row1) {
     53    // [0:0,0:0] is complete image region
     54    if ((col0 == 0) && (col1 == 0) && (row0 == 0) && (row1 == 0)) {
     55        return psRegionSet(0,0,0,0);
     56    }
     57
     58    if ((col1 > 0) && (col0 > col1)) {
     59        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     60                PS_ERRORTEXT_psImage_SUBSET_RANGE_MALFORMED,
     61                col0,col1,row0,row1);
     62        return psRegionSet(NAN,NAN,NAN,NAN);
     63    }
     64
     65    if ((row1 > 0) && (row0 > row1)) {
    5466        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    5567                PS_ERRORTEXT_psImage_SUBSET_RANGE_MALFORMED,
Note: See TracChangeset for help on using the changeset viewer.