Changeset 19271 for trunk/psModules/src/imcombine/pmSubtraction.c
- Timestamp:
- Aug 28, 2008, 3:15:07 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/imcombine/pmSubtraction.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/imcombine/pmSubtraction.c
r19170 r19271 369 369 370 370 if (box > 0) { 371 int colMin = region.x0, colMax = region.x1, rowMin = region.y0, rowMax = region.y1; // Bounds 372 371 373 bool threaded = pmSubtractionThreaded(); // Are we running threaded? 372 374 if (threaded) { 373 375 psMutexLock(subMask); 374 376 } 375 psImage *image = psImageSubset(subMask, psRegionSet( region.x0 + xMin, region.x1 + xMax,376 r egion.y0 + yMin, region.y1 + yMax));377 psImage *image = psImageSubset(subMask, psRegionSet(colMin - box, colMax + box, 378 rowMin - box, rowMax + box)); 377 379 if (threaded) { 378 380 psMutexUnlock(subMask); … … 390 392 } 391 393 392 int colMin = region.x0, colMax = region.x1, rowMin = region.y0, rowMax = region.y1; // Bounds393 394 int numBytes = (colMax - colMin) * PSELEMTYPE_SIZEOF(PS_TYPE_MASK); // Number of bytes to copy 395 psAssert(convolved->numCols - 2 * box == colMax - colMin, "Bad number of columns"); 396 psAssert(convolved->numRows - 2 * box == rowMax - rowMin, "Bad number of rows"); 394 397 395 398 // Since we're copying back into the source, we need to lock … … 397 400 psMutexLock(subMask); 398 401 } 399 for (int yTarget = rowMin, ySource = -yMin; yTarget < rowMax; yTarget++, ySource++) {402 for (int yTarget = rowMin, ySource = box; yTarget < rowMax; yTarget++, ySource++) { 400 403 memcpy(&subMask->data.PS_TYPE_MASK_DATA[yTarget][colMin], 401 &convolved->data.PS_TYPE_MASK_DATA[ySource][ -xMin], numBytes);404 &convolved->data.PS_TYPE_MASK_DATA[ySource][box], numBytes); 402 405 } 403 406 if (threaded) {
Note:
See TracChangeset
for help on using the changeset viewer.
