IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 809


Ignore:
Timestamp:
May 28, 2004, 11:07:17 AM (22 years ago)
Author:
desonia
Message:

Added mask related things and fixed coding style issues in psType.h

Location:
trunk/psLib/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/dataManip/psFFT.c

    r808 r809  
    55 *  @author Robert DeSonia, MHPCC
    66 *
    7  *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2004-05-28 21:04:34 $
     7 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2004-05-28 21:07:17 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    160160
    161161    /* if not a complex number, this is logically just a copy */
    162     if (! IS_PSELEMTYPE_COMPLEX(type)) {
     162    if (! PS_IS_PSELEMTYPE_COMPLEX(type)) {
    163163        // Warn user, as this is probably not expected
    164164        psLogMsg(__func__,PS_LOG_WARN,"Real portion of a non-Complex type called called for. "
     
    219219
    220220    /* if not a complex number, this is logically just zeroed image of same size */
    221     if (! IS_PSELEMTYPE_COMPLEX(type)) {
     221    if (! PS_IS_PSELEMTYPE_COMPLEX(type)) {
    222222        // Warn user, as this is probably not expected
    223223        psLogMsg(__func__,PS_LOG_WARN,"Imaginary portion of a non-Complex type called for. "
     
    285285    }
    286286
    287     if (IS_PSELEMTYPE_COMPLEX(type)) {
     287    if (PS_IS_PSELEMTYPE_COMPLEX(type)) {
    288288        psError(__func__,"The inputs to psImageComplex can not be complex.");
    289289        return NULL;
     
    352352
    353353    /* if not a complex number, this is logically just a image copy */
    354     if (! IS_PSELEMTYPE_COMPLEX(type)) {
     354    if (! PS_IS_PSELEMTYPE_COMPLEX(type)) {
    355355        // Warn user, as this is probably not expected
    356356        psLogMsg(__func__,PS_LOG_WARN,"Complex Conjugate of a non-Complex type called for. "
     
    414414
    415415    /* if not a complex number, this is not implemented */
    416     if (! IS_PSELEMTYPE_COMPLEX(type)) {
     416    if (! PS_IS_PSELEMTYPE_COMPLEX(type)) {
    417417        psError(__func__,"Power Spectrum for non-complex inputs is not implemented.");
    418418        return NULL;
  • trunk/psLib/src/dataManip/psVectorFFT.c

    r808 r809  
    55 *  @author Robert DeSonia, MHPCC
    66 *
    7  *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2004-05-28 21:04:34 $
     7 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2004-05-28 21:07:17 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    160160
    161161    /* if not a complex number, this is logically just a copy */
    162     if (! IS_PSELEMTYPE_COMPLEX(type)) {
     162    if (! PS_IS_PSELEMTYPE_COMPLEX(type)) {
    163163        // Warn user, as this is probably not expected
    164164        psLogMsg(__func__,PS_LOG_WARN,"Real portion of a non-Complex type called called for. "
     
    219219
    220220    /* if not a complex number, this is logically just zeroed image of same size */
    221     if (! IS_PSELEMTYPE_COMPLEX(type)) {
     221    if (! PS_IS_PSELEMTYPE_COMPLEX(type)) {
    222222        // Warn user, as this is probably not expected
    223223        psLogMsg(__func__,PS_LOG_WARN,"Imaginary portion of a non-Complex type called for. "
     
    285285    }
    286286
    287     if (IS_PSELEMTYPE_COMPLEX(type)) {
     287    if (PS_IS_PSELEMTYPE_COMPLEX(type)) {
    288288        psError(__func__,"The inputs to psImageComplex can not be complex.");
    289289        return NULL;
     
    352352
    353353    /* if not a complex number, this is logically just a image copy */
    354     if (! IS_PSELEMTYPE_COMPLEX(type)) {
     354    if (! PS_IS_PSELEMTYPE_COMPLEX(type)) {
    355355        // Warn user, as this is probably not expected
    356356        psLogMsg(__func__,PS_LOG_WARN,"Complex Conjugate of a non-Complex type called for. "
     
    414414
    415415    /* if not a complex number, this is not implemented */
    416     if (! IS_PSELEMTYPE_COMPLEX(type)) {
     416    if (! PS_IS_PSELEMTYPE_COMPLEX(type)) {
    417417        psError(__func__,"Power Spectrum for non-complex inputs is not implemented.");
    418418        return NULL;
  • trunk/psLib/src/fft/psVectorFFT.c

    r808 r809  
    55 *  @author Robert DeSonia, MHPCC
    66 *
    7  *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2004-05-28 21:04:34 $
     7 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2004-05-28 21:07:17 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    160160
    161161    /* if not a complex number, this is logically just a copy */
    162     if (! IS_PSELEMTYPE_COMPLEX(type)) {
     162    if (! PS_IS_PSELEMTYPE_COMPLEX(type)) {
    163163        // Warn user, as this is probably not expected
    164164        psLogMsg(__func__,PS_LOG_WARN,"Real portion of a non-Complex type called called for. "
     
    219219
    220220    /* if not a complex number, this is logically just zeroed image of same size */
    221     if (! IS_PSELEMTYPE_COMPLEX(type)) {
     221    if (! PS_IS_PSELEMTYPE_COMPLEX(type)) {
    222222        // Warn user, as this is probably not expected
    223223        psLogMsg(__func__,PS_LOG_WARN,"Imaginary portion of a non-Complex type called for. "
     
    285285    }
    286286
    287     if (IS_PSELEMTYPE_COMPLEX(type)) {
     287    if (PS_IS_PSELEMTYPE_COMPLEX(type)) {
    288288        psError(__func__,"The inputs to psImageComplex can not be complex.");
    289289        return NULL;
     
    352352
    353353    /* if not a complex number, this is logically just a image copy */
    354     if (! IS_PSELEMTYPE_COMPLEX(type)) {
     354    if (! PS_IS_PSELEMTYPE_COMPLEX(type)) {
    355355        // Warn user, as this is probably not expected
    356356        psLogMsg(__func__,PS_LOG_WARN,"Complex Conjugate of a non-Complex type called for. "
     
    414414
    415415    /* if not a complex number, this is not implemented */
    416     if (! IS_PSELEMTYPE_COMPLEX(type)) {
     416    if (! PS_IS_PSELEMTYPE_COMPLEX(type)) {
    417417        psError(__func__,"Power Spectrum for non-complex inputs is not implemented.");
    418418        return NULL;
  • trunk/psLib/src/sys/psType.h

    r800 r809  
    2020 *  @author Ross Harman, MHPCC
    2121 *
    22  *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    23  *  @date $Date: 2004-05-28 03:15:04 $
     22 *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     23 *  @date $Date: 2004-05-28 21:07:17 $
    2424 *
    2525 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    5656typedef complex double  psC64;          ///< complex with 64-bit floating point Real and Imagary numbers
    5757
     58
    5859typedef enum {
    59     PS_TYPE_INT8             = 0x0101,   ///< Character.
    60     PS_TYPE_INT16            = 0x0102,   ///< Short integer.
    61     PS_TYPE_INT32            = 0x0104,   ///< Integer.
    62     PS_TYPE_INT64            = 0x0108,   ///< Long integer.
    63     PS_TYPE_UINT8            = 0x0301,   ///< Unsigned character.
    64     PS_TYPE_UINT16           = 0x0302,   ///< Unsigned short integer.
    65     PS_TYPE_UINT32           = 0x0304,   ///< Unsigned integer.
    66     PS_TYPE_UINT64           = 0x0308,   ///< Unsigned long integer.
    67     PS_TYPE_FLOAT            = 0x0404,   ///< Single-precision Floating point.
    68     PS_TYPE_DOUBLE           = 0x0408,   ///< Double-precision floating point.
    69     PS_TYPE_COMPLEX_FLOAT    = 0x0808,   ///< Complex numbers consisting of single-precision floating point.
    70     PS_TYPE_COMPLEX_DOUBLE   = 0x0810,   ///< Complex numbers consisting of double-precision floating point.
    71     PS_TYPE_OTHER            = 0x0000,   ///< Something else that's not supported for arithmetic.
     60    PS_TYPE_INT8             = 0x0101,  ///< Character.
     61    PS_TYPE_INT16            = 0x0102,  ///< Short integer.
     62    PS_TYPE_INT32            = 0x0104,  ///< Integer.
     63    PS_TYPE_INT64            = 0x0108,  ///< Long integer.
     64    PS_TYPE_UINT8            = 0x0301,  ///< Unsigned character.
     65    PS_TYPE_UINT16           = 0x0302,  ///< Unsigned short integer.
     66    PS_TYPE_UINT32           = 0x0304,  ///< Unsigned integer.
     67    PS_TYPE_UINT64           = 0x0308,  ///< Unsigned long integer.
     68    PS_TYPE_FLOAT            = 0x0404,  ///< Single-precision Floating point.
     69    PS_TYPE_DOUBLE           = 0x0408,  ///< Double-precision floating point.
     70    PS_TYPE_COMPLEX_FLOAT    = 0x0808,  ///< Complex numbers consisting of single-precision floating point.
     71    PS_TYPE_COMPLEX_DOUBLE   = 0x0810,  ///< Complex numbers consisting of double-precision floating point.
     72    PS_TYPE_OTHER            = 0x0000,  ///< Something else that's not supported for arithmetic.
    7273
    7374    // Abbreviated versions of the above types
    74     PS_TYPE_S8               = 0x0101,   ///< Character.
    75     PS_TYPE_S16              = 0x0102,   ///< Short integer.
    76     PS_TYPE_S32              = 0x0104,   ///< Integer.
    77     PS_TYPE_S64              = 0x0108,   ///< Long integer.
    78     PS_TYPE_U8               = 0x0301,   ///< Unsigned character.
    79     PS_TYPE_U16              = 0x0302,   ///< Unsigned short integer.
    80     PS_TYPE_U32              = 0x0304,   ///< Unsigned integer.
    81     PS_TYPE_U64              = 0x0308,   ///< Unsigned long integer.
    82     PS_TYPE_F32              = 0x0404,   ///< Single-precision Floating point.
    83     PS_TYPE_F64              = 0x0408,   ///< Double-precision floating point.
    84     PS_TYPE_C32              = 0x0808,   ///< Complex numbers consisting of single-precision floating point.
    85     PS_TYPE_C64              = 0x0810,   ///< Complex numbers consisting of double-precision floating point.
    86     PS_TYPE_PTR              = 0x0000    ///< Something else that's not supported for arithmetic.
     75    PS_TYPE_S8               = 0x0101,  ///< Character.
     76    PS_TYPE_S16              = 0x0102,  ///< Short integer.
     77    PS_TYPE_S32              = 0x0104,  ///< Integer.
     78    PS_TYPE_S64              = 0x0108,  ///< Long integer.
     79    PS_TYPE_U8               = 0x0301,  ///< Unsigned character.
     80    PS_TYPE_U16              = 0x0302,  ///< Unsigned short integer.
     81    PS_TYPE_U32              = 0x0304,  ///< Unsigned integer.
     82    PS_TYPE_U64              = 0x0308,  ///< Unsigned long integer.
     83    PS_TYPE_F32              = 0x0404,  ///< Single-precision Floating point.
     84    PS_TYPE_F64              = 0x0408,  ///< Double-precision floating point.
     85    PS_TYPE_C32              = 0x0808,  ///< Complex numbers consisting of single-precision floating point.
     86    PS_TYPE_C64              = 0x0810,  ///< Complex numbers consisting of double-precision floating point.
     87    PS_TYPE_PTR              = 0x0000   ///< Something else that's not supported for arithmetic.
    8788
    8889} psElemType;
    8990
    90 #define IS_PSELEMTYPE_INT(x) ((x & 0x100) == 0x100)
    91 #define IS_PSELEMTYPE_UNSIGNED(x) ((x & 0x200) == 0x200)
    92 #define IS_PSELEMTYPE_REAL(x) ((x & 0x400) == 0x400)
    93 #define IS_PSELEMTYPE_COMPLEX(x) ((x & 0x800) == 0x800)
     91#define PS_TYPE_MASK PS_TYPE_U8         ///< the psElemType to use for mask image
     92typedef psU8 psMaskType;                ///< the C datatype for a mask image
     93
     94/// Macro to get the bad pixel reason code (stored as part of mask value)
     95#define PS_BADPIXEL_BITMASK 0x0f
     96#define PS_GET_BADPIXEL(maskValue) (maskValue & PS_BADPIXEL_BITMASK)
     97
     98#define PS_IS_BADPIXEL(maskValue) (PS_GET_BADPIXEL(maskValue) != 0)
     99
     100/// Macro to apply a bad pixel reason code to mask image
     101#define PS_SET_BADPIXEL(maskValue, reasonCode) \
     102{ \
     103    maskValue = (psMaskType)((reasonCode & PS_BADPIXEL_BITMASK) | (maskValue & ~PS_BADPIXEL_BITMASK)); \
     104}
     105
     106/// Macro to determine if the psElemType is an integer.
     107#define PS_IS_PSELEMTYPE_INT(x) ((x & 0x100) == 0x100)
     108/// Macro to determine if the psElemType is unsigned.
     109#define PS_IS_PSELEMTYPE_UNSIGNED(x) ((x & 0x200) == 0x200)
     110/// Macro to determine if the psElemType is a real (non-complex) floating-point type.
     111#define PS_IS_PSELEMTYPE_REAL(x) ((x & 0x400) == 0x400)
     112/// Macro to determine if the psElemType is complex number type.
     113#define PS_IS_PSELEMTYPE_COMPLEX(x) ((x & 0x800) == 0x800)
     114/// Macro to determine the storage size, in bytes, of the psElemType.
    94115#define PSELEMTYPE_SIZEOF(x) ( (x==PS_TYPE_PTR) ? sizeof(void*) :(x & 0xFF) )
    95116
  • trunk/psLib/src/sysUtils/psType.h

    r800 r809  
    2020 *  @author Ross Harman, MHPCC
    2121 *
    22  *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    23  *  @date $Date: 2004-05-28 03:15:04 $
     22 *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     23 *  @date $Date: 2004-05-28 21:07:17 $
    2424 *
    2525 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    5656typedef complex double  psC64;          ///< complex with 64-bit floating point Real and Imagary numbers
    5757
     58
    5859typedef enum {
    59     PS_TYPE_INT8             = 0x0101,   ///< Character.
    60     PS_TYPE_INT16            = 0x0102,   ///< Short integer.
    61     PS_TYPE_INT32            = 0x0104,   ///< Integer.
    62     PS_TYPE_INT64            = 0x0108,   ///< Long integer.
    63     PS_TYPE_UINT8            = 0x0301,   ///< Unsigned character.
    64     PS_TYPE_UINT16           = 0x0302,   ///< Unsigned short integer.
    65     PS_TYPE_UINT32           = 0x0304,   ///< Unsigned integer.
    66     PS_TYPE_UINT64           = 0x0308,   ///< Unsigned long integer.
    67     PS_TYPE_FLOAT            = 0x0404,   ///< Single-precision Floating point.
    68     PS_TYPE_DOUBLE           = 0x0408,   ///< Double-precision floating point.
    69     PS_TYPE_COMPLEX_FLOAT    = 0x0808,   ///< Complex numbers consisting of single-precision floating point.
    70     PS_TYPE_COMPLEX_DOUBLE   = 0x0810,   ///< Complex numbers consisting of double-precision floating point.
    71     PS_TYPE_OTHER            = 0x0000,   ///< Something else that's not supported for arithmetic.
     60    PS_TYPE_INT8             = 0x0101,  ///< Character.
     61    PS_TYPE_INT16            = 0x0102,  ///< Short integer.
     62    PS_TYPE_INT32            = 0x0104,  ///< Integer.
     63    PS_TYPE_INT64            = 0x0108,  ///< Long integer.
     64    PS_TYPE_UINT8            = 0x0301,  ///< Unsigned character.
     65    PS_TYPE_UINT16           = 0x0302,  ///< Unsigned short integer.
     66    PS_TYPE_UINT32           = 0x0304,  ///< Unsigned integer.
     67    PS_TYPE_UINT64           = 0x0308,  ///< Unsigned long integer.
     68    PS_TYPE_FLOAT            = 0x0404,  ///< Single-precision Floating point.
     69    PS_TYPE_DOUBLE           = 0x0408,  ///< Double-precision floating point.
     70    PS_TYPE_COMPLEX_FLOAT    = 0x0808,  ///< Complex numbers consisting of single-precision floating point.
     71    PS_TYPE_COMPLEX_DOUBLE   = 0x0810,  ///< Complex numbers consisting of double-precision floating point.
     72    PS_TYPE_OTHER            = 0x0000,  ///< Something else that's not supported for arithmetic.
    7273
    7374    // Abbreviated versions of the above types
    74     PS_TYPE_S8               = 0x0101,   ///< Character.
    75     PS_TYPE_S16              = 0x0102,   ///< Short integer.
    76     PS_TYPE_S32              = 0x0104,   ///< Integer.
    77     PS_TYPE_S64              = 0x0108,   ///< Long integer.
    78     PS_TYPE_U8               = 0x0301,   ///< Unsigned character.
    79     PS_TYPE_U16              = 0x0302,   ///< Unsigned short integer.
    80     PS_TYPE_U32              = 0x0304,   ///< Unsigned integer.
    81     PS_TYPE_U64              = 0x0308,   ///< Unsigned long integer.
    82     PS_TYPE_F32              = 0x0404,   ///< Single-precision Floating point.
    83     PS_TYPE_F64              = 0x0408,   ///< Double-precision floating point.
    84     PS_TYPE_C32              = 0x0808,   ///< Complex numbers consisting of single-precision floating point.
    85     PS_TYPE_C64              = 0x0810,   ///< Complex numbers consisting of double-precision floating point.
    86     PS_TYPE_PTR              = 0x0000    ///< Something else that's not supported for arithmetic.
     75    PS_TYPE_S8               = 0x0101,  ///< Character.
     76    PS_TYPE_S16              = 0x0102,  ///< Short integer.
     77    PS_TYPE_S32              = 0x0104,  ///< Integer.
     78    PS_TYPE_S64              = 0x0108,  ///< Long integer.
     79    PS_TYPE_U8               = 0x0301,  ///< Unsigned character.
     80    PS_TYPE_U16              = 0x0302,  ///< Unsigned short integer.
     81    PS_TYPE_U32              = 0x0304,  ///< Unsigned integer.
     82    PS_TYPE_U64              = 0x0308,  ///< Unsigned long integer.
     83    PS_TYPE_F32              = 0x0404,  ///< Single-precision Floating point.
     84    PS_TYPE_F64              = 0x0408,  ///< Double-precision floating point.
     85    PS_TYPE_C32              = 0x0808,  ///< Complex numbers consisting of single-precision floating point.
     86    PS_TYPE_C64              = 0x0810,  ///< Complex numbers consisting of double-precision floating point.
     87    PS_TYPE_PTR              = 0x0000   ///< Something else that's not supported for arithmetic.
    8788
    8889} psElemType;
    8990
    90 #define IS_PSELEMTYPE_INT(x) ((x & 0x100) == 0x100)
    91 #define IS_PSELEMTYPE_UNSIGNED(x) ((x & 0x200) == 0x200)
    92 #define IS_PSELEMTYPE_REAL(x) ((x & 0x400) == 0x400)
    93 #define IS_PSELEMTYPE_COMPLEX(x) ((x & 0x800) == 0x800)
     91#define PS_TYPE_MASK PS_TYPE_U8         ///< the psElemType to use for mask image
     92typedef psU8 psMaskType;                ///< the C datatype for a mask image
     93
     94/// Macro to get the bad pixel reason code (stored as part of mask value)
     95#define PS_BADPIXEL_BITMASK 0x0f
     96#define PS_GET_BADPIXEL(maskValue) (maskValue & PS_BADPIXEL_BITMASK)
     97
     98#define PS_IS_BADPIXEL(maskValue) (PS_GET_BADPIXEL(maskValue) != 0)
     99
     100/// Macro to apply a bad pixel reason code to mask image
     101#define PS_SET_BADPIXEL(maskValue, reasonCode) \
     102{ \
     103    maskValue = (psMaskType)((reasonCode & PS_BADPIXEL_BITMASK) | (maskValue & ~PS_BADPIXEL_BITMASK)); \
     104}
     105
     106/// Macro to determine if the psElemType is an integer.
     107#define PS_IS_PSELEMTYPE_INT(x) ((x & 0x100) == 0x100)
     108/// Macro to determine if the psElemType is unsigned.
     109#define PS_IS_PSELEMTYPE_UNSIGNED(x) ((x & 0x200) == 0x200)
     110/// Macro to determine if the psElemType is a real (non-complex) floating-point type.
     111#define PS_IS_PSELEMTYPE_REAL(x) ((x & 0x400) == 0x400)
     112/// Macro to determine if the psElemType is complex number type.
     113#define PS_IS_PSELEMTYPE_COMPLEX(x) ((x & 0x800) == 0x800)
     114/// Macro to determine the storage size, in bytes, of the psElemType.
    94115#define PSELEMTYPE_SIZEOF(x) ( (x==PS_TYPE_PTR) ? sizeof(void*) :(x & 0xFF) )
    95116
Note: See TracChangeset for help on using the changeset viewer.