Changeset 7123 for trunk/psLib/src/imageops/psImagePixelManip.c
- Timestamp:
- May 15, 2006, 5:27:13 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/imageops/psImagePixelManip.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/imageops/psImagePixelManip.c
r7112 r7123 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.1 6$ $Name: not supported by cvs2svn $13 * @date $Date: 2006-05-1 3 02:35:02$12 * @version $Revision: 1.17 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2006-05-16 03:27:13 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 260 260 // faster than using a 'for' loop. Josh Hoblitt says it has an additional advantage that it doesn't blow 261 261 // away the L2 cache. Of course, if you want to use the result immediately afterwards, perhaps this is 262 // a drawback? 262 // a drawback? We fall back on the loop if we have to change types. 263 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); \ 269 } \ 270 pixelsOverlaid += (imageRowLimit - y0) * (imageColLimit - x0); \ 264 if (image->type.type == overlay->type.type) { \ 265 int numBytes = (imageColLimit - x0) * sizeof(ps##DATATYPE); \ 266 for (int row = y0; row < imageRowLimit; row++) { \ 267 ps##DATATYPE *imageRow = image->data.DATATYPE[row]; \ 268 ps##DATATYPE *overlayRow = overlay->data.DATATYPE[row - y0]; \ 269 memcpy(&imageRow[x0], overlayRow, numBytes); \ 270 } \ 271 pixelsOverlaid += (imageRowLimit - y0) * (imageColLimit - x0); \ 272 } else { \ 273 psImageOverlayLoop(DATATYPE,=); \ 274 } \ 271 275 } 272 276
Note:
See TracChangeset
for help on using the changeset viewer.
