Changeset 693
- Timestamp:
- May 14, 2004, 2:14:56 PM (22 years ago)
- Location:
- trunk/psLib/src
- Files:
-
- 4 edited
-
image/psImage.c (modified) (2 diffs)
-
mathtypes/psImage.c (modified) (2 diffs)
-
sys/psType.h (modified) (2 diffs)
-
sysUtils/psType.h (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 -
trunk/psLib/src/mathtypes/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 -
trunk/psLib/src/sys/psType.h
r672 r693 19 19 * @author Ross Harman, MHPCC 20 20 * 21 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $22 * @date $Date: 2004-05-1 3 23:36:27$21 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 22 * @date $Date: 2004-05-15 00:14:56 $ 23 23 * 24 24 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 42 42 */ 43 43 typedef enum { 44 PS_TYPE_INT8 = 0x1 1, ///< Character.45 PS_TYPE_INT16 = 0x1 2, ///< Short integer.46 PS_TYPE_INT32 = 0x1 4, ///< Integer.47 PS_TYPE_INT64 = 0x1 8, ///< Long integer.48 PS_TYPE_UINT8 = 0x3 1, ///< Unsigned character.49 PS_TYPE_UINT16 = 0x3 2, ///< Unsigned short integer.50 PS_TYPE_UINT32 = 0x3 4, ///< Unsigned integer.51 PS_TYPE_UINT64 = 0x3 8, ///< Unsigned long integer.52 PS_TYPE_FLOAT = 0x4 4, ///< Single-precision Floating point.53 PS_TYPE_DOUBLE = 0x4 8, ///< Double-precision floating point.54 PS_TYPE_COMPLEX_FLOAT = 0x8 4, ///< Complex numbers consisting of single-precision floating point.55 PS_TYPE_COMPLEX_DOUBLE = 0x8 8, ///< Complex numbers consisting of double-precision floating point.44 PS_TYPE_INT8 = 0x101, ///< Character. 45 PS_TYPE_INT16 = 0x102, ///< Short integer. 46 PS_TYPE_INT32 = 0x104, ///< Integer. 47 PS_TYPE_INT64 = 0x108, ///< Long integer. 48 PS_TYPE_UINT8 = 0x301, ///< Unsigned character. 49 PS_TYPE_UINT16 = 0x302, ///< Unsigned short integer. 50 PS_TYPE_UINT32 = 0x304, ///< Unsigned integer. 51 PS_TYPE_UINT64 = 0x308, ///< Unsigned long integer. 52 PS_TYPE_FLOAT = 0x404, ///< Single-precision Floating point. 53 PS_TYPE_DOUBLE = 0x408, ///< Double-precision floating point. 54 PS_TYPE_COMPLEX_FLOAT = 0x808, ///< Complex numbers consisting of single-precision floating point. 55 PS_TYPE_COMPLEX_DOUBLE = 0x810, ///< Complex numbers consisting of double-precision floating point. 56 56 PS_TYPE_PTR = 0x00, ///< Something else that's not supported for arithmetic.} 57 57 } psElemType; 58 58 59 #define IS_PSELEMTYPE_INT(x) (x & 0x10 == 0x10)60 #define IS_PSELEMTYPE_UNSIGNED(x) (x & 0x20 == 0x20)61 #define IS_PSELEMTYPE_REAL(x) (x & 0x40 == 0x40)62 #define IS_PSELEMTYPE_COMPLEX(x) (x & 0x80 == 0x80)63 #define PSELEMTYPE_SIZEOF(x) ( (x==PS_TYPE_PTR) ? sizeof(void*) : (x & 0x 0F) )59 #define IS_PSELEMTYPE_INT(x) (x & 0x100 == 0x100) 60 #define IS_PSELEMTYPE_UNSIGNED(x) (x & 0x200 == 0x200) 61 #define IS_PSELEMTYPE_REAL(x) (x & 0x400 == 0x400) 62 #define IS_PSELEMTYPE_COMPLEX(x) (x & 0x800 == 0x800) 63 #define PSELEMTYPE_SIZEOF(x) ( (x==PS_TYPE_PTR) ? sizeof(void*) : (x & 0xFF) ) 64 64 65 65 /** Dimensions of a data type. -
trunk/psLib/src/sysUtils/psType.h
r672 r693 19 19 * @author Ross Harman, MHPCC 20 20 * 21 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $22 * @date $Date: 2004-05-1 3 23:36:27$21 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 22 * @date $Date: 2004-05-15 00:14:56 $ 23 23 * 24 24 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 42 42 */ 43 43 typedef enum { 44 PS_TYPE_INT8 = 0x1 1, ///< Character.45 PS_TYPE_INT16 = 0x1 2, ///< Short integer.46 PS_TYPE_INT32 = 0x1 4, ///< Integer.47 PS_TYPE_INT64 = 0x1 8, ///< Long integer.48 PS_TYPE_UINT8 = 0x3 1, ///< Unsigned character.49 PS_TYPE_UINT16 = 0x3 2, ///< Unsigned short integer.50 PS_TYPE_UINT32 = 0x3 4, ///< Unsigned integer.51 PS_TYPE_UINT64 = 0x3 8, ///< Unsigned long integer.52 PS_TYPE_FLOAT = 0x4 4, ///< Single-precision Floating point.53 PS_TYPE_DOUBLE = 0x4 8, ///< Double-precision floating point.54 PS_TYPE_COMPLEX_FLOAT = 0x8 4, ///< Complex numbers consisting of single-precision floating point.55 PS_TYPE_COMPLEX_DOUBLE = 0x8 8, ///< Complex numbers consisting of double-precision floating point.44 PS_TYPE_INT8 = 0x101, ///< Character. 45 PS_TYPE_INT16 = 0x102, ///< Short integer. 46 PS_TYPE_INT32 = 0x104, ///< Integer. 47 PS_TYPE_INT64 = 0x108, ///< Long integer. 48 PS_TYPE_UINT8 = 0x301, ///< Unsigned character. 49 PS_TYPE_UINT16 = 0x302, ///< Unsigned short integer. 50 PS_TYPE_UINT32 = 0x304, ///< Unsigned integer. 51 PS_TYPE_UINT64 = 0x308, ///< Unsigned long integer. 52 PS_TYPE_FLOAT = 0x404, ///< Single-precision Floating point. 53 PS_TYPE_DOUBLE = 0x408, ///< Double-precision floating point. 54 PS_TYPE_COMPLEX_FLOAT = 0x808, ///< Complex numbers consisting of single-precision floating point. 55 PS_TYPE_COMPLEX_DOUBLE = 0x810, ///< Complex numbers consisting of double-precision floating point. 56 56 PS_TYPE_PTR = 0x00, ///< Something else that's not supported for arithmetic.} 57 57 } psElemType; 58 58 59 #define IS_PSELEMTYPE_INT(x) (x & 0x10 == 0x10)60 #define IS_PSELEMTYPE_UNSIGNED(x) (x & 0x20 == 0x20)61 #define IS_PSELEMTYPE_REAL(x) (x & 0x40 == 0x40)62 #define IS_PSELEMTYPE_COMPLEX(x) (x & 0x80 == 0x80)63 #define PSELEMTYPE_SIZEOF(x) ( (x==PS_TYPE_PTR) ? sizeof(void*) : (x & 0x 0F) )59 #define IS_PSELEMTYPE_INT(x) (x & 0x100 == 0x100) 60 #define IS_PSELEMTYPE_UNSIGNED(x) (x & 0x200 == 0x200) 61 #define IS_PSELEMTYPE_REAL(x) (x & 0x400 == 0x400) 62 #define IS_PSELEMTYPE_COMPLEX(x) (x & 0x800 == 0x800) 63 #define PSELEMTYPE_SIZEOF(x) ( (x==PS_TYPE_PTR) ? sizeof(void*) : (x & 0xFF) ) 64 64 65 65 /** Dimensions of a data type.
Note:
See TracChangeset
for help on using the changeset viewer.
