Changeset 28346 for trunk/ppArith
- Timestamp:
- Jun 15, 2010, 4:26:53 PM (16 years ago)
- Location:
- trunk/ppArith/src
- Files:
-
- 4 edited
-
ppArith.h (modified) (1 diff)
-
ppArithArguments.c (modified) (4 diffs)
-
ppArithLoop.c (modified) (2 diffs)
-
ppArithReadout.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppArith/src/ppArith.h
r23195 r28346 44 44 const pmReadout *input1, ///< Input readout 45 45 const pmReadout *input2, ///< Input readout 46 float const2, ///< Constant to apply 46 47 const pmConfig *config, ///< Configuration 47 48 const pmFPAview *view ///< View of readout on which to operate -
trunk/ppArith/src/ppArithArguments.c
r21378 r28346 51 51 ) 52 52 { 53 psString value = psMetadataLookupStr(NULL, arguments, argName); // Value of interest 53 psString value = psMetadataLookupStr(NULL, arguments, argName); // Value of interest 54 54 if (value && strlen(value) > 0) { 55 55 return psMetadataAddStr(target, PS_LIST_TAIL, mdName, 0, NULL, value); … … 82 82 psMetadataAddStr(arguments, PS_LIST_TAIL, "-op", 0, "Operation to perform", NULL); 83 83 psMetadataAddStr(arguments, PS_LIST_TAIL, "-file2", 0, "Second image", NULL); 84 psMetadataAddF32(arguments, PS_LIST_TAIL, "-const2", 0, "Constant", NAN); 84 85 psMetadataAddBool(arguments, PS_LIST_TAIL, "-mask", 0, "Treat images as masks", false); 85 86 psMetadataAddStr(arguments, PS_LIST_TAIL, "-stats", 0, "Statistics file", NULL); … … 98 99 "File rule for output", outFilerule); 99 100 100 bool status = false; // Status for file definition 101 bool status = false; // Status for file definition 101 102 102 103 // First file … … 135 136 } 136 137 } 138 float const2 = psMetadataLookupF32(NULL, arguments, "-const2"); // Constant to apply 139 if (!isnan(const2)) { 140 if (name2) { 141 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Cannot specify both -file2 and -const2"); 142 goto ERROR; 143 } 144 psMetadataAddF32(config->arguments, PS_LIST_TAIL, "PPARITH.CONST", 0, "Constant to apply", const2); 145 } 137 146 138 147 // Output image -
trunk/ppArith/src/ppArithLoop.c
r26903 r28346 62 62 } 63 63 psFree(iter); 64 65 float const2 = psMetadataLookupF32(&mdok, config->arguments, "PPARITH.CONST"); 64 66 65 67 pmFPAview *view = pmFPAviewAlloc(0); // Pointer into FPA hierarchy … … 138 140 139 141 // Perform the analysis 140 if (!ppArithReadout(outRO, inRO1, inRO2, con fig, view)) {142 if (!ppArithReadout(outRO, inRO1, inRO2, const2, config, view)) { 141 143 psError(PS_ERR_UNKNOWN, false, "Unable to perform arithmetic.\n"); 142 144 return false; -
trunk/ppArith/src/ppArithReadout.c
r21378 r28346 21 21 #include "ppArith.h" 22 22 23 bool ppArithReadout(pmReadout *output, const pmReadout *input1, const pmReadout *input2, 23 bool ppArithReadout(pmReadout *output, const pmReadout *input1, const pmReadout *input2, float const2, 24 24 const pmConfig *config, const pmFPAview *view) 25 25 { … … 77 77 if (input2) { 78 78 psBinaryOp(outImage, inImage1, op, inImage2); 79 } else if (!isnan(const2)) { 80 psBinaryOp(outImage, inImage1, op, psScalarAlloc(const2, inImage1->type.type)); 79 81 } else { 80 82 psUnaryOp(outImage, inImage1, op);
Note:
See TracChangeset
for help on using the changeset viewer.
