IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 4, 2005, 11:37:01 AM (21 years ago)
Author:
Paul Price
Message:

Updated to psLib rel5alpha1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/stac/src/psPlaneTransform.c

    r2500 r3375  
    1 #include <stdio.h>
    2 #include "pslib.h"
    3 #include "stac.h"
    4 
    5 #define PS_INT_CHECK_NON_NEGATIVE(NAME, RVAL) \
    6 if (NAME < 0) { \
    7     psError("pslib.badValue", \
    8             "Error: %s is less than 0.", #NAME); \
    9     return(RVAL); \
    10 }
    11 
    12 static void planeTransformFree(psPlaneTransform *pt)
    13 {
    14     psFree(pt->x);
    15     psFree(pt->y);
    16 }
    17 
    18 psPlaneTransform* psPlaneTransformAlloc(psS32 n1, psS32 n2)
    19 {
    20     PS_INT_CHECK_NON_NEGATIVE(n1, NULL);
    21     PS_INT_CHECK_NON_NEGATIVE(n2, NULL);
    22 
    23     psPlaneTransform *pt = psAlloc(sizeof(psPlaneTransform));
    24     pt->x = psDPolynomial2DAlloc(n1, n2, PS_POLYNOMIAL_ORD);
    25     pt->y = psDPolynomial2DAlloc(n1, n2, PS_POLYNOMIAL_ORD);
    26 
    27     p_psMemSetDeallocator(pt, (psFreeFcn) planeTransformFree);
    28     return(pt);
    29 }
    30 
Note: See TracChangeset for help on using the changeset viewer.