Changeset 7382 for trunk/psModules/src/camera/pmFPACopy.c
- Timestamp:
- Jun 6, 2006, 5:27:52 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/camera/pmFPACopy.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPACopy.c
r7278 r7382 2 2 #include <assert.h> 3 3 4 #include "pslib.h" 5 #include "psImageFlip.h" 6 #include "psRegionIsBad.h" 4 #include <pslib.h> 7 5 8 6 #include "pmFPA.h" … … 17 15 // File-static functions 18 16 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// 19 20 // Copy pixels from a target image to a source image, with flips21 static psImage *copyPixels(psImage *source, // Source image (from source cell)22 bool xFlip, // Flip in x?23 bool yFlip // Flip in y?24 )25 {26 assert(source);27 28 psImage *copy = psMemIncrRefCounter(source);29 bool copied = false; // Have the pixels been copied?30 if (xFlip) {31 psImage *temp = psImageFlipX(copy); // Flipped version32 psFree(copy);33 copy = temp;34 copied = true;35 }36 if (yFlip) {37 psImage *temp = psImageFlipY(copy); // Flipped version38 psFree(copy);39 copy = temp;40 copied = true;41 }42 if (!copied) {43 psFree(copy);44 copy = psImageCopy(NULL, source, source->type.type);45 }46 47 return copy;48 }49 17 50 18 // Bin a region down by specified factors in x and y … … 154 122 psFree(targetReadout->image); 155 123 } 156 targetReadout->image = copyPixels(sourceReadout->image, xFlip, yFlip);124 targetReadout->image = psImageFlip(NULL, sourceReadout->image, xFlip, yFlip); 157 125 } 158 126 … … 162 130 psFree(targetReadout->mask); 163 131 } 164 targetReadout->mask = copyPixels(sourceReadout->mask, xFlip, yFlip);132 targetReadout->mask = psImageFlip(NULL, sourceReadout->mask, xFlip, yFlip); 165 133 } 166 134 … … 170 138 psFree(targetReadout->weight); 171 139 } 172 targetReadout->weight = copyPixels(sourceReadout->weight, xFlip, yFlip);140 targetReadout->weight = psImageFlip(NULL, sourceReadout->weight, xFlip, yFlip); 173 141 } 174 142 … … 181 149 psImage *bias = NULL; // Bias image from iteration 182 150 while ((bias = psListGetAndIncrement(biasIter))) { 183 psImage *biasCopy = copyPixels(bias, xFlip, yFlip);151 psImage *biasCopy = psImageFlip(NULL, bias, xFlip, yFlip); 184 152 psListAdd(targetReadout->bias, PS_LIST_TAIL, biasCopy); 185 153 psFree(biasCopy); // Drop reference … … 209 177 if (xBin != 1 || yBin != 1) { 210 178 psRegion *trimsec = psMetadataLookupPtr(&mdok, target->concepts, "CELL.TRIMSEC"); // The trim section 211 if (mdok && trimsec && !psRegionIs Bad(*trimsec)) {179 if (mdok && trimsec && !psRegionIsNaN(*trimsec)) { 212 180 binRegion(trimsec, xBin, yBin); 213 181 } … … 217 185 psRegion *biassec = NULL; // Bias section, from iteration 218 186 while ((biassec = psListGetAndIncrement(biassecsIter))) { 219 if (!psRegionIs Bad(*biassec)) {187 if (!psRegionIsNaN(*biassec)) { 220 188 binRegion(biassec, xBin, yBin); 221 189 }
Note:
See TracChangeset
for help on using the changeset viewer.
