IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 15, 2007, 4:23:37 PM (19 years ago)
Author:
Paul Price
Message:

Adding function to get the kernel type from a string.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/imcombine/pmSubtractionKernels.c

    r14476 r14521  
    44
    55#include <stdio.h>
     6#include <string.h>
    67#include <pslib.h>
    78
     
    628629    }
    629630}
     631
     632
     633pmSubtractionKernelsType pmSubtractionKernelsTypeFromString(const char *type)
     634{
     635    if (strcasecmp(type, "POIS") == 0) {
     636        return PM_SUBTRACTION_KERNEL_POIS;
     637    }
     638    if (strcasecmp(type, "ISIS") == 0) {
     639        return PM_SUBTRACTION_KERNEL_ISIS;
     640    }
     641    if (strcasecmp(type, "SPAM") == 0) {
     642        return PM_SUBTRACTION_KERNEL_SPAM;
     643    }
     644    if (strcasecmp(type, "FRIES") == 0) {
     645        return PM_SUBTRACTION_KERNEL_FRIES;
     646    }
     647    if (strcasecmp(type, "GUNK") == 0) {
     648        return PM_SUBTRACTION_KERNEL_GUNK;
     649    }
     650    if (strcasecmp(type, "RINGS") == 0) {
     651        return PM_SUBTRACTION_KERNEL_RINGS;
     652    }
     653
     654    psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Unrecognised kernel type: %s", type);
     655    return PM_SUBTRACTION_KERNEL_NONE;
     656}
Note: See TracChangeset for help on using the changeset viewer.