Changeset 5064 for trunk/psLib/src/mathtypes
- Timestamp:
- Sep 16, 2005, 1:56:51 PM (21 years ago)
- Location:
- trunk/psLib/src/mathtypes
- Files:
-
- 4 edited
-
psImage.c (modified) (2 diffs)
-
psImage.h (modified) (2 diffs)
-
psVector.c (modified) (7 diffs)
-
psVector.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/mathtypes/psImage.c
r5057 r5064 9 9 * @author Ross Harman, MHPCC 10 10 * 11 * @version $Revision: 1.8 2$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-09-1 5 21:22:22$11 * @version $Revision: 1.83 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-09-16 23:56:51 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 165 165 // XXX EAM : this needs to be changes to use psRegion rather than psRegion* 166 166 psRegion psRegionForImage(psImage *image, 167 psRegion *in)167 psRegion in) 168 168 { 169 169 170 170 // x0,y0, x1,y1 are in *parent* units 171 171 // PS_ASSERT_PTR_NON_NULL(in, NULL); 172 if( in == NULL ) { 173 psError(PS_ERR_BAD_PARAMETER_NULL, true, "Unallowable operation. psRegion *in is NULL."); 174 return *in; 175 } 176 /* if (out == NULL) { 177 // out = psRegionAlloc(in->x0, in->x1, in->y0, in->y1); 178 *out = psRegionSet(in->x0, in->x1, in->y0, in->y1); 179 } else { 180 *out = *in; 181 } 182 */ // XXX these are probably wrong (see above) 183 if (in->x1 <= 0) { 184 in->x1 = image->col0 + image->numCols + in->x1; 185 } 186 if (in->y1 <= 0) { 187 in->y1 = image->row0 + image->numRows + in->y1; 172 /* 173 if( in == NULL ) { 174 psError(PS_ERR_BAD_PARAMETER_NULL, true, "Unallowable operation. psRegion in is NULL."); 175 return in; 176 } 177 */ /* if (out == NULL) { 178 // out = psRegionAlloc(in->x0, in->x1, in->y0, in->y1); 179 *out = psRegionSet(in->x0, in->x1, in->y0, in->y1); 180 } else { 181 *out = *in; 182 } 183 */ // XXX these are probably wrong (see above) 184 if (in.x1 <= 0) { 185 in.x1 = image->col0 + image->numCols + in.x1; 186 } 187 if (in.y1 <= 0) { 188 in.y1 = image->row0 + image->numRows + in.y1; 188 189 } 189 190 190 191 // force the lower-limits to be on the child 191 in ->x0 = PS_MAX(image->col0, in->x0);192 in ->y0 = PS_MAX(image->row0, in->y0);192 in.x0 = PS_MAX(image->col0, in.x0); 193 in.y0 = PS_MAX(image->row0, in.y0); 193 194 194 195 // force the upper-limits to be on the child 195 in ->x1 = PS_MIN(image->col0 + image->numCols, in->x1);196 in ->y1 = PS_MIN(image->row0 + image->numRows, in->y1);197 return ( *in);196 in.x1 = PS_MIN(image->col0 + image->numCols, in.x1); 197 in.y1 = PS_MIN(image->row0 + image->numRows, in.y1); 198 return (in); 198 199 } 199 200 -
trunk/psLib/src/mathtypes/psImage.h
r5057 r5064 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.6 8$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-09-1 5 21:22:22$13 * @version $Revision: 1.69 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-09-16 23:56:51 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 168 168 psRegion psRegionForImage( 169 169 psImage *image, ///< the image for which the region is to be set 170 psRegion *in///< the image region limits170 psRegion in ///< the image region limits 171 171 ); 172 172 -
trunk/psLib/src/mathtypes/psVector.c
r4944 r5064 9 9 * @author Robert DeSonia, MHPCC 10 10 * 11 * @version $Revision: 1.5 1$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-09- 02 21:32:06$11 * @version $Revision: 1.52 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-09-16 23:56:51 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 616 616 617 617 618 bool psVectorInit(psVector * image,618 bool psVectorInit(psVector *vector, 619 619 ...) 620 620 { … … 636 636 int temp2; 637 637 638 if ( image== NULL)638 if (vector == NULL) 639 639 return (false); 640 640 641 va_start (argp, image);642 643 switch ( image->type.type) {641 va_start (argp, vector); 642 643 switch (vector->type.type) { 644 644 case PS_TYPE_U8: 645 645 temp = va_arg (argp, psU32); … … 650 650 return false; 651 651 } 652 for (long iy = 0; iy < image->n; iy++) {653 image->data.U8[iy] = vU8;652 for (long iy = 0; iy < vector->n; iy++) { 653 vector->data.U8[iy] = vU8; 654 654 } 655 655 return (true); 656 656 case PS_TYPE_F32: 657 657 vF32 = (psF32)va_arg (argp, psF64); 658 for (long iy = 0; iy < image->n; iy++) {659 image->data.F32[iy] = vF32;658 for (long iy = 0; iy < vector->n; iy++) { 659 vector->data.F32[iy] = vF32; 660 660 } 661 661 return (true); 662 662 case PS_TYPE_F64: 663 663 vF64 = va_arg (argp, psF64); 664 for (long iy = 0; iy < image->n; iy++) {665 image->data.F64[iy] = vF64;664 for (long iy = 0; iy < vector->n; iy++) { 665 vector->data.F64[iy] = vF64; 666 666 } 667 667 return (true); … … 674 674 return false; 675 675 } 676 for (long iy = 0; iy < image->n; iy++) {677 image->data.U16[iy] = vU16;676 for (long iy = 0; iy < vector->n; iy++) { 677 vector->data.U16[iy] = vU16; 678 678 } 679 679 return (true); 680 680 case PS_TYPE_U32: 681 681 vU32 = va_arg (argp, psU32); 682 for (long iy = 0; iy < image->n; iy++) {683 image->data.U32[iy] = vU32;682 for (long iy = 0; iy < vector->n; iy++) { 683 vector->data.U32[iy] = vU32; 684 684 } 685 685 return (true); 686 686 case PS_TYPE_U64: 687 687 vU64 = va_arg (argp, psU64); 688 for (long iy = 0; iy < image->n; iy++) {689 image->data.U64[iy] = vU64;688 for (long iy = 0; iy < vector->n; iy++) { 689 vector->data.U64[iy] = vU64; 690 690 } 691 691 return (true); … … 698 698 return false; 699 699 } 700 for (long iy = 0; iy < image->n; iy++) {701 image->data.S8[iy] = vS8;700 for (long iy = 0; iy < vector->n; iy++) { 701 vector->data.S8[iy] = vS8; 702 702 } 703 703 return (true); … … 710 710 return false; 711 711 } 712 for (long iy = 0; iy < image->n; iy++) {713 image->data.S16[iy] = vS16;712 for (long iy = 0; iy < vector->n; iy++) { 713 vector->data.S16[iy] = vS16; 714 714 } 715 715 return (true); 716 716 case PS_TYPE_S32: 717 717 vS32 = va_arg (argp, psS32); 718 for (long iy = 0; iy < image->n; iy++) {719 image->data.S32[iy] = vS32;718 for (long iy = 0; iy < vector->n; iy++) { 719 vector->data.S32[iy] = vS32; 720 720 } 721 721 return (true); 722 722 case PS_TYPE_S64: 723 723 vS64 = va_arg (argp, psS64); 724 for (long iy = 0; iy < image->n; iy++) {725 image->data.S64[iy] = vS64;724 for (long iy = 0; iy < vector->n; iy++) { 725 vector->data.S64[iy] = vS64; 726 726 } 727 727 return (true); 728 728 case PS_TYPE_C32: 729 729 vC32 = va_arg (argp, psC32); 730 for (long iy = 0; iy < image->n; iy++) {731 image->data.C32[iy] = vC32;730 for (long iy = 0; iy < vector->n; iy++) { 731 vector->data.C32[iy] = vC32; 732 732 } 733 733 return (true); 734 734 case PS_TYPE_C64: 735 735 vC64 = va_arg (argp, psC64); 736 for (long iy = 0; iy < image->n; iy++) {737 image->data.C64[iy] = vC64;736 for (long iy = 0; iy < vector->n; iy++) { 737 vector->data.C64[iy] = vC64; 738 738 } 739 739 return (true); 740 740 default: 741 psError (PS_ERR_BAD_PARAMETER_TYPE, true, "datatype %d not defined in psImageInit\n", image->type);741 psError (PS_ERR_BAD_PARAMETER_TYPE, true, "datatype %d not defined in psImageInit\n", vector->type); 742 742 return (false); 743 743 } -
trunk/psLib/src/mathtypes/psVector.h
r5057 r5064 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.4 4$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-09-1 5 21:22:22$13 * @version $Revision: 1.45 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-09-16 23:56:51 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 204 204 */ 205 205 bool psVectorInit( 206 psVector * image,///< the vector to be initialized206 psVector *vector, ///< the vector to be initialized 207 207 ... ///< Variable argument list for initialization 208 208 );
Note:
See TracChangeset
for help on using the changeset viewer.
