Changeset 4938
- Timestamp:
- Aug 31, 2005, 3:05:41 PM (21 years ago)
- Location:
- trunk/psLib/src/imageops
- Files:
-
- 2 edited
-
psImagePixelManip.c (modified) (9 diffs)
-
psImagePixelManip.h (modified) (5 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 } -
trunk/psLib/src/imageops/psImagePixelManip.h
r4934 r4938 8 8 * @author Robert DeSonia, MHPCC 9 9 * 10 * @version $Revision: 1.1 1$ $Name: not supported by cvs2svn $11 * @date $Date: 2005-0 8-31 21:58:22$10 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-09-01 01:05:41 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 95 95 psImage *image, ///< the image to set 96 96 psRegion *region, ///< the specified region 97 bool logical_and,///< the logical operation97 const char *op, ///< the logical operation 98 98 psMaskType maskValue ///< the specified bits 99 99 ); … … 107 107 psImage *image, ///< the image to set 108 108 psRegion *region, ///< the specified region 109 bool logical_and,///< the logical operation109 const char *op, ///< the logical operation 110 110 psMaskType maskValue ///< the specified bits 111 111 ); … … 121 121 double y, ///< the y coordinate of the circle's center 122 122 double radius, ///< the radius of the specified circle 123 bool logical_and,///< the logical operation123 const char *op, ///< the logical operation 124 124 psMaskType maskValue ///< the specified bits 125 125 ); … … 135 135 double y, ///< the y coordinate of the circle's center 136 136 double radius, ///< the radius of the specified circle 137 bool logical_and,///< the logical operation137 const char *op, ///< the logical operation 138 138 psMaskType maskValue ///< the specified bits 139 139 );
Note:
See TracChangeset
for help on using the changeset viewer.
