Changeset 7112
- Timestamp:
- May 12, 2006, 4:35:02 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/imageops/psImagePixelManip.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/imageops/psImagePixelManip.c
r6227 r7112 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.1 5$ $Name: not supported by cvs2svn $13 * @date $Date: 2006-0 1-28 01:12:11$12 * @version $Revision: 1.16 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2006-05-13 02:35:02 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 253 253 imageRow[col] OP overlayRow[col-x0]; \ 254 254 } \ 255 } \ 256 pixelsOverlaid += (imageRowLimit - y0) * (imageColLimit - x0); \ 257 } 258 259 // Use memcpy to perform the '=' operation. Depending on the particular application, it can be about 20% 260 // faster than using a 'for' loop. Josh Hoblitt says it has an additional advantage that it doesn't blow 261 // away the L2 cache. Of course, if you want to use the result immediately afterwards, perhaps this is 262 // a drawback? 263 #define psImageOverlaySetLoop(DATATYPE) { \ 264 int numBytes = (imageColLimit - x0) * sizeof(ps##DATATYPE); \ 265 for (int row = y0; row < imageRowLimit; row++) { \ 266 ps##DATATYPE *imageRow = image->data.DATATYPE[row]; \ 267 ps##DATATYPE *overlayRow = overlay->data.DATATYPE[row - y0]; \ 268 memcpy(&imageRow[x0], overlayRow, numBytes); \ 255 269 } \ 256 270 pixelsOverlaid += (imageRowLimit - y0) * (imageColLimit - x0); \ … … 273 287 break; \ 274 288 case '=': \ 275 psImageOverlay Loop(DATATYPE,=); \289 psImageOverlaySetLoop(DATATYPE); \ 276 290 break; \ 277 291 default: \
Note:
See TracChangeset
for help on using the changeset viewer.
