⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ipl.h

📁 OPENCV系列的
💻 H
📖 第 1 页 / 共 3 页
字号:
/*
//
//               INTeL CORPORATION PROPRIETARY INFORMATION
//  This software is supplied under the terms of a license agreement or
//  nondisclosure agreement with Intel Corporation and may not be copied
//  or disclosed except in accordance with the terms of that agreement.
//        Copyright (c) 1995 Intel Corporation. All Rights Reserved.
//
//
//  Purpose: IPL Common Header file
//
*/

#if !defined (__IPL_H__) || defined (_OWN_BLDPCS)
#define __IPL_H__


#if defined( _WIN32 )
  #define __STDCALL __stdcall
  #define __CDECL __cdecl
  #define __INT64 __int64
#else
  #define __STDCALL
  #define __CDECL
  #define __INT64 long long
#endif

#if defined( _WIN32 )
  #define __INLINE static __inline
#elif defined( __ICC )
  #define __INLINE static __inline
#elif defined( __GNUC__ )
  #define __INLINE static __inline__
#else
  #define __INLINE static
#endif

#if defined( _VXWORKS )
    #include "types/vxTypesOld.h"
#endif

#if !defined (_INC_WINDOWS) && !defined (_WINDOWS_)
 #if !defined (IPL_WINDOWS) && defined( _WIN32 )
  #include <windows.h> /* include wingdi.h for BITMAPINFOHEADER declaration*/
 #else
  #include "iplwind.h" /* smaller file */
 #endif
#endif


#ifdef __cplusplus
extern "C" {
#endif

/*----------------------  IPLibrary call conversion  ----------------------*/
#if !defined IPLAPI
  #if defined(IPL_W32DLL)
    #ifndef __BORLANDC__
      #define IPLAPI(type,name,arg) \
                       extern __declspec(dllimport) type __STDCALL name arg;
    #else
      #define IPLAPI(type,name,arg)    extern type _import __STDCALL name arg;
    #endif
  #else
    #define IPLAPI(type,name,arg)            extern type __STDCALL name arg;
  #endif
#endif



/*==========================================================================
       Section: IPLibrary Definitions
 ==========================================================================*/

#define IPL_DEPTH_SIGN 0x80000000               
#define IPL_DEPTH_MASK 0x7FFFFFFF               

#define IPL_DEPTH_1U     1
#define IPL_DEPTH_8U     8
#define IPL_DEPTH_16U   16
#define IPL_DEPTH_32F   32

#define IPL_DEPTH_8S  (IPL_DEPTH_SIGN| 8)
#define IPL_DEPTH_16S (IPL_DEPTH_SIGN|16)
#define IPL_DEPTH_32S (IPL_DEPTH_SIGN|32)

#define IPL_DATA_ORDER_PIXEL  0
#define IPL_DATA_ORDER_PLANE  1

#define IPL_ORIGIN_TL 0
#define IPL_ORIGIN_BL 1

#define IPL_ALIGN_4BYTES   4
#define IPL_ALIGN_8BYTES   8
#define IPL_ALIGN_16BYTES 16
#define IPL_ALIGN_32BYTES 32

#define IPL_ALIGN_DWORD   IPL_ALIGN_4BYTES
#define IPL_ALIGN_QWORD   IPL_ALIGN_8BYTES

#define IPL_GET_TILE_TO_READ   1
#define IPL_GET_TILE_TO_WRITE  2
#define IPL_RELEASE_TILE       4

#define IPL_LUT_LOOKUP 0
#define IPL_LUT_INTER  1


 
/*==========================================================================
     Section: IPLibrary Types
 ==========================================================================*/

#if !defined _OWN_BLDPCS

  typedef int  IPLStatus;
  typedef unsigned char   uchar;

  #if defined( linux )
    #include <sys/types.h>
  #elif defined( _VXWORKS )
    typedef unsigned int    uint; 
  #else
    typedef unsigned short  ushort;
    typedef unsigned int    uint; 
  #endif

typedef struct _IplImage {
    int             nSize;              /* size of iplImage struct         */
    int             ID;                 /* version                         */
    int             nChannels;
    int             alphaChannel;
    int             depth;              /* pixel depth in bits             */
    char            colorModel[4];
    char            channelSeq[4];
    int             dataOrder;
    int             origin;
    int             align;              /* 4 or 8 byte align               */
    int             width;
    int             height;
    struct _IplROI *roi;
    struct _IplImage
                   *maskROI;            /* poiner to maskROI if any        */
    void           *imageId;            /* use of the application          */
    struct
      _IplTileInfo *tileInfo;           /* contains information on tiling  */
    int             imageSize;          /* useful size in bytes            */
    char           *imageData;          /* pointer to aligned image        */
    int             widthStep;          /* size of aligned line in bytes   */
    int             BorderMode[4];      /*                                 */
    int             BorderConst[4];     /*                                 */
    char           *imageDataOrigin;    /* ptr to full, nonaligned image   */
} IplImage;

typedef struct _IplROI {
    int             coi;
    int             xOffset;
    int             yOffset;
    int             width;
    int             height;
} IplROI;



/* /////////////////////////////////////////////////////////////////////////
// type IplCallBack
// Purpose:    Type of functions for access to external manager of tile
// Parameters: 
//   img           - header provided for the parent image
//   xIndex,yIndex - indices of the requested tile. They refer to the tile
//                   number not pixel number, and count from the origin at (0,0)
//   mode          - one of the following:
//    IPL_GET_TILE_TO_READ  - get a tile for reading;
//                            tile data is returned in "img->tileInfo->tileData",
//                            and must not be changed
//    IPL_GET_TILE_TO_WRITE - get a tile for writing;
//                            tile data is returned in "img->tileInfo->tileData"
//                            and may be changed;
//                            changes will be reflected in the image
//    IPL_RELEASE_TILE      - release tile; commit writes
//
// Notes: Memory pointers provided by a get function will not be used after the
//        corresponding release function has been called.
//
*/

typedef void (__STDCALL *IplCallBack)(const IplImage* img, int xIndex,
                                                          int yIndex, int mode);

typedef struct _IplTileInfo {
    IplCallBack     callBack;         /* callback function                  */
    void           *id;               /* additional identification field    */
    char           *tileData;         /* pointer on tile data               */
    int             width;            /* width of tile                      */
    int             height;           /* height of tile                     */
} IplTileInfo;

typedef struct _IplLUT {
    int             num;
    int            *key;
    int            *value;
    int            *factor;
    int             interpolateType;
} IplLUT;

typedef struct _IplColorTwist {
    int           data[16];
    int           scalingValue;
} IplColorTwist;


typedef struct _IplConvKernel {
    int           nCols;
    int           nRows;
    int           anchorX;
    int           anchorY;
    int          *values;
    int           nShiftR;
} IplConvKernel;

typedef struct _IplConvKernelFP {
    int           nCols;
    int           nRows;
    int           anchorX;
    int           anchorY;
    float        *values;
} IplConvKernelFP;

typedef enum {
    IPL_PREWITT_3x3_V=0,
        IPL_PREWITT_3x3_H,
        IPL_SOBEL_3x3_V,   /* vertical   */
        IPL_SOBEL_3x3_H,   /* horizontal */
        IPL_LAPLACIAN_3x3,
        IPL_LAPLACIAN_5x5,
        IPL_GAUSSIAN_3x3,
        IPL_GAUSSIAN_5x5,
        IPL_HIPASS_3x3,
        IPL_HIPASS_5x5,
        IPL_SHARPEN_3x3
} IplFilter;

/*-----------------  IplMomentState Structure Definition  -----------------*/
typedef struct {   
    double scale;  /* value to scale (m,n)th moment */
    double value;  /* spatial (m,n)th moment        */
} ownMoment;

typedef ownMoment IplMomentState[4][4];



/*==========================================================================
      Section: Wavelet transform constants and types.
 ==========================================================================*/
      

/*--------------------  Types of wavelet transforms.  ---------------------*/

typedef enum {
    IPL_WT_HAAR,
    IPL_WT_DAUBLET,
    IPL_WT_SYMMLET,
    IPL_WT_COIFLET,
    IPL_WT_VAIDYANATHAN,
    IPL_WT_BSPLINE,
    IPL_WT_BSPLINEDUAL,
    IPL_WT_LINSPLINE,
    IPL_WT_QUADSPLINE,
    IPL_WT_TYPE_UNKNOWN
} IplWtType;

/*-----------------------  Filters symmetry type.  ------------------------*/
typedef enum {
    IPL_WT_SYMMETRIC,
    IPL_WT_ANTISYMMETRIC,
    IPL_WT_ASYMMETRIC,
    IPL_WT_SYMM_UNKNOWN
} IplWtFiltSymm;


/*---------------------  Filter bank orthogonality.  ----------------------*/
typedef enum {
    IPL_WT_ORTHOGONAL,
    IPL_WT_BIORTHOGONAL,
    IPL_WT_NOORTHOGONAL,
    IPL_WT_ORTH_UNKNOWN
} IplWtOrthType;


/*--------------------------  Filter structure  ---------------------------*/
typedef struct {
    float        *taps;             /* filter taps                         */
    int           length;           /* length of filter                    */
    int           offset;           /* offset of filter                    */
    IplWtFiltSymm symmetry;         /* filter symmetry property            */
} IplWtFilter;


/*---------------  Wavelet functions interchange structure  ---------------*/
typedef struct {
    IplWtType     type;             /* type of wavelet transform           */
    int           par1;             /* first param.  (transform order)     */
    int           par2;             /* second param. (only for biorth. tr.)*/
    IplWtOrthType orth;             /* orthogonality property              */
    IplWtFilter   filtDecLow;       /* low-pass decomposition filter       */
    IplWtFilter   filtDecHigh;      /* high-pass decomposition filter      */
    IplWtFilter   filtRecLow;       /* low-pass reconstruction filter      */
    IplWtFilter   filtRecHigh;      /* high-pass reconstruction filter     */
} IplWtKernel;



/*---------------------  Noise generators structure  ----------------------*/
typedef enum {
    IPL_NOISE_UNIFORM,
    IPL_NOISE_GAUSSIAN
} IplNoise;

typedef struct _IplNoiseParam {
    IplNoise     noise;
    unsigned int seed;
    int          lowInt;
    int          highInt;
    float        lowFlt;
    float        highFlt;
} IplNoiseParam;



/*==========================================================================
      Section: User function types.
 ==========================================================================*/

/* /////////////////////////////////////////////////////////////////////////
// type IplUserFunc
// Purpose:    Type of callback functions for user point operation. 
//             Provides user to write his own code to process each channel of
//             srcImage pixel. This function would be passed to iplUserProcess 
//             function as its last parameter.
// Parameters: 
//   src         - value of src image pixel's channel converted to integer
// Returns:        value of dst image pixel's channel. You wouldn't support 
//                 value saturatation, it will be done by iplUserProcess function
//
// Notes: For more information see iplUserProcess function description
//
*/
typedef int   (__STDCALL *IplUserFunc)(int src);

/* /////////////////////////////////////////////////////////////////////////
// type IplUserFuncFP
// Purpose:    Type of callback functions for user point operation. 
//             Provides user to write his own code to process each channel
//             of srcImage pixel. This function would be passed to 
//             iplUserProcessFP function as its last parameter.
// Parameters: 
//   src         - value of src image pixel's channel converted to float
// Returns:        value of dst image pixel's channel. You wouldn't support 
//                 value saturatation for integer data types, it will be done 
//                 by iplUserProcessFP function
//
// Notes: For more information see iplUserProcessFP function description
//
*/
typedef float (__STDCALL *IplUserFuncFP)(float src);

/* /////////////////////////////////////////////////////////////////////////
// type IplUserFuncPixel
// Purpose:    Type of callback functions for user point operation. 
//             Provides user to write his own code to process all channels 
//             of srcImage pixel simultaneously. This function would be 
//             passed to iplUserProcessPixel function as its last parameter.
//             Function may call IPL_ERROR to set IplError status.
// Returns:  None
// Parameters: 
//   srcImage  - src image header to access image depth and number of channels
//   srcPixel  - pointer to array of src image pixel values. 
//               Function ought to convert this pointer to an array of src depth.               
//   dstImage  - dst image header to access image depth and number of channels
//   dstPixel  - pointer to array of dst image pixel values.
//               Function ought to convert this pointer to an array of dst depth.               
//
// Notes: For more information see iplUserProcessPixel function description
//
*/
typedef void  (__STDCALL *IplUserFuncPixel)(IplImage* srcImage, void* srcPixel, 
                                            IplImage* dstImage, void* dstPixel);

#endif

/*==========================================================================
      Section: Image Creation Functions
 ==========================================================================*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -