IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 2200


Ignore:
Timestamp:
Oct 26, 2004, 12:32:09 PM (22 years ago)
Author:
gusciora
Message:

Added the plane transform alloc functions.

Location:
trunk/psLib/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/astro/psCoord.c

    r2199 r2200  
    1010*  @author George Gusciora, MHPCC
    1111*
    12 *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2004-10-26 21:57:42 $
     12*  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2004-10-26 22:32:09 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    6161/* FUNCTION IMPLEMENTATION - PUBLIC                                          */
    6262/*****************************************************************************/
     63static void planeTransformFree(psPlaneTransform *pt)
     64{
     65    psFree(pt->x);
     66    psFree(pt->y);
     67}
     68
     69psPlaneTransform* psPlaneTransformAlloc(int n1, int n2)
     70{
     71    psPlaneTransform *pt = psAlloc(sizeof(psPlaneTransform));
     72    pt->x = psDPolynomial2DAlloc(n1, n2, PS_POLYNOMIAL_ORD);
     73    pt->y = psDPolynomial2DAlloc(n1, n2, PS_POLYNOMIAL_ORD);
     74
     75    p_psMemSetDeallocator(pt, (psFreeFcn) planeTransformFree);
     76    return(pt);
     77}
     78
    6379psPlane* psPlaneTransformApply(psPlane* out,
    6480                               const psPlaneTransform* transform,
     
    7389    out->y = psDPolynomial2DEval(coords->x, coords->y, transform->y);
    7490    return (out);
     91}
     92
     93static void planeDistortFree(psPlaneDistort *pt)
     94{
     95    psFree(pt->x);
     96    psFree(pt->y);
     97}
     98
     99psPlaneDistort* psPlaneDistortAlloc(int n1, int n2, int n3, int n4)
     100{
     101    psPlaneDistort *pt = psAlloc(sizeof(psPlaneDistort));
     102    pt->x = psDPolynomial4DAlloc(n1, n2, n3, n4, PS_POLYNOMIAL_ORD);
     103    pt->y = psDPolynomial4DAlloc(n1, n2, n3, n4, PS_POLYNOMIAL_ORD);
     104
     105    p_psMemSetDeallocator(pt, (psFreeFcn) planeDistortFree);
     106    return(pt);
    75107}
    76108
  • trunk/psLib/src/astro/psCoord.h

    r2199 r2200  
    1010*  @author George Gusciora, MHPCC
    1111*
    12 *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2004-10-26 21:57:42 $
     12*  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2004-10-26 22:32:09 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    167167} psSphereOffsetUnit;
    168168
     169/** Allocates a psPlaneTransform transform.
     170 *
     171 *  @return psPlaneTransform*     resulting plane transform
     172 */
     173
     174psPlaneTransform* psPlaneTransformAlloc(
     175    int n1,  ///< The order of the x term in the transform.
     176    int n2   ///< The order of the y term in the transform.
     177);
     178
    169179/** Applies the psPlaneTransform transform to a specified coordinate
    170180 *
     
    176186    const psPlane* coords              ///< the coordinate to apply the transform above.
    177187);
     188
     189/** Allocates a psPlaneDistort transform.
     190 *
     191 *  @return psPlaneDistort*     resulting plane distort transform
     192 */
     193
     194psPlaneDistort* psPlaneDistortAlloc(
     195    int n1,  ///< The order of the w term in the transform.
     196    int n2,  ///< The order of the x term in the transform.
     197    int n3,  ///< The order of the y term in the transform.
     198    int n4   ///< The order of the z term in the transform.
     199);
     200
    178201
    179202/** Applies the psPlaneDistort transform to a specified coordinate
  • trunk/psLib/src/astronomy/psCoord.c

    r2199 r2200  
    1010*  @author George Gusciora, MHPCC
    1111*
    12 *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2004-10-26 21:57:42 $
     12*  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2004-10-26 22:32:09 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    6161/* FUNCTION IMPLEMENTATION - PUBLIC                                          */
    6262/*****************************************************************************/
     63static void planeTransformFree(psPlaneTransform *pt)
     64{
     65    psFree(pt->x);
     66    psFree(pt->y);
     67}
     68
     69psPlaneTransform* psPlaneTransformAlloc(int n1, int n2)
     70{
     71    psPlaneTransform *pt = psAlloc(sizeof(psPlaneTransform));
     72    pt->x = psDPolynomial2DAlloc(n1, n2, PS_POLYNOMIAL_ORD);
     73    pt->y = psDPolynomial2DAlloc(n1, n2, PS_POLYNOMIAL_ORD);
     74
     75    p_psMemSetDeallocator(pt, (psFreeFcn) planeTransformFree);
     76    return(pt);
     77}
     78
    6379psPlane* psPlaneTransformApply(psPlane* out,
    6480                               const psPlaneTransform* transform,
     
    7389    out->y = psDPolynomial2DEval(coords->x, coords->y, transform->y);
    7490    return (out);
     91}
     92
     93static void planeDistortFree(psPlaneDistort *pt)
     94{
     95    psFree(pt->x);
     96    psFree(pt->y);
     97}
     98
     99psPlaneDistort* psPlaneDistortAlloc(int n1, int n2, int n3, int n4)
     100{
     101    psPlaneDistort *pt = psAlloc(sizeof(psPlaneDistort));
     102    pt->x = psDPolynomial4DAlloc(n1, n2, n3, n4, PS_POLYNOMIAL_ORD);
     103    pt->y = psDPolynomial4DAlloc(n1, n2, n3, n4, PS_POLYNOMIAL_ORD);
     104
     105    p_psMemSetDeallocator(pt, (psFreeFcn) planeDistortFree);
     106    return(pt);
    75107}
    76108
  • trunk/psLib/src/astronomy/psCoord.h

    r2199 r2200  
    1010*  @author George Gusciora, MHPCC
    1111*
    12 *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2004-10-26 21:57:42 $
     12*  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2004-10-26 22:32:09 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    167167} psSphereOffsetUnit;
    168168
     169/** Allocates a psPlaneTransform transform.
     170 *
     171 *  @return psPlaneTransform*     resulting plane transform
     172 */
     173
     174psPlaneTransform* psPlaneTransformAlloc(
     175    int n1,  ///< The order of the x term in the transform.
     176    int n2   ///< The order of the y term in the transform.
     177);
     178
    169179/** Applies the psPlaneTransform transform to a specified coordinate
    170180 *
     
    176186    const psPlane* coords              ///< the coordinate to apply the transform above.
    177187);
     188
     189/** Allocates a psPlaneDistort transform.
     190 *
     191 *  @return psPlaneDistort*     resulting plane distort transform
     192 */
     193
     194psPlaneDistort* psPlaneDistortAlloc(
     195    int n1,  ///< The order of the w term in the transform.
     196    int n2,  ///< The order of the x term in the transform.
     197    int n3,  ///< The order of the y term in the transform.
     198    int n4   ///< The order of the z term in the transform.
     199);
     200
    178201
    179202/** Applies the psPlaneDistort transform to a specified coordinate
Note: See TracChangeset for help on using the changeset viewer.