- Timestamp:
- Dec 18, 2012, 5:56:48 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20121130/psLib/src/imageops/psImagePixelManip.c
r12953 r34838 216 216 } 217 217 218 218 #define psImageOverlayLoopClean(DATATYPE,OP) { \ 219 for (int row=y0;row<imageRowLimit;row++) { \ 220 ps##DATATYPE* imageRow = image->data.DATATYPE[row]; \ 221 ps##DATATYPE* overlayRow = overlay->data.DATATYPE[row-y0]; \ 222 for (int col=x0;col<imageColLimit;col++) { \ 223 if (!isfinite(imageRow[col])) { \ 224 imageRow[col] OP overlayRow[col-x0]; \ 225 } \ 226 else if (!isfinite(overlayRow[col-x0])) { \ 227 imageRow[col] = imageRow[col]; \ 228 } \ 229 else { \ 230 imageRow[col] = overlayRow[col-x0]; \ 231 } \ 232 } \ 233 } \ 234 pixelsOverlaid += (imageRowLimit - y0) * (imageColLimit - x0); \ 235 } 236 237 #define psImageOverlayLoopMask(DATATYPE) { \ 238 for (int row=y0;row<imageRowLimit;row++) { \ 239 ps##DATATYPE* imageRow = image->data.DATATYPE[row]; \ 240 ps##DATATYPE* overlayRow = overlay->data.DATATYPE[row-y0]; \ 241 for (int col=x0;col<imageColLimit;col++) { \ 242 if (!isfinite(imageRow[col])) { \ 243 imageRow[col] = overlayRow[col-x0]; \ 244 } \ 245 else if (!isfinite(overlayRow[col-x0])) { \ 246 imageRow[col] = imageRow[col]; \ 247 } \ 248 else { \ 249 imageRow[col] &= overlayRow[col-x0]; \ 250 } \ 251 } \ 252 } \ 253 pixelsOverlaid += (imageRowLimit - y0) * (imageColLimit - x0); \ 254 } 255 256 257 219 258 #define psImageOverlayLoop(DATATYPE,OP) { \ 220 259 for (int row=y0;row<imageRowLimit;row++) { \ 221 260 ps##DATATYPE* imageRow = image->data.DATATYPE[row]; \ 222 261 ps##DATATYPE* overlayRow = overlay->data.DATATYPE[row-y0]; \ 223 for (int col=x0;col<imageColLimit;col++) { \224 imageRow[col] OP overlayRow[col-x0]; \225 }\226 } \262 for (int col=x0;col<imageColLimit;col++) { \ 263 imageRow[col] OP overlayRow[col-x0]; \ 264 } \ 265 } \ 227 266 pixelsOverlaid += (imageRowLimit - y0) * (imageColLimit - x0); \ 228 }267 } 229 268 230 269 #define psImageOverlayLoopDivide(DATATYPE,BADVALUE) { \ … … 273 312 psImageOverlayLoop(DATATYPE,*=); \ 274 313 break; \ 314 case 'E': \ 315 psImageOverlayLoopClean(DATATYPE,=); \ 316 break; \ 275 317 case '/': \ 276 318 psImageOverlayLoopDivide(DATATYPE,BADVALUE); \ 277 319 break; \ 278 320 case '=': \ 279 psImageOverlaySetLoop(DATATYPE); \321 psImageOverlaySetLoop(DATATYPE); \ 280 322 break; \ 281 323 default: \ … … 286 328 } \ 287 329 break; 330 #define psImageOverlayCaseInt(DATATYPE,BADVALUE) \ 331 case PS_TYPE_##DATATYPE: \ 332 switch (*op) { \ 333 case '+': \ 334 psImageOverlayLoop(DATATYPE,+=); \ 335 break; \ 336 case '-': \ 337 psImageOverlayLoop(DATATYPE,-=); \ 338 break; \ 339 case '*': \ 340 psImageOverlayLoop(DATATYPE,*=); \ 341 break; \ 342 case 'E': \ 343 psImageOverlayLoopClean(DATATYPE,=); \ 344 break; \ 345 case 'M': \ 346 psImageOverlayLoopMask(DATATYPE); \ 347 break; \ 348 case '/': \ 349 psImageOverlayLoopDivide(DATATYPE,BADVALUE); \ 350 break; \ 351 case '=': \ 352 psImageOverlaySetLoop(DATATYPE); \ 353 break; \ 354 default: \ 355 psError(PS_ERR_BAD_PARAMETER_VALUE, true, \ 356 _("Specified operation, '%s', is not supported."), \ 357 op); \ 358 return pixelsOverlaid; \ 359 } \ 360 break; 288 361 289 362 switch (type) { 290 psImageOverlayCase (U8, 0);291 psImageOverlayCase (U16,0);292 psImageOverlayCase (U32,0); // Not a requirement293 psImageOverlayCase (U64,0); // Not a requirement294 psImageOverlayCase (S8, 0);295 psImageOverlayCase (S16,0);296 psImageOverlayCase (S32,0); // Not a requirement297 psImageOverlayCase (S64,0); // Not a requirement363 psImageOverlayCaseInt(U8, 0); 364 psImageOverlayCaseInt(U16,0); 365 psImageOverlayCaseInt(U32,0); // Not a requirement 366 psImageOverlayCaseInt(U64,0); // Not a requirement 367 psImageOverlayCaseInt(S8, 0); 368 psImageOverlayCaseInt(S16,0); 369 psImageOverlayCaseInt(S32,0); // Not a requirement 370 psImageOverlayCaseInt(S64,0); // Not a requirement 298 371 psImageOverlayCase(F32,NAN); 299 372 psImageOverlayCase(F64,NAN);
Note:
See TracChangeset
for help on using the changeset viewer.
