Changeset 40045 for trunk/psLib/src/imageops/psImagePixelManip.c
- Timestamp:
- May 18, 2017, 11:48:56 AM (9 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/imageops/psImagePixelManip.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/imageops/psImagePixelManip.c
r34800 r40045 216 216 } 217 217 218 // this function is only called for float-type values 218 219 #define psImageOverlayLoopClean(DATATYPE,OP) { \ 219 220 for (int row=y0;row<imageRowLimit;row++) { \ … … 235 236 } 236 237 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 } \ 238 #define psImageOverlayLoopCleanInt(DATATYPE,OP) { \ 239 for (int row=y0;row<imageRowLimit;row++) { \ 240 ps##DATATYPE* imageRow = image->data.DATATYPE[row]; \ 241 ps##DATATYPE* overlayRow = overlay->data.DATATYPE[row-y0]; \ 242 for (int col=x0;col<imageColLimit;col++) { \ 243 imageRow[col] = overlayRow[col-x0]; \ 244 } \ 245 } \ 246 pixelsOverlaid += (imageRowLimit - y0) * (imageColLimit - x0); \ 247 } 248 249 // test for int type (but compiler does not allow int type to go to isfinit) 250 // bool isFloatType = ((PS_TYPE_##DATATYPE == PS_TYPE_F32) || (PS_TYPE_##DATATYPE == PS_TYPE_F64)); 251 252 // this function is only called for int type data, so we cannot test for isfinite 253 #define psImageOverlayLoopMask(DATATYPE) { \ 254 for (int row=y0;row<imageRowLimit;row++) { \ 255 ps##DATATYPE* imageRow = image->data.DATATYPE[row]; \ 256 ps##DATATYPE* overlayRow = overlay->data.DATATYPE[row-y0]; \ 257 for (int col=x0;col<imageColLimit;col++) { \ 258 imageRow[col] &= overlayRow[col-x0]; \ 251 259 } \ 252 260 } \ … … 328 336 } \ 329 337 break; 338 339 // this function is only called for Int type data 330 340 #define psImageOverlayCaseInt(DATATYPE,BADVALUE) \ 331 341 case PS_TYPE_##DATATYPE: \ … … 341 351 break; \ 342 352 case 'E': \ 343 psImageOverlayLoopClean (DATATYPE,=); \353 psImageOverlayLoopCleanInt(DATATYPE,=); \ 344 354 break; \ 345 355 case 'M': \
Note:
See TracChangeset
for help on using the changeset viewer.
