Changeset 7278 for trunk/psModules/src/camera/pmFPACopy.c
- Timestamp:
- Jun 1, 2006, 2:55:23 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/camera/pmFPACopy.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPACopy.c
r7168 r7278 24 24 ) 25 25 { 26 assert(source); 27 26 28 psImage *copy = psMemIncrRefCounter(source); 27 29 bool copied = false; // Have the pixels been copied? … … 51 53 ) 52 54 { 55 assert(region); 56 assert(xBin > 0); 57 assert(yBin > 0); 58 53 59 // Want to include the lower bound: 1 binned by 4 --> 0; 3 binned by 4 --> 0; 4 binned by 4 --> 1 54 60 region->x0 = (int)(region->x0 / xBin); … … 62 68 ) 63 69 { 70 assert(cell); 71 64 72 if (cell->hdu && cell->hdu->phu) { 65 73 return cell->hdu; … … 274 282 assert(target); 275 283 assert(source); 284 assert(xBin > 0); 285 assert(yBin > 0); 276 286 277 287 psArray *targetCells = target->cells; // The target cells … … 300 310 } 301 311 302 static intfpaCopy(pmFPA *target, // The target FPA303 pmFPA *source, // The source FPA, to be copied304 bool pixels, // Copy the pixels?305 int xBin, int yBin // (Relative) binning factors in x and y306 )312 static bool fpaCopy(pmFPA *target, // The target FPA 313 pmFPA *source, // The source FPA, to be copied 314 bool pixels, // Copy the pixels? 315 int xBin, int yBin // (Relative) binning factors in x and y 316 ) 307 317 { 308 318 assert(target); 309 319 assert(source); 320 assert(xBin > 0); 321 assert(yBin > 0); 310 322 311 323 psArray *targetChips = target->chips; // The target chips … … 338 350 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// 339 351 340 int pmFPACopy(pmFPA *target, // The target FPA 341 pmFPA *source // The source FPA, to be copied 342 ) 343 { 352 bool pmFPACopy(pmFPA *target, // The target FPA 353 pmFPA *source // The source FPA, to be copied 354 ) 355 { 356 PS_ASSERT_PTR_NON_NULL(target, false); 357 PS_ASSERT_PTR_NON_NULL(source, false); 344 358 return fpaCopy(target, source, true, 1, 1); 345 359 } 346 360 347 int pmChipCopy(pmChip *target, // The target chip 348 pmChip *source // The source chip, to be copied 349 ) 350 { 361 bool pmChipCopy(pmChip *target, // The target chip 362 pmChip *source // The source chip, to be copied 363 ) 364 { 365 PS_ASSERT_PTR_NON_NULL(target, false); 366 PS_ASSERT_PTR_NON_NULL(source, false); 351 367 return chipCopy(target, source, true, 1, 1); 352 368 } 353 369 354 int pmCellCopy(pmCell *target, // The target cell 355 pmCell *source // The source cell, to be copied 356 ) 357 { 370 bool pmCellCopy(pmCell *target, // The target cell 371 pmCell *source // The source cell, to be copied 372 ) 373 { 374 PS_ASSERT_PTR_NON_NULL(target, false); 375 PS_ASSERT_PTR_NON_NULL(source, false); 358 376 return cellCopy(target, source, true, 1, 1); 359 377 } 360 378 361 379 362 int pmFPACopyStructure(pmFPA *target, // The target FPA 363 pmFPA *source, // The source FPA, to be copied 364 int xBin, int yBin // Binning factors in x and y 365 ) 366 { 367 return fpaCopy(target, source, false, xBin, yBin); 368 } 369 370 int pmChipCopyStructure(pmChip *target, // The target chip 371 pmChip *source, // The source chip, to be copied 380 bool pmFPACopyStructure(pmFPA *target, // The target FPA 381 pmFPA *source, // The source FPA, to be copied 372 382 int xBin, int yBin // Binning factors in x and y 373 383 ) 374 384 { 385 PS_ASSERT_PTR_NON_NULL(target, false); 386 PS_ASSERT_PTR_NON_NULL(source, false); 387 PS_ASSERT_INT_POSITIVE(xBin, false); 388 PS_ASSERT_INT_POSITIVE(yBin, false); 389 return fpaCopy(target, source, false, xBin, yBin); 390 } 391 392 bool pmChipCopyStructure(pmChip *target, // The target chip 393 pmChip *source, // The source chip, to be copied 394 int xBin, int yBin // Binning factors in x and y 395 ) 396 { 397 PS_ASSERT_PTR_NON_NULL(target, false); 398 PS_ASSERT_PTR_NON_NULL(source, false); 399 PS_ASSERT_INT_POSITIVE(xBin, false); 400 PS_ASSERT_INT_POSITIVE(yBin, false); 375 401 return chipCopy(target, source, false, xBin, yBin); 376 402 } 377 403 378 int pmCellCopyStructure(pmCell *target, // The target cell 379 pmCell *source, // The source cell, to be copied 380 int xBin, int yBin // Binning factors in x and y 381 ) 382 { 404 bool pmCellCopyStructure(pmCell *target, // The target cell 405 pmCell *source, // The source cell, to be copied 406 int xBin, int yBin // Binning factors in x and y 407 ) 408 { 409 PS_ASSERT_PTR_NON_NULL(target, false); 410 PS_ASSERT_PTR_NON_NULL(source, false); 411 PS_ASSERT_INT_POSITIVE(xBin, false); 412 PS_ASSERT_INT_POSITIVE(yBin, false); 383 413 return cellCopy(target, source, false, xBin, yBin); 384 414 }
Note:
See TracChangeset
for help on using the changeset viewer.
