Changeset 12256
- Timestamp:
- Mar 5, 2007, 5:09:58 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/imageops/psImagePixelManip.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/imageops/psImagePixelManip.c
r10999 r12256 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.2 1$ $Name: not supported by cvs2svn $13 * @date $Date: 2007-0 1-09 22:38:52$12 * @version $Revision: 1.22 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2007-03-06 03:09:58 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 261 261 } 262 262 263 #define psImageOverlayLoopDivide(DATATYPE,BADVALUE) { \ 264 for (int row=y0;row<imageRowLimit;row++) { \ 265 ps##DATATYPE* imageRow = image->data.DATATYPE[row]; \ 266 ps##DATATYPE* overlayRow = overlay->data.DATATYPE[row-y0]; \ 267 for (int col=x0;col<imageColLimit;col++) { \ 268 if (overlayRow[col-x0] == 0) { \ 269 imageRow[col] = BADVALUE; \ 270 continue; \ 271 } \ 272 imageRow[col] /= overlayRow[col-x0]; \ 273 } \ 274 } \ 275 pixelsOverlaid += (imageRowLimit - y0) * (imageColLimit - x0); \ 276 } 277 263 278 // Use memcpy to perform the '=' operation. Depending on the particular application, it can be about 20% 264 279 // faster than using a 'for' loop. Josh Hoblitt says it has an additional advantage that it doesn't blow … … 279 294 } 280 295 281 #define psImageOverlayCase(DATATYPE ) \296 #define psImageOverlayCase(DATATYPE,BADVALUE) \ 282 297 case PS_TYPE_##DATATYPE: \ 283 298 switch (*op) { \ … … 292 307 break; \ 293 308 case '/': \ 294 psImageOverlayLoop (DATATYPE,/=); \309 psImageOverlayLoopDivide(DATATYPE,BADVALUE); \ 295 310 break; \ 296 311 case '=': \ … … 306 321 307 322 switch (type) { 308 psImageOverlayCase(U8 );309 psImageOverlayCase(U16 );310 psImageOverlayCase(U32 ); // Not a requirement311 psImageOverlayCase(U64 ); // Not a requirement312 psImageOverlayCase(S8 );313 psImageOverlayCase(S16 );314 psImageOverlayCase(S32 ); // Not a requirement315 psImageOverlayCase(S64 ); // Not a requirement316 psImageOverlayCase(F32 );317 psImageOverlayCase(F64 );318 psImageOverlayCase(C32 );319 psImageOverlayCase(C64 );323 psImageOverlayCase(U8, 0); 324 psImageOverlayCase(U16,0); 325 psImageOverlayCase(U32,0); // Not a requirement 326 psImageOverlayCase(U64,0); // Not a requirement 327 psImageOverlayCase(S8, 0); 328 psImageOverlayCase(S16,0); 329 psImageOverlayCase(S32,0); // Not a requirement 330 psImageOverlayCase(S64,0); // Not a requirement 331 psImageOverlayCase(F32,NAN); 332 psImageOverlayCase(F64,NAN); 333 psImageOverlayCase(C32,NAN); 334 psImageOverlayCase(C64,NAN); 320 335 321 336 default: {
Note:
See TracChangeset
for help on using the changeset viewer.
