Changeset 34453
- Timestamp:
- Sep 20, 2012, 2:45:21 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20120906/psLib/src/imageops/psImagePixelManip.c
r34449 r34453 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 238 219 239 #define psImageOverlayLoop(DATATYPE,OP) { \ 220 240 for (int row=y0;row<imageRowLimit;row++) { \ 221 241 ps##DATATYPE* imageRow = image->data.DATATYPE[row]; \ 222 242 ps##DATATYPE* overlayRow = overlay->data.DATATYPE[row-y0]; \ 223 for (int col=x0;col<imageColLimit;col++) { \ 224 if (isfinite(overlayRow[col - x0])) { \ 225 imageRow[col] OP overlayRow[col-x0]; \ 226 } \ 227 } \ 228 } \ 243 for (int col=x0;col<imageColLimit;col++) { \ 244 imageRow[col] OP overlayRow[col-x0]; \ 245 } \ 246 } \ 229 247 pixelsOverlaid += (imageRowLimit - y0) * (imageColLimit - x0); \ 230 }248 } 231 249 232 250 #define psImageOverlayLoopDivide(DATATYPE,BADVALUE) { \ … … 250 268 // a drawback? We fall back on the loop if we have to change types. 251 269 #define psImageOverlaySetLoop(DATATYPE) { \ 252 if (0) { \270 if (image->type.type == overlay->type.type) { \ 253 271 int numBytes = (imageColLimit - x0) * sizeof(ps##DATATYPE); \ 254 272 for (int row = y0; row < imageRowLimit; row++) { \ … … 275 293 psImageOverlayLoop(DATATYPE,*=); \ 276 294 break; \ 295 case 'E': \ 296 psImageOverlayLoopClean(DATATYPE,=); \ 297 break; \ 277 298 case '/': \ 278 299 psImageOverlayLoopDivide(DATATYPE,BADVALUE); \
Note:
See TracChangeset
for help on using the changeset viewer.
