Changeset 7641
- Timestamp:
- Jun 22, 2006, 11:30:47 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/camera/pmFPAMosaic.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPAMosaic.c
r7634 r7641 468 468 int xParity = xFlip->data.U8[i] ? -1 : 1; // Parity difference, in x 469 469 int yParity = yFlip->data.U8[i] ? -1 : 1; // Parity difference, in y 470 int xTargetBase = (x0->data.S32[i] - xMin) / xBinTarget; // The base x position in the target frame 471 int yTargetBase = (y0->data.S32[i] - yMin) / yBinTarget; // The base y position in the target frame 470 472 if (xBinSource->data.S32[i] == xBinTarget && yBinSource->data.S32[i] == yBinTarget && 471 473 xFlip->data.U8[i] == 0 && yFlip->data.U8[i] == 0) { 472 // Let someone else do the hard work ; useful to test psImageOverlaySection if no other reason473 psImageOverlaySection(mosaic, image, x 0->data.S32[i] - xMin, y0->data.S32[i] - yMin, "+");474 // Let someone else do the hard work 475 psImageOverlaySection(mosaic, image, xTargetBase, yTargetBase, "+"); 474 476 } else if (xBinSource->data.S32[i] == xBinTarget && yBinSource->data.S32[i] == yBinTarget) { 475 477 // There's a difference with the parities, but we don't have to worry about binning … … 477 479 #define COPY_WITH_PARITY_DIFFERENCE(TYPE) \ 478 480 case PS_TYPE_##TYPE: { \ 479 int yTargetBase = (y0->data.S32[i] - yMin) / yBinTarget; \480 int xTargetBase = (x0->data.S32[i] - xMin) / xBinTarget; \481 481 for (int y = 0; y < image->numRows; y++) { \ 482 482 int yTarget = yTargetBase + yParity * y; \ … … 501 501 // In case the original image is binned but the mosaic is not, we need to fill in the 502 502 // values in the mosaic. 503 504 505 503 #define FILL_IN(TYPE) \ 506 504 case PS_TYPE_##TYPE: \ 507 505 for (int y = 0; y < image->numRows; y++) { \ 508 float yTargetBase = (y0->data.S32[i] + yParity * yBinSource->data.S32[i] * y - yMin) / \ 509 yBinTarget; \ 506 float yTargetBinBase = yTargetBase + yParity * yBinSource->data.S32[i] * y / yBinTarget; \ 510 507 for (int x = 0; x < image->numCols; x++) { \ 511 float xTargetBase = (x0->data.S32[i] + xParity * xBinSource->data.S32[i] * x - xMin) / \ 512 xBinTarget; \ 508 float xTargetBinBase = xTargetBase + xParity * xBinSource->data.S32[i] * x / xBinTarget; \ 513 509 for (int j = 0; j < yBinSource->data.S32[i]; j++) { \ 514 int yTarget = (int)(yTargetB ase + yParity * (float)j / (float)yBinTarget); \510 int yTarget = (int)(yTargetBinBase + yParity * (float)j / (float)yBinTarget); \ 515 511 for (int k = 0; k < xBinSource->data.S32[i]; k++) { \ 516 int xTarget = (int)(xTargetB ase + xParity * (float)k / (float)xBinTarget); \512 int xTarget = (int)(xTargetBinBase + xParity * (float)k / (float)xBinTarget); \ 517 513 mosaic->data.TYPE[yTarget][xTarget] += image->data.TYPE[y][x]; \ 518 514 } \
Note:
See TracChangeset
for help on using the changeset viewer.
