Changeset 20807
- Timestamp:
- Nov 20, 2008, 11:12:59 AM (17 years ago)
- Location:
- trunk/magic/remove/src
- Files:
-
- 2 edited
-
streaksremove.c (modified) (6 diffs)
-
streaksremove.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/magic/remove/src/streaksremove.c
r20780 r20807 336 336 sf->tiles->data.S32[2] = 1; 337 337 } 338 339 sf->transparentStreaks = psMetadataLookupF64(&status, config->arguments, "TRANSPARENT_STREAKS"); 338 340 339 341 return sf; … … 495 497 "skip excising of non warped pixels", true); 496 498 } 499 500 if ((argnum = psArgumentGet(argc, argv, "-transparent"))) { 501 if (gotReplace) { 502 psError(PS_ERR_UNKNOWN, true, "cannot make transparent streaks if -replace"); 503 return NULL; 504 } 505 psArgumentRemove(argnum, &argc, argv); 506 double transparentStreaks = atof(argv[argnum]); 507 psMetadataAddF64(config->arguments, PS_LIST_TAIL, "TRANSPARENT_STREAKS", 0, 508 "value to adjust excised pixels", transparentStreaks); 509 psArgumentRemove(argnum, &argc, argv); 510 } 497 511 498 512 // if skycells are not provided then we have to execise all pixels unless -keepnonwarped … … 881 895 setupImageRefs(sFile *out, sFile *recovery, sFile *in, int extnum, bool exciseAll) 882 896 { 883 if (exciseAll) { 897 if (!exciseAll) { 898 // set output image to be the input image 899 out->image = (psImage*) psMemIncrRefCounter(in->image); 900 if (recovery) { 901 // create a recovery image initialized to NAN 902 createNewImage(recovery, in, extnum, NAN); 903 } 904 } else { 905 // Excising all pixels in the input 884 906 // set the output to an image all NANs 885 907 createNewImage(out, in, extnum, NAN); … … 887 909 // save the whole input as the recovery image 888 910 recovery->image = (psImage*) psMemIncrRefCounter(in->image); 889 }890 } else {891 // output is the input image892 out->image = (psImage*) psMemIncrRefCounter(in->image);893 if (recovery) {894 // create a recovery image initialized to zero895 createNewImage(recovery, in, extnum, 0);896 911 } 897 912 } … … 1215 1230 } 1216 1231 psFree(command); 1232 // XXX: shouldn't I be doing mv in->resolved_name.bak out->resolved_name 1233 // to complete the swap if !remove? 1217 1234 } 1218 1235 … … 1303 1320 } 1304 1321 1305 #define ACTUALLY_MASK_PIXEL 1306 #ifdef ACTUALLY_MASK_PIXEL 1307 psImageSet (sfiles->outImage->image, x, y, NAN); 1308 #else 1309 if (newMaskValue == MASK_BAD_WARP) { 1322 if (sfiles->transparentStreaks == 0) { 1310 1323 psImageSet (sfiles->outImage->image, x, y, NAN); 1311 1324 } else { 1312 // as a visualization aid don't mask the pixel, just reduce it in intensity a bit 1313 psImageSet (sfiles->outImage->image, x, y, imageValue - 50); 1314 } 1315 #endif 1325 if (newMaskValue == MASK_BAD_WARP) { 1326 psImageSet (sfiles->outImage->image, x, y, NAN); 1327 } else { 1328 // as a visualization aid don't mask the pixel, just change the intensity 1329 psImageSet (sfiles->outImage->image, x, y, imageValue + sfiles->transparentStreaks); 1330 } 1331 } 1316 1332 1317 1333 // TODO: -
trunk/magic/remove/src/streaksremove.h
r20779 r20807 67 67 psImage *warpedPixels; 68 68 psVector *tiles; 69 float recoveryImageValue; 70 float recoveryMaskValue; 71 float recoveryWeightValue; 69 double transparentStreaks; 72 70 } streakFiles; 73 71
Note:
See TracChangeset
for help on using the changeset viewer.
