Changeset 5101 for trunk/psLib/src/types
- Timestamp:
- Sep 22, 2005, 2:04:36 PM (21 years ago)
- Location:
- trunk/psLib/src/types
- Files:
-
- 2 edited
-
psPixels.c (modified) (2 diffs)
-
psPixels.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/types/psPixels.c
r4898 r5101 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.1 6$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-0 8-30 01:14:13$9 * @version $Revision: 1.17 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-09-23 00:04:36 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 332 332 return (true); 333 333 } 334 335 bool psPixelsSet(psPixels *pixels, 336 long position, 337 psPixelCoord value) 338 { 339 if (pixels == NULL) 340 return false; 341 if (position > pixels->n) 342 return false; 343 if(position < 0) 344 position += pixels->n; 345 if (position == pixels->n) { 346 if (position >= pixels->nalloc) 347 return false; 348 pixels->n++; 349 } 350 pixels->data[position].x = value.x; 351 pixels->data[position].y = value.y; 352 353 return true; 354 } 355 356 psPixelCoord psPixelsGet(const psPixels *pixels, 357 long position) 358 { 359 psPixelCoord out; 360 if (pixels == NULL) { 361 out.x = 0; //XXX: should be NAN when changed to float 362 out.y = 0; //XXX: should be NAN when changed to float 363 return out; 364 } 365 if (position >= pixels->n) { 366 out.x = 0; //XXX: should be NAN when changed to float 367 out.y = 0; //XXX: should be NAN when changed to float 368 return out; 369 } 370 if (position < 0) 371 position += pixels->n; 372 out.x = pixels->data[position].x; 373 out.y = pixels->data[position].y; 374 return out; 375 } 376 -
trunk/psLib/src/types/psPixels.h
r4898 r5101 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.1 2$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-0 8-30 01:14:13$9 * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-09-23 00:04:36 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 161 161 ); 162 162 163 /** Sets the value of the the pixels array at the specified position to value. 164 * 165 * A negative position means index from the end. 166 * 167 * @return bool: True if Successful, otherwise false. 168 */ 169 bool psPixelsSet( 170 psPixels *pixels, ///< pixels to set 171 long position, ///< position to set 172 psPixelCoord value ///< pixels value to be set 173 ); 174 175 /** Returns the value of the pixels array at the specified position. 176 * 177 * A negative position means index from the end. 178 * 179 * @return psPixelCoord: The value of the pixels at the specified position. 180 */ 181 psPixelCoord psPixelsGet( 182 const psPixels *pixels, ///< input pixels from which to get 183 long position ///< position to get 184 ); 185 163 186 #endif // #ifndef PS_PIXELS_H
Note:
See TracChangeset
for help on using the changeset viewer.
