- Timestamp:
- May 3, 2010, 8:50:52 AM (16 years ago)
- Location:
- branches/simtest_nebulous_branches
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
psLib/src/imageops/psImageMaskOps.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/simtest_nebulous_branches
- Property svn:mergeinfo changed
-
branches/simtest_nebulous_branches/psLib/src/imageops/psImageMaskOps.c
r21183 r27840 223 223 psError(PS_ERR_BAD_PARAMETER_VALUE,true, 224 224 "The logical operation specified is incorrect\n"); 225 return; 226 } 227 228 // perform the mask operation on the image pixels 229 void psImageMaskPixels(psImage *image, 230 const char *op, 231 psImageMaskType maskValue) 232 { 233 if (image == NULL) { 234 psError(PS_ERR_BAD_PARAMETER_NULL, true, "Invalid image input. Image is NULL.\n"); 235 return; 236 } 237 238 # define MASK_IT_IMAGE(OP) \ 239 for (int iy = 0; iy < image->numRows; iy++) { \ 240 for (int ix = 0; ix < image->numCols; ix++) { \ 241 image->data.PS_TYPE_IMAGE_MASK_DATA[iy][ix] OP maskValue; \ 242 } } 243 244 if ( !strncmp(op, "&", 2) || !strncmp(op, "AND", 5) ) { 245 MASK_IT_IMAGE (&=); 246 return; 247 } 248 if ( !strncmp(op, "|", 2) || !strncmp(op, "OR", 5) ) { 249 MASK_IT_IMAGE (|=); 250 return; 251 } 252 if ( !strncmp(op, "=", 2) || !strncmp(op, "EQUAL", 5) ) { 253 MASK_IT_IMAGE (=); 254 return; 255 } 256 if ( !strncmp(op, "^", 2) || !strncmp(op, "XOR", 5) ) { 257 MASK_IT_IMAGE (^=); 258 return; 259 } 260 261 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "The logical operation specified is incorrect\n"); 225 262 return; 226 263 }
Note:
See TracChangeset
for help on using the changeset viewer.
