Changeset 4938 for trunk/psLib/src/imageops/psImagePixelManip.c
- Timestamp:
- Aug 31, 2005, 3:05:41 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/imageops/psImagePixelManip.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/imageops/psImagePixelManip.c
r4934 r4938 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-0 8-31 21:58:22$12 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-09-01 01:05:41 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 400 400 void psImageMaskRegion(psImage *image, 401 401 psRegion *region, 402 bool logical_and,402 const char *op, 403 403 psMaskType maskValue) 404 404 { … … 414 414 if (iy + image->row0 >= region->y1) 415 415 continue; 416 if ( logical_and) {416 if ( !strncmp(op, "&", 2) || !strncmp(op, "AND", 5) ) { 417 417 image->data.U8[iy][ix] &= maskValue; 418 } else {418 } else if ( !strncmp(op, "|", 2) || !strncmp(op, "OR", 5) ) { 419 419 image->data.U8[iy][ix] |= maskValue; 420 } else if ( !strncmp(op, "=", 2) || !strncmp(op, "EQUAL", 5) ) { 421 image->data.U8[iy][ix] = maskValue; 422 } else if ( !strncmp(op, "^", 2) || !strncmp(op, "XOR", 5) ) { 423 image->data.U8[iy][ix] ^= maskValue; 420 424 } 421 425 } … … 427 431 void psImageKeepRegion(psImage *image, 428 432 psRegion *region, 429 bool logical_and,433 const char *op, 430 434 psMaskType maskValue) 431 435 { … … 443 447 continue; 444 448 maskit: 445 if ( logical_and) {449 if ( !strncmp(op, "&", 2) || !strncmp(op, "AND", 5) ) { 446 450 image->data.U8[iy][ix] &= maskValue; 447 } else {451 } else if ( !strncmp(op, "|", 2) || !strncmp(op, "OR", 5) ) { 448 452 image->data.U8[iy][ix] |= maskValue; 453 } else if ( !strncmp(op, "=", 2) || !strncmp(op, "EQUAL", 5) ) { 454 image->data.U8[iy][ix] = maskValue; 455 } else if ( !strncmp(op, "^", 2) || !strncmp(op, "XOR", 5) ) { 456 image->data.U8[iy][ix] ^= maskValue; 449 457 } 450 458 } … … 458 466 double y, 459 467 double radius, 460 bool logical_and,468 const char *op, 461 469 psMaskType maskValue) 462 470 { … … 473 481 if (r2 > R2) 474 482 continue; 475 if ( logical_and) {483 if ( !strncmp(op, "&", 2) || !strncmp(op, "AND", 5) ) { 476 484 image->data.U8[iy][ix] &= maskValue; 477 } else {485 } else if ( !strncmp(op, "|", 2) || !strncmp(op, "OR", 5) ) { 478 486 image->data.U8[iy][ix] |= maskValue; 487 } else if ( !strncmp(op, "=", 2) || !strncmp(op, "EQUAL", 5) ) { 488 image->data.U8[iy][ix] = maskValue; 489 } else if ( !strncmp(op, "^", 2) || !strncmp(op, "XOR", 5) ) { 490 image->data.U8[iy][ix] ^= maskValue; 479 491 } 480 492 } … … 488 500 double y, 489 501 double radius, 490 bool logical_and,502 const char *op, 491 503 psMaskType maskValue) 492 504 { … … 503 515 if (r2 < R2) 504 516 continue; 505 if ( logical_and) {517 if ( !strncmp(op, "&", 2) || !strncmp(op, "AND", 5) ) { 506 518 image->data.U8[iy][ix] &= maskValue; 507 } else {519 } else if ( !strncmp(op, "|", 2) || !strncmp(op, "OR", 5) ) { 508 520 image->data.U8[iy][ix] |= maskValue; 521 } else if ( !strncmp(op, "=", 2) || !strncmp(op, "EQUAL", 5) ) { 522 image->data.U8[iy][ix] = maskValue; 523 } else if ( !strncmp(op, "^", 2) || !strncmp(op, "XOR", 5) ) { 524 image->data.U8[iy][ix] ^= maskValue; 509 525 } 510 526 }
Note:
See TracChangeset
for help on using the changeset viewer.
