IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30405


Ignore:
Timestamp:
Jan 28, 2011, 12:05:15 PM (15 years ago)
Author:
bills
Message:

raise an error if we get a F64 image but handle it if we get F64 weight image
(which have been seen)

File:
1 edited

Legend:

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

    r30315 r30405  
    771771            }
    772772        }
    773     } else {
     773    } else if (sfiles->inImage->image->type.type == PS_TYPE_F32) {
    774774        float imageValue  = sfiles->inImage->image->data.F32[y][x];
    775775        if (sfiles->recImage && !isExciseValue(imageValue, sfiles->inImage->exciseValue) ) {
     
    787787            }
    788788        }
     789    } else {
     790        // We could handle F64 but I don't think we ever get them.
     791        // Should catch this earlier
     792        psError(PS_ERR_IO, true, "unexpected image type %x found", sfiles->inImage->image->type.type );
     793        streaksExit("", PS_EXIT_PROG_ERROR);
    789794    }
    790795
    791796    if (sfiles->outWeight) {
    792         if (sfiles->recWeight) {
    793             sfiles->recWeight->image->data.F32[y][x] = sfiles->inWeight->image->data.F32[y][x];
    794         }
    795797        // Assume that weight images are always a floating point type
    796         sfiles->outWeight->image->data.F32[y][x] = NAN;
     798        if (sfiles->inWeight->image->type.type == PS_TYPE_F32) {
     799            if (sfiles->recWeight) {
     800                sfiles->recWeight->image->data.F32[y][x] = sfiles->inWeight->image->data.F32[y][x];
     801            }
     802            sfiles->outWeight->image->data.F32[y][x] = NAN;
     803        } else if (sfiles->inWeight->image->type.type == PS_TYPE_F64) {
     804            if (sfiles->recWeight) {
     805                sfiles->recWeight->image->data.F64[y][x] = sfiles->inWeight->image->data.F64[y][x];
     806            }
     807            sfiles->outWeight->image->data.F64[y][x] = NAN;
     808        } else {
     809            // Should catch this earlier
     810            psError(PS_ERR_IO, true, "unexpected weight image type %x found", sfiles->inWeight->image->type.type );
     811            streaksExit("", PS_EXIT_PROG_ERROR);
     812        }
    797813    }
    798814    if (sfiles->outMask) {
Note: See TracChangeset for help on using the changeset viewer.