Changeset 3309
- Timestamp:
- Feb 23, 2005, 11:32:40 AM (21 years ago)
- Location:
- trunk/psLib/src
- Files:
-
- 3 edited
-
image/psImageExtraction.c (modified) (2 diffs)
-
image/psImageStats.c (modified) (2 diffs)
-
imageops/psImageStats.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/image/psImageExtraction.c
r3264 r3309 9 9 * @author Robert DeSonia, MHPCC 10 10 * 11 * @version $Revision: 1.3 0$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-02- 17 19:26:24$11 * @version $Revision: 1.31 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-02-23 21:32:40 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 394 394 395 395 switch (type) { 396 // PSIMAGE_CUT_VERTICAL(U8);Not a requirement396 PSIMAGE_CUT_VERTICAL(U8); // Not a requirement 397 397 PSIMAGE_CUT_VERTICAL(U16); 398 // PSIMAGE_CUT_VERTICAL(U32);Not a requirement399 // PSIMAGE_CUT_VERTICAL(U64);Not a requirement398 PSIMAGE_CUT_VERTICAL(U32); // Not a requirement 399 PSIMAGE_CUT_VERTICAL(U64); // Not a requirement 400 400 PSIMAGE_CUT_VERTICAL(S8); 401 // PSIMAGE_CUT_VERTICAL(S16);Not a requirement402 // PSIMAGE_CUT_VERTICAL(S32);Not a requirement403 // PSIMAGE_CUT_VERTICAL(S64);Not a requirement401 PSIMAGE_CUT_VERTICAL(S16); // Not a requirement 402 PSIMAGE_CUT_VERTICAL(S32); // Not a requirement 403 PSIMAGE_CUT_VERTICAL(S64); // Not a requirement 404 404 PSIMAGE_CUT_VERTICAL(F32); 405 405 PSIMAGE_CUT_VERTICAL(F64); 406 // PSIMAGE_CUT_VERTICAL(C32);Not a requirement407 // PSIMAGE_CUT_VERTICAL(C64);Not a requirement406 PSIMAGE_CUT_VERTICAL(C32); // Not a requirement 407 PSIMAGE_CUT_VERTICAL(C64); // Not a requirement 408 408 default: { 409 409 char* typeStr; -
trunk/psLib/src/image/psImageStats.c
r3302 r3309 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.6 7$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-02-2 2 20:06:24$11 * @version $Revision: 1.68 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-02-23 21:32:40 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 130 130 psVector* junkMask = NULL; 131 131 132 junkData = psAlloc(sizeof(psVector)); 133 junkData->type = in->type; 134 junkData->nalloc = in->numRows * in->numCols; 135 junkData->n = junkData->nalloc; 136 junkData->data.V = in->data.V[0]; // since psImage data is contiguous... 132 if (in->parent == NULL) { 133 // stuff the image data into a psVector struct. 134 junkData = (psVector *) psAlloc(sizeof(psVector)); 135 junkData->type = in->type; 136 junkData->nalloc = in->numRows * in->numCols; 137 junkData->n = junkData->nalloc; 138 junkData->data.V = in->data.V[0]; // since psImage data is contiguous... 139 } else { 140 // image not necessarily contiguous 141 int numRows = in->numRows; 142 int numCols = in->numCols; 143 int rowSize = numCols * (PSELEMTYPE_SIZEOF(in->type.type)); 144 145 junkData = psVectorAlloc(numRows*numCols, in->type.type); 146 junkData->n = junkData->nalloc; 147 148 psU8* data = junkData->data.V; 149 for (int row = 0; row < numRows; row++) { 150 memcpy(data, in->data.V[row], rowSize); 151 data += rowSize; 152 } 153 } 137 154 138 155 if (mask != NULL) { 139 // stuff the mask data into a psVector struct. 140 junkMask = psAlloc(sizeof(psVector)); 141 junkMask->type = mask->type; 142 junkMask->nalloc = mask->numRows * mask->numCols; 143 junkMask->n = junkMask->nalloc; 144 junkMask->data.V = mask->data.V[0]; 156 if (mask->parent == NULL) { 157 // stuff the mask data into a psVector struct. 158 junkMask = psAlloc(sizeof(psVector)); 159 junkMask->type = mask->type; 160 junkMask->nalloc = mask->numRows * mask->numCols; 161 junkMask->n = junkMask->nalloc; 162 junkMask->data.V = mask->data.V[0]; 163 } else { 164 // image not necessarily contiguous 165 int numRows = mask->numRows; 166 int numCols = mask->numCols; 167 int rowSize = numCols * (PSELEMTYPE_SIZEOF(mask->type.type)); 168 169 junkMask = psVectorAlloc(numRows*numCols, mask->type.type); 170 junkMask->n = junkMask->nalloc; 171 172 psU8* data = junkMask->data.V; 173 for (int row = 0; row < numRows; row++) { 174 memcpy(data, mask->data.V[row], rowSize); 175 data += rowSize; 176 } 177 } 145 178 } 146 179 -
trunk/psLib/src/imageops/psImageStats.c
r3302 r3309 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.6 7$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-02-2 2 20:06:24$11 * @version $Revision: 1.68 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-02-23 21:32:40 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 130 130 psVector* junkMask = NULL; 131 131 132 junkData = psAlloc(sizeof(psVector)); 133 junkData->type = in->type; 134 junkData->nalloc = in->numRows * in->numCols; 135 junkData->n = junkData->nalloc; 136 junkData->data.V = in->data.V[0]; // since psImage data is contiguous... 132 if (in->parent == NULL) { 133 // stuff the image data into a psVector struct. 134 junkData = (psVector *) psAlloc(sizeof(psVector)); 135 junkData->type = in->type; 136 junkData->nalloc = in->numRows * in->numCols; 137 junkData->n = junkData->nalloc; 138 junkData->data.V = in->data.V[0]; // since psImage data is contiguous... 139 } else { 140 // image not necessarily contiguous 141 int numRows = in->numRows; 142 int numCols = in->numCols; 143 int rowSize = numCols * (PSELEMTYPE_SIZEOF(in->type.type)); 144 145 junkData = psVectorAlloc(numRows*numCols, in->type.type); 146 junkData->n = junkData->nalloc; 147 148 psU8* data = junkData->data.V; 149 for (int row = 0; row < numRows; row++) { 150 memcpy(data, in->data.V[row], rowSize); 151 data += rowSize; 152 } 153 } 137 154 138 155 if (mask != NULL) { 139 // stuff the mask data into a psVector struct. 140 junkMask = psAlloc(sizeof(psVector)); 141 junkMask->type = mask->type; 142 junkMask->nalloc = mask->numRows * mask->numCols; 143 junkMask->n = junkMask->nalloc; 144 junkMask->data.V = mask->data.V[0]; 156 if (mask->parent == NULL) { 157 // stuff the mask data into a psVector struct. 158 junkMask = psAlloc(sizeof(psVector)); 159 junkMask->type = mask->type; 160 junkMask->nalloc = mask->numRows * mask->numCols; 161 junkMask->n = junkMask->nalloc; 162 junkMask->data.V = mask->data.V[0]; 163 } else { 164 // image not necessarily contiguous 165 int numRows = mask->numRows; 166 int numCols = mask->numCols; 167 int rowSize = numCols * (PSELEMTYPE_SIZEOF(mask->type.type)); 168 169 junkMask = psVectorAlloc(numRows*numCols, mask->type.type); 170 junkMask->n = junkMask->nalloc; 171 172 psU8* data = junkMask->data.V; 173 for (int row = 0; row < numRows; row++) { 174 memcpy(data, mask->data.V[row], rowSize); 175 data += rowSize; 176 } 177 } 145 178 } 146 179
Note:
See TracChangeset
for help on using the changeset viewer.
