Changeset 693 for trunk/psLib/src/image/psImage.c
- Timestamp:
- May 14, 2004, 2:14:56 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/image/psImage.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/image/psImage.c
r692 r693 7 7 * @author Ross Harman, MHPCC 8 8 * 9 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-05-1 4 22:39:58$9 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-05-15 00:14:56 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 34 34 area = numCols*numRows; 35 35 36 if (area < 1) { 37 psError(__func__, "Invalid value for number of rows or columns (numRows=%d, numCols=%d).", 38 numRows, numCols); 39 return NULL; 40 } 41 36 42 psImage *image = (psImage *)psAlloc(sizeof(psImage)); 37 43 38 if(area < 1) { 39 image->data.v[0] = NULL; 40 } else { 41 image->data.v[0] = psAlloc(area*elementSize); 44 image->data.v = psAlloc(sizeof(void*)*numRows); 42 45 43 for(int i = 1; i < numRows; i++) { 44 image->data.v[i] = (void*)((int8_t*)image->data.v[i-1]+rowSize); 45 } 46 image->data.v[0] = psAlloc(area*elementSize); 47 48 for(int i = 1; i < numRows; i++) { 49 image->data.v[i] = (void*)((int8_t*)image->data.v[i-1]+rowSize); 46 50 } 47 51
Note:
See TracChangeset
for help on using the changeset viewer.
