IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30406


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

handle F64 images which were not expected

Location:
tags/ipp-20101215/magic/remove/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-20101215/magic/remove/src

  • tags/ipp-20101215/magic/remove/src/streaksio.c

    r30321 r30406  
    11911191                                weight->data.F32[y][x] = NAN;
    11921192                            }
     1193                        } else if (weightType == PS_TYPE_F64) {
     1194                            double weightVal = weight->data.F64[y][x];
     1195                            if (!isnan(weightVal)) {
     1196                                ++nandWeights;
     1197                                weight->data.F64[y][x] = NAN;
     1198                            }
    11931199                        } else if(weightType == PS_TYPE_S16) {
    11941200                            double weightVal = weight->data.S16[y][x];
  • tags/ipp-20101215/magic/remove/src/streaksremove.c

    r30321 r30406  
    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.