;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; LUSH Lisp Universal Shell
;;;   Copyright (C) 2002 Leon Bottou, Yann Le Cun, AT&T Corp, NECI.
;;; Includes parts of TL3:
;;;   Copyright (C) 1987-1999 Leon Bottou and Neuristique.
;;; Includes selected parts of SN3.2:
;;;   Copyright (C) 1991-2001 AT&T Corp.
;;;
;;; Includes information derived from the GSL (Gnu Scientific Library)
;;;   header files which are copyrighted and distributed under the GPL
;;;   by their respective authors.
;;;
;;; This program is free software; you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 2 of the License, or
;;; (at your option) any later version.
;;;
;;; This program is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with this program; if not, write to the Free Software
;;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(libload "opencv/cv-config")
(libload "libc/constants")


#? *** aux_const

;; dummy function that adds OpenCV C header files in C file
(eval `(de dummy_aux_const () ,cv-cpheader-cmd ()))

#? * (dummy_aux_const)

;; ********************************************************

;;**************************************************************************
;; constant defined in "#define   "

(defconstant "_StsMaskImg_"                        -100 )

(defconstant "IPL_StsOk"                             0 )
(defconstant "IPL_StsBackTrace"                     -1 )
(defconstant "IPL_StsError"                         -2 )
(defconstant "IPL_StsInternal"                      -3 )
(defconstant "IPL_StsNoMem"                         -4 )
(defconstant "IPL_StsBadArg"                        -5 )
(defconstant "IPL_StsBadFunc"                       -6 )
(defconstant "IPL_StsNoConv"                        -7 )
(defconstant "IPL_StsAutoTrace"                     -8 )

(defconstant "IPL_HeaderIsNull"                     -9 )
(defconstant "IPL_BadImageSize"                     -10 )
(defconstant "IPL_BadOffset"                        -11 )
(defconstant "IPL_BadDataPtr"                       -12 )
(defconstant "IPL_BadStep"                          -13 )
(defconstant "IPL_BadModelOrChSeq"                  -14 )
(defconstant "IPL_BadNumChannels"                   -15 )
(defconstant "IPL_BadNumChannel1U"                  -16 )
(defconstant "IPL_BadDepth"                         -17 )
(defconstant "IPL_BadAlphaChannel"                  -18 )
(defconstant "IPL_BadOrder"                         -19 )
(defconstant "IPL_BadOrigin"                        -20 )
(defconstant "IPL_BadAlign"                         -21 )
(defconstant "IPL_BadCallBack"                      -22 )
(defconstant "IPL_BadTileSize"                      -23 )
(defconstant "IPL_BadCOI"                           -24 )
(defconstant "IPL_BadROISize"                       -25 )

(defconstant "IPL_MaskIsTiled"                      -26 )

(defconstant "IPL_StsNullPtr"                       -27 )
(defconstant "IPL_StsVecLengthErr"                  -28 )
(defconstant "IPL_StsFilterStructContentErr"        -29 )
(defconstant "IPL_StsKernelStructContentErr"        -30 )
(defconstant "IPL_StsFilterOffsetErr"               -31 )

(defconstant "IPL_MaskBadImageSize"                 (+ @@IPL_BadImageSize    @@_StsMaskImg_) )
(defconstant "IPL_MaskBadOffset"                    (+ @@IPL_BadOffset       @@_StsMaskImg_) )
(defconstant "IPL_MaskBadDataPtr"                   (+ @@IPL_BadDataPtr      @@_StsMaskImg_) )
(defconstant "IPL_MaskBadStep"                      (+ @@IPL_BadStep         @@_StsMaskImg_) )
(defconstant "IPL_MaskBadModelOrChSeq"              (+ @@IPL_BadModelOrChSeq @@_StsMaskImg_) )
(defconstant "IPL_MaskBadNumChannels"               (+ @@IPL_BadNumChannels  @@_StsMaskImg_) )
(defconstant "IPL_MaskBadDepth"                     (+ @@IPL_BadDepth        @@_StsMaskImg_) )
(defconstant "IPL_MaskBadAlphaChannel"              (+ @@IPL_BadAlphaChannel @@_StsMaskImg_) )
(defconstant "IPL_MaskBadOrder"                     (+ @@IPL_BadOrder        @@_StsMaskImg_) )
(defconstant "IPL_MaskBadOrigin"                    (+ @@IPL_BadOrigin       @@_StsMaskImg_) )
(defconstant "IPL_MaskBadAlign"                     (+ @@IPL_BadAlign        @@_StsMaskImg_) )
(defconstant "IPL_MaskBadCOI"                       (+ @@IPL_BadCOI          @@_StsMaskImg_) )
(defconstant "IPL_MaskBadROISize"                   (+ @@IPL_BadROISize      @@_StsMaskImg_) )

(defconstant "IPL_ErrModeLeaf"                       0 )
(defconstant "IPL_ErrModeParent"                     1 )
(defconstant "IPL_ErrModeSilent"                     2 )

(defconstant "IPL_EPS"                              1.0E-12 )
(defconstant "IPL_PI"                               3.14159265358979324 )
(defconstant "IPL_2PI"                              6.28318530717958648 )
(defconstant "IPL_PI_2"                             1.57079632679489662 )
(defconstant "IPL_PI_4"                             0.785398163397448310 )

(defconstant "IPL_CSEQ_G"                            0x00000047 )
(defconstant "IPL_CSEQ_GRAY"                         0x59415247 )
(defconstant "IPL_CSEQ_BGR"                          0x00524742 )
(defconstant "IPL_CSEQ_BGRA"                         0x41524742 )
(defconstant "IPL_CSEQ_RGB"                          0x00424752 )
(defconstant "IPL_CSEQ_RGBA"                         0x41424752 )

(defconstant  "IPL_GAUSSIAN_5x5"                     7 )

(defconstant "CV_StsOk"                              0 )
(defconstant "CV_StsBackTrace"                      -1 )
(defconstant "CV_StsError"                          -2 )
(defconstant "CV_StsInternal"                       -3 )
(defconstant "CV_StsNoMem"                          -4 )
(defconstant "CV_StsBadArg"                         -5 )
(defconstant "CV_StsBadFunc"                        -6 )
(defconstant "CV_StsNoConv"                         -7 )
(defconstant "CV_StsAutoTrace"                      -8 )

(defconstant "CV_HeaderIsNull"                      -9 )
(defconstant "CV_BadImageSize"                      -10 )
(defconstant "CV_BadOffset"                         -11 )
(defconstant "CV_BadDataPtr"                        -12 )
(defconstant "CV_BadModelOrChSeq"                   -14 )
(defconstant "CV_BadNumChannel1U"                   -16 )
(defconstant "CV_BadAlphaChannel"                   -18 )
(defconstant "CV_BadOrigin"                         -20 )
(defconstant "CV_BadCallBack"                       -22 )
(defconstant "CV_BadCOI"                            -24 )

(defconstant "CV_MaskIsTiled"                       -26 )
(defconstant "CV_StsVecLengthErr"                   -28 )
(defconstant "CV_StsFilterStructContentErr"         -29 )
(defconstant "CV_StsKernelStructContentErr"         -30 )
(defconstant "CV_StsFilterOffsetErr"                -31 )

(defconstant "CV_StsBadSize"                        -201 )
(defconstant "CV_StsDivByZero"                      -202 )
(defconstant "CV_StsInplaceNotSupported"            -203 )
(defconstant "CV_StsObjectNotFound"                 -204 )
(defconstant "CV_StsUnmatchedFormats"               -205 )
(defconstant "CV_StsBadFlag"                        -206 )
(defconstant "CV_StsBadPoint"                       -207 )
(defconstant "CV_StsBadMask"                        -208 )
(defconstant "CV_StsUnmatchedSizes"                 -209 )
(defconstant "CV_StsUnsupportedFormat"              -210 )
(defconstant "CV_StsOutOfRange"                     -211 )

(defconstant "CV_ErrModeLeaf"                        0 )
(defconstant "CV_ErrModeParent"                      1 )
(defconstant "CV_ErrModeSilent"                      2 )
 
(defconstant "CV_SHIFT_NONE"                         2 )
(defconstant "CV_SHIFT_LEFT"                         1 )
(defconstant "CV_SHIFT_RIGHT"                        3 )
(defconstant "CV_SHIFT_UP"                           6 )
(defconstant "CV_SHIFT_DOWN"                        10 )
(defconstant "CV_SHIFT_LU"                           5 )
(defconstant "CV_SHIFT_RU"                           7 )
(defconstant "CV_SHIFT_LD"                           9 )
(defconstant "CV_SHIFT_RD"                          11 )
 
(defconstant "IPL_DEPTH_SIGN"                        0x80000000 )
(defconstant "IPL_DEPTH_MASK"                        0x7FFFFFFF )

(defconstant "IPL_DEPTH_1U"                          1 )
(defconstant "IPL_DEPTH_8U"                          8 )
(defconstant "IPL_DEPTH_16U"                        16 )
(defconstant "IPL_DEPTH_32F"                        32 )

(defconstant "IPL_DEPTH_8S"                         (bitor @@IPL_DEPTH_SIGN  8) )
(defconstant "IPL_DEPTH_16S"                        (bitor @@IPL_DEPTH_SIGN 16) )
(defconstant "IPL_DEPTH_32S"                        (bitor @@IPL_DEPTH_SIGN 32) )

(defconstant "IPL_DATA_ORDER_PIXEL"                  0 )
(defconstant "IPL_DATA_ORDER_PLANE"                  1 )

(defconstant "IPL_ORIGIN_TL"                         0 )
(defconstant "IPL_ORIGIN_BL"                         1 )

(defconstant "IPL_ALIGN_4BYTES"                      4 )
(defconstant "IPL_ALIGN_8BYTES"                      8 )
(defconstant "IPL_ALIGN_16BYTES"                    16 )
(defconstant "IPL_ALIGN_32BYTES"                    32 )

(defconstant "IPL_ALIGN_DWORD"                       @@IPL_ALIGN_4BYTES )
(defconstant "IPL_ALIGN_QWORD"                       @@IPL_ALIGN_8BYTES )

(defconstant "IPL_GET_TILE_TO_READ"                  1 )
(defconstant "IPL_GET_TILE_TO_WRITE"                 2 )
(defconstant "IPL_RELEASE_TILE"                      4 )

(defconstant "IPL_LUT_LOOKUP"                        0 )
(defconstant "IPL_LUT_INTER"                         1 )

(defconstant "IPL_BORDER_CONSTANT"                   0 )
(defconstant "IPL_BORDER_REPLICATE"                  1 )
(defconstant "IPL_BORDER_REFLECT"                    2 )
(defconstant "IPL_BORDER_WRAP"                       3 )


(defconstant "IPL_SIDE_TOP_INDEX"                    0 )
(defconstant "IPL_SIDE_BOTTOM_INDEX"                 1 )
(defconstant "IPL_SIDE_LEFT_INDEX"                   2 )
(defconstant "IPL_SIDE_RIGHT_INDEX"                  3 )

(defconstant "IPL_SIDE_TOP"                         (bitshl 1  @@IPL_SIDE_TOP_INDEX) )
(defconstant "IPL_SIDE_BOTTOM"                      (bitshl 1  @@IPL_SIDE_BOTTOM_INDEX) )
(defconstant "IPL_SIDE_LEFT"                        (bitshl 1  @@IPL_SIDE_LEFT_INDEX) )
(defconstant "IPL_SIDE_RIGHT"                       (bitshl 1  @@IPL_SIDE_RIGHT_INDEX) )
(defconstant "IPL_SIDE_ALL" (bitor @@IPL_SIDE_RIGHT  @@IPL_SIDE_TOP  @@IPL_SIDE_LEFT  @@IPL_SIDE_BOTTOM) )

(defconstant "IPL_IMAGE_HEADER"                      1 )
(defconstant "IPL_IMAGE_DATA"                        2 )
(defconstant "IPL_IMAGE_ROI"                         4 )
(defconstant "IPL_IMAGE_TILE"                        8 )
(defconstant "IPL_IMAGE_MASK"                       16 )
(defconstant "IPL_IMAGE_ALL" (bitor @@IPL_IMAGE_HEADER  @@IPL_IMAGE_DATA  @@IPL_IMAGE_TILE  @@IPL_IMAGE_ROI  @@IPL_IMAGE_MASK) )
(defconstant "IPL_IMAGE_ALL_WITHOUT_MASK" (bitor @@IPL_IMAGE_HEADER  @@IPL_IMAGE_DATA  @@IPL_IMAGE_TILE  @@IPL_IMAGE_ROI) )

(defconstant "IPL_PALCONV_NONE"                      0 )
(defconstant "IPL_PALCONV_POPULATE"                  1 )
(defconstant "IPL_PALCONV_MEDCUT"                    2 )

(defconstant "IPL_COMPOSITE_OVER"                    0 )
(defconstant "IPL_COMPOSITE_IN"                      1 )
(defconstant "IPL_COMPOSITE_OUT"                     2 )
(defconstant "IPL_COMPOSITE_ATOP"                    3 )
(defconstant "IPL_COMPOSITE_XOR"                     4 )
(defconstant "IPL_COMPOSITE_PLUS"                    5 )

(defconstant "IPL_SUM"                               0 )
(defconstant "IPL_SUMSQ"                             1 )
(defconstant "IPL_SUMSQROOT"                         2 )
(defconstant "IPL_MAX"                               3 )
(defconstant "IPL_MIN"                               4 )

(defconstant  "IPL_FFT_Forw"                         1 )
(defconstant  "IPL_FFT_Inv"                          2 )
(defconstant  "IPL_FFT_NoScale"                      4 )
(defconstant  "IPL_FFT_UseInt"                      16 )
(defconstant  "IPL_FFT_UseFloat"                    32 )
(defconstant  "IPL_FFT_Free"                       128 )

(defconstant  "IPL_DCT_Forward"                      1 )
(defconstant  "IPL_DCT_Inverse"                      2 )
(defconstant  "IPL_DCT_Free"                         8 )
(defconstant  "IPL_DCT_UseInpBuf"                   16 )

(defconstant "IPL_JITTER_NONE"                       0 )
(defconstant "IPL_DITHER_NONE"                       1 )
(defconstant "IPL_DITHER_FS"                         2 )
(defconstant "IPL_DITHER_JJH"                        4 )
(defconstant "IPL_DITHER_STUCKEY"                    8 )
(defconstant "IPL_DITHER_BAYER"                     16 )

(defconstant "IPL_INTER_NN"                          0 )
(defconstant "IPL_INTER_LINEAR"                      1 )
(defconstant "IPL_INTER_CUBIC"                       2 )
(defconstant "IPL_INTER_SUPER"                       3 )
(defconstant "IPL_SMOOTH_EDGE"                      16 )

(defconstant "IPL_WARP_R_TO_Q"                       0 )
(defconstant "IPL_WARP_Q_TO_R"                       1 )

(defconstant "IPL_C"                                 1 )
(defconstant "IPL_L1"                                2 )
(defconstant "IPL_L2"                                4 )
(defconstant "IPL_RELATIVE"                          8 )
(defconstant "IPL_RELATIVEC"                        (bitor @@IPL_RELATIVE  @@IPL_C ) )
(defconstant "IPL_RELATIVEL1"                       (bitor @@IPL_RELATIVE  @@IPL_L1 ) )
(defconstant "IPL_RELATIVEL2"                       (bitor @@IPL_RELATIVE  @@IPL_L2 ) )

(defconstant "CV_8U"                                 0 )
(defconstant "CV_8S"                                 1 )
(defconstant "CV_16S"                                2 )
(defconstant "CV_32S"                                3 )
(defconstant "CV_32F"                                4 )
(defconstant "CV_64F"                                5 )

(defconstant "CV_8UC1"                              (+ @@CV_8U   (* 0 8)) )
(defconstant "CV_8UC2"                              (+ @@CV_8U   (* 1 8)) )
(defconstant "CV_8UC3"                              (+ @@CV_8U   (* 2 8)) )
(defconstant "CV_8UC4"                              (+ @@CV_8U   (* 3 8)) )

(defconstant "CV_8SC1"                              (+ @@CV_8S   (* 0 8)) )
(defconstant "CV_8SC2"                              (+ @@CV_8S   (* 1 8)) )
(defconstant "CV_8SC3"                              (+ @@CV_8S   (* 2 8)) )
(defconstant "CV_8SC4"                              (+ @@CV_8S   (* 3 8)) )

(defconstant "CV_16SC1"                             (+ @@CV_16S  (* 0 8)) )
(defconstant "CV_16SC2"                             (+ @@CV_16S  (* 1 8)) )
(defconstant "CV_16SC3"                             (+ @@CV_16S  (* 2 8)) )
(defconstant "CV_16SC4"                             (+ @@CV_16S  (* 3 8)) )

(defconstant "CV_32SC1"                             (+ @@CV_32S  (* 0 8)) )
(defconstant "CV_32SC2"                             (+ @@CV_32S  (* 1 8)) )
(defconstant "CV_32SC3"                             (+ @@CV_32S  (* 2 8)) )
(defconstant "CV_32SC4"                             (+ @@CV_32S  (* 3 8)) )

(defconstant "CV_32FC1"                             (+ @@CV_32F  (* 0 8)) )
(defconstant "CV_32FC2"                             (+ @@CV_32F  (* 1 8)) )
(defconstant "CV_32FC3"                             (+ @@CV_32F  (* 2 8)) )
(defconstant "CV_32FC4"                             (+ @@CV_32F  (* 3 8)) )

(defconstant "CV_64FC1"                             (+ @@CV_64F  (* 0 8)) )
(defconstant "CV_64FC2"                             (+ @@CV_64F  (* 1 8)) )
(defconstant "CV_64FC3"                             (+ @@CV_64F  (* 2 8)) )
(defconstant "CV_64FC4"                             (+ @@CV_64F  (* 3 8)) )

(defconstant "IPL_DEPTH_64F"                         64 )

(defconstant "CV_AUTO_STEP"                          0x7fffffff )
;;(defconstant "CV_WHOLE_ARR"                          cvSlice( 0, 0x3fffffff ) )

(defconstant "CV_ARR_CN_MASK"                       (bitshl 3  3) )
(defconstant "CV_ARR_DEPTH_MASK"                     7 )
(defconstant "CV_ARR_TYPE_MASK"                     31 )
(defconstant "CV_ARR_FMT_MASK"                     511 )
(defconstant "CV_ARR_CONT_FLAG_SHIFT"                9 )
(defconstant "CV_ARR_CONT_FLAG"                     (bitshl 1  @@CV_ARR_CONT_FLAG_SHIFT) )

(defconstant "CV_ARR_MAGIC_MASK"                     0xFFFF0000 )
(defconstant "CV_ARR_MAGIC_VAL"                      0x42240000 )

(defconstant "CV_TERMCRIT_ITER"                      1 )
(defconstant "CV_TERMCRIT_NUMB"                      @@CV_TERMCRIT_ITER )
(defconstant "CV_TERMCRIT_EPS"                       2 )

(defconstant "CV_SQRT_MAGIC"                         0xbe6f0000 )

(defconstant "CV_FILLED"                            -1 )

(defconstant "CV_HIST_MAX_DIM"                       16 )

(defconstant "CV_SEQ_ELTYPE_BITS"                    5 )
(defconstant "CV_SEQ_ELTYPE_MASK"                  (- (bitshl 1 @@CV_SEQ_ELTYPE_BITS)  1) )

(defconstant "CV_SEQ_ELTYPE_POINT"                   1 )
(defconstant "CV_SEQ_ELTYPE_CODE"                    2 )
(defconstant "CV_SEQ_ELTYPE_PPOINT"                  3 )
(defconstant "CV_SEQ_ELTYPE_INDEX"                   4 )
(defconstant "CV_SEQ_ELTYPE_GRAPH_EDGE"              5 )
(defconstant "CV_SEQ_ELTYPE_GRAPH_VERTEX"            6 )
(defconstant "CV_SEQ_ELTYPE_TRIAN_ATR"               7 )
(defconstant "CV_SEQ_ELTYPE_CONNECTED_COMP"          8 )
(defconstant "CV_SEQ_ELTYPE_POINT3D"                 9 )

(defconstant "CV_SEQ_KIND_BITS"                      5 )
(defconstant "CV_SEQ_KIND_MASK"                     (bitshl (- (bitshl  1  @@CV_SEQ_KIND_BITS)  1) @@CV_SEQ_ELTYPE_BITS) )

(defconstant "CV_SEQ_KIND_SET"                      (bitshl 0  @@CV_SEQ_ELTYPE_BITS) )
(defconstant "CV_SEQ_KIND_CURVE"                    (bitshl 1  @@CV_SEQ_ELTYPE_BITS) )
(defconstant "CV_SEQ_KIND_BIN_TREE"                 (bitshl 2  @@CV_SEQ_ELTYPE_BITS) )
(defconstant "CV_SEQ_KIND_GRAPH"                    (bitshl 3  @@CV_SEQ_ELTYPE_BITS) )
(defconstant "CV_SEQ_KIND_SUBDIV2D"                 (bitshl 4  @@CV_SEQ_ELTYPE_BITS) )

(defconstant "CV_SEQ_FLAG_SHIFT"                    (+ @@CV_SEQ_KIND_BITS  @@CV_SEQ_ELTYPE_BITS) )

(defconstant "CV_SEQ_FLAG_CLOSED"                   (bitshl 1  @@CV_SEQ_FLAG_SHIFT) )
(defconstant "CV_SEQ_FLAG_SIMPLE"                   (bitshl 2  @@CV_SEQ_FLAG_SHIFT) )
(defconstant "CV_SEQ_FLAG_CONVEX"                   (bitshl 4  @@CV_SEQ_FLAG_SHIFT) )
(defconstant "CV_SEQ_FLAG_HOLE"                     (bitshl 8  @@CV_SEQ_FLAG_SHIFT) )

(defconstant "CV_GRAPH_FLAG_ORIENTED"               (bitshl 1  @@CV_SEQ_FLAG_SHIFT) )

(defconstant  "CV_GRAPH_ITEM_VISITED_FLAG"          (bitshl 1  31) )

(defconstant "CV_SEQ_POINT_SET"                     (bitor  @@CV_SEQ_KIND_SET     @@CV_SEQ_ELTYPE_POINT) )
(defconstant "CV_SEQ_POINT3D_SET"                   (bitor  @@CV_SEQ_KIND_SET     @@CV_SEQ_ELTYPE_POINT3D) )
(defconstant "CV_SEQ_POLYLINE"                      (bitor  @@CV_SEQ_KIND_CURVE   @@CV_SEQ_ELTYPE_POINT) )
(defconstant "CV_SEQ_POLYGON"                       (bitor  @@CV_SEQ_FLAG_CLOSED  @@CV_SEQ_POLYLINE ) )
(defconstant "CV_SEQ_CONTOUR"                       @@CV_SEQ_POLYGON )
(defconstant "CV_SEQ_SIMPLE_POLYGON"                (bitor  @@CV_SEQ_FLAG_SIMPLE  @@CV_SEQ_POLYGON  ) )
(defconstant "CV_SEQ_CHAIN"                         (bitor  @@CV_SEQ_KIND_CURVE   @@CV_SEQ_ELTYPE_CODE) )
(defconstant "CV_SEQ_CHAIN_CONTOUR"                 (bitor  @@CV_SEQ_FLAG_CLOSED  @@CV_SEQ_CHAIN) )
(defconstant "CV_SEQ_POLYGON_TREE"                  (bitor  @@CV_SEQ_KIND_BIN_TREE   @@CV_SEQ_ELTYPE_TRIAN_ATR) )
(defconstant "CV_SEQ_CONNECTED_COMP"                (bitor  @@CV_SEQ_KIND_SET   @@CV_SEQ_ELTYPE_CONNECTED_COMP) )

(defconstant "CV_SEQ_INDEX"                         (bitor  @@CV_SEQ_KIND_SET   @@CV_SEQ_ELTYPE_INDEX) )

(defconstant "CV_SEQ_TYPE_BITS"                      @@CV_SEQ_FLAG_SHIFT )
(defconstant "CV_SEQ_TYPE_MASK"                     (- (bitshl  1  @@CV_SEQ_TYPE_BITS)  1) )

(defconstant "CV_SEQ_SUBTYPE_BITS"                  (+  @@CV_SEQ_TYPE_BITS  10) )
(defconstant "CV_SEQ_SUBTYPE_MASK"                  (- (bitshl  1  @@CV_SEQ_SUBTYPE_BITS)  1) )

(defconstant "CV_AUTOSTEP"                           0x7fffffff )

(defconstant "CV_SCHARR"                             -1 )

(defconstant "CV_C"                                  1 )
(defconstant "CV_L1"                                 2 )
(defconstant "CV_L2"                                 4 )
(defconstant "CV_NORM_MASK"                          7 )
(defconstant "CV_RELATIVE"                           8 )
(defconstant "CV_DIFF"                               16 )

(defconstant "CV_DIFF_C"                            (bitor  @@CV_DIFF  @@CV_C) )
(defconstant "CV_DIFF_L1"                           (bitor  @@CV_DIFF  @@CV_L1) )
(defconstant "CV_DIFF_L2"                           (bitor  @@CV_DIFF  @@CV_L2) )
(defconstant "CV_RELATIVE_C"                        (bitor  @@CV_RELATIVE  @@CV_C) )
(defconstant "CV_RELATIVE_L1"                       (bitor  @@CV_RELATIVE  @@CV_L1) )
(defconstant "CV_RELATIVE_L2"                       (bitor  @@CV_RELATIVE  @@CV_L2) )

(defconstant  "CV_BGR2BGRA"                          0 )
(defconstant  "CV_RGB2RGBA"                          @@CV_BGR2BGRA )

(defconstant  "CV_BGRA2BGR"                          1 )
(defconstant  "CV_RGBA2RGB"                          @@CV_BGRA2BGR )

(defconstant  "CV_BGR2RGBA"                          2 )
(defconstant  "CV_RGB2BGRA"                          @@CV_BGR2RGBA )

(defconstant  "CV_RGBA2BGR"                          3 )
(defconstant  "CV_BGRA2RGB"                          @@CV_RGBA2BGR )

(defconstant  "CV_BGR2GRAY"                          4 )
(defconstant  "CV_RGB2GRAY"                          5 )

(defconstant  "CV_GRAY2BGR"                          6 )
(defconstant  "CV_GRAY2RGB"                          @@CV_GRAY2BGR )

(defconstant  "CV_BGR2BGR565"                        7 )
(defconstant  "CV_RGB2BGR565"                        8 )
(defconstant  "CV_BGR5652BGR"                        9 )
(defconstant  "CV_BGR5652RGB"                       10 )

(defconstant  "CV_BGR2RGB"                          11 )
(defconstant  "CV_RGB2BGR"                          @@CV_BGR2RGB )

(defconstant  "CV_BGR2XYZ"                           12 )
(defconstant  "CV_RGB2XYZ"                           13 )
(defconstant  "CV_XYZ2BGR"                           14 )
(defconstant  "CV_XYZ2RGB"                           15 )

(defconstant  "CV_BGR2YCrCb"                         16 )
(defconstant  "CV_RGB2YCrCb"                         17 )
(defconstant  "CV_YCrCb2BGR"                         18 )
(defconstant  "CV_YCrCb2RGB"                         19 )

(defconstant  "CV_BGR2HSV"                           20 )
(defconstant  "CV_RGB2HSV"                           21 )

(defconstant  "CV_BGR2Lab"                           22 )
(defconstant  "CV_RGB2Lab"                           23 )

(defconstant  "CV_GRAY2BGR565"                       24 )
(defconstant  "CV_GRAY2BGRA"                         25 )
(defconstant  "CV_GRAY2RGBA"                         @@CV_GRAY2BGRA )

(defconstant  "CV_BGR5652GRAY"                       26 )
(defconstant  "CV_BGRA2GRAY"                         27 )
(defconstant  "CV_RGBA2GRAY"                         28 )

(defconstant  "CV_BGRA2BGR565"                       29 )
(defconstant  "CV_RGBA2BGR565"                       30 )

(defconstant  "CV_COLORCVT_MAX"                      32 )

(defconstant  "CV_INTER_NN"                           0 )
(defconstant  "CV_INTER_LINEAR"                       1 )

(defconstant  "CV_CHECK_RANGE"                       1 )
(defconstant  "CV_CHECK_QUIET"                       2 )

(defconstant "CV_SUBDIV2D_VIRTUAL_POINT"             2 )

(defconstant "CV_CLOCKWISE"                          1 )
(defconstant "CV_COUNTER_CLOCKWISE"                  2 )

(defconstant "CV_DIST_MASK_3"                        3 )
(defconstant "CV_DIST_MASK_5"                        5 )

(defconstant "CV_LKFLOW_PYR_A_READY"                 1 )
(defconstant "CV_LKFLOW_PYR_B_READY"                 2 )
(defconstant "CV_LKFLOW_INITIAL_GUESSES"             4 )
(defconstant "CV_EIGOBJ_NO_CALLBACK"                 0 )
(defconstant "CV_EIGOBJ_INPUT_CALLBACK"              1 )
(defconstant "CV_EIGOBJ_OUTPUT_CALLBACK"             2 )
(defconstant "CV_EIGOBJ_BOTH_CALLBACK"               3 )
(defconstant "CV_SVD_MODIFY_A"                       1 )
(defconstant "CV_SVD_U_T"                            2 )
(defconstant "CV_SVD_V_T"                            4 )


;;******************************************************************************
;;  constants defined in enum types


(defconstant   "IPL_PREWITT_3x3_V"                           0)
(defconstant   "IPL_PREWITT_3x3_H"                           1)
(defconstant   "IPL_SOBEL_3x3_V"                             2)
(defconstant   "IPL_SOBEL_3x3_H"                             3)
(defconstant   "IPL_LAPLACIAN_3x3"                           4)
(defconstant   "IPL_LAPLACIAN_5x5"                           5)
(defconstant   "IPL_GAUSSIAN_3x3"                            6)
(defconstant   "IPL_GAUSSIAN_5x5"                            7)
(defconstant   "IPL_HIPASS_3x3"                              8)
(defconstant   "IPL_HIPASS_5x5"                              9)
(defconstant   "IPL_SHARPEN_3x3"                            10)

(defconstant    "IPL_WT_HAAR"                                0)
(defconstant    "IPL_WT_DAUBLET"                             1)
(defconstant    "IPL_WT_SYMMLET"                             2)
(defconstant    "IPL_WT_COIFLET"                             3)
(defconstant    "IPL_WT_VAIDYANATHAN"                        4)
(defconstant    "IPL_WT_BSPLINE"                             5)
(defconstant    "IPL_WT_BSPLINEDUAL"                         6)
(defconstant    "IPL_WT_LINSPLINE"                           7)
(defconstant    "IPL_WT_QUADSPLINE"                          8)
(defconstant    "IPL_WT_TYPE_UNKNOWN"                        9)

(defconstant    "IPL_WT_SYMMETRIC"                           0)
(defconstant    "IPL_WT_ANTISYMMETRIC"                       1)
(defconstant    "IPL_WT_ASYMMETRIC"                          2)
(defconstant    "IPL_WT_SYMM_UNKNOWN"                        3)

(defconstant    "IPL_WT_ORTHOGONAL"                          0)
(defconstant    "IPL_WT_BIORTHOGONAL"                        1)
(defconstant    "IPL_WT_NOORTHOGONAL"                        2)
(defconstant    "IPL_WT_ORTH_UNKNOWN"                        3)

(defconstant    "IPL_NOISE_UNIFORM"                          0)
(defconstant    "IPL_NOISE_GAUSSIAN"                         1)

(defconstant    "CV_DIST_USER"                        -1)
(defconstant    "CV_DIST_L1"                           1)
(defconstant    "CV_DIST_L2"                           2)
(defconstant    "CV_DIST_C"                            3)
(defconstant    "CV_DIST_L12"                          4)
(defconstant    "CV_DIST_FAIR"                         5)
(defconstant    "CV_DIST_WELSCH"                       6)

(defconstant    "CV_GAUSSIAN_5x5"                      7)

(defconstant    "CV_INPLACE_NOT_SUPPORTED_ERR"        -112)
(defconstant    "CV_UNMATCHED_ROI_ERR"                -111)
(defconstant    "CV_NOTFOUND_ERR"                     -110)
(defconstant    "CV_BADCONVERGENCE_ERR"               -109)

(defconstant    "CV_BADDEPTH_ERR"                     -107)
(defconstant    "CV_BADROI_ERR"                       -106)
(defconstant    "CV_BADHEADER_ERR"                    -105)
(defconstant    "CV_UNMATCHED_FORMATS_ERR"            -104)
(defconstant    "CV_UNSUPPORTED_COI_ERR"              -103)
(defconstant    "CV_UNSUPPORTED_CHANNELS_ERR"         -102)
(defconstant    "CV_UNSUPPORTED_DEPTH_ERR"            -101)
(defconstant    "CV_UNSUPPORTED_FORMAT_ERR"           -100)

(defconstant    "CV_BADARG_ERR"                       -49)
(defconstant    "CV_NOTDEFINED_ERR"                   -48)

(defconstant    "CV_BADCHANNELS_ERR"                  -47)
(defconstant    "CV_BADRANGE_ERR"                     -44)
(defconstant    "CV_BADSTEP_ERR"                      -29)

(defconstant    "CV_BADFLAG_ERR"                      -12)
(defconstant    "CV_DIV_BY_ZERO_ERR"                  -11)
(defconstant    "CV_BADCOEF_ERR"                      -10)

(defconstant    "CV_BADFACTOR_ERR"                    -7)
(defconstant    "CV_BADPOINT_ERR"                     -6)
(defconstant    "CV_BADSCALE_ERR"                     -4)
(defconstant    "CV_OUTOFMEM_ERR"                     -3)
(defconstant    "CV_NULLPTR_ERR"                      -2)
(defconstant    "CV_BADSIZE_ERR"                      -1)
(defconstant    "CV_NO_ERR"                            0)
(defconstant    "CV_OK"                        @@CV_NO_ERR)

(defconstant    "CV_COMP_CORREL"                       0)
(defconstant    "CV_COMP_CHISQR"                       1)
(defconstant    "CV_COMP_INTERSECT"                    2)

(defconstant    "CV_HIST_MEMALLOCATED"                 1)
(defconstant    "CV_HIST_HEADERALLOCATED"              2)
(defconstant    "CV_HIST_UNIFORM"                      4)
(defconstant    "CV_HIST_THRESHALLOCATED"              8)

(defconstant    "CV_HIST_ARRAY"                        0)
(defconstant    "CV_HIST_TREE"                         1)

(defconstant    "CV_VALUE"                             1)
(defconstant    "CV_ARRAY"                             2)

(defconstant    "CV_SHAPE_RECT"                        0)
(defconstant    "CV_SHAPE_CROSS"                       1)
(defconstant    "CV_SHAPE_ELLIPSE"                     2)
(defconstant    "CV_SHAPE_CUSTOM"                    100)

(defconstant    "CV_MOP_OPEN"                          2)
(defconstant    "CV_MOP_CLOSE"                         3)
(defconstant    "CV_MOP_GRADIENT"                      4)
(defconstant    "CV_MOP_TOPHAT"                        5)
(defconstant    "CV_MOP_BLACKHAT"                      6)

(defconstant    "CV_FONT_VECTOR0"                      0)

(defconstant    "CV_TM_SQDIFF"                         0)
(defconstant    "CV_TM_SQDIFF_NORMED"                  1)
(defconstant    "CV_TM_CCORR"                          2)
(defconstant    "CV_TM_CCORR_NORMED"                   3)
(defconstant    "CV_TM_CCOEFF"                         4)
(defconstant    "CV_TM_CCOEFF_NORMED"                  5)

(defconstant    "CV_PTLOC_ERROR"                      -2)
(defconstant    "CV_PTLOC_OUTSIDE_RECT"               -1)
(defconstant    "CV_PTLOC_INSIDE"                      0)
(defconstant    "CV_PTLOC_VERTEX"                      1)
(defconstant    "CV_PTLOC_ON_EDGE"                     2)

(defconstant    "CV_NEXT_AROUND_ORG"                   0x00)
(defconstant    "CV_NEXT_AROUND_DST"                   0x22)
(defconstant    "CV_PREV_AROUND_ORG"                   0x11)
(defconstant    "CV_PREV_AROUND_DST"                   0x33)
(defconstant    "CV_NEXT_AROUND_LEFT"                  0x13)
(defconstant    "CV_NEXT_AROUND_RIGHT"                 0x31)
(defconstant    "CV_PREV_AROUND_LEFT"                  0x20)
(defconstant    "CV_PREV_AROUND_RIGHT"                 0x02)

(defconstant    "CV_RETR_EXTERNAL"                     0)
(defconstant    "CV_RETR_LIST"                         1)
(defconstant    "CV_RETR_CCOMP"                        2)
(defconstant    "CV_RETR_TREE"                         3)

(defconstant    "CV_CHAIN_CODE"                        0)
(defconstant    "CV_CHAIN_APPROX_NONE"                 1)
(defconstant    "CV_CHAIN_APPROX_SIMPLE"               2)
(defconstant    "CV_CHAIN_APPROX_TC89_L1"              3)
(defconstant    "CV_CHAIN_APPROX_TC89_KCOS"            4)

(defconstant    "CV_POLY_APPROX_DP"                    0)

(defconstant    "CV_CONTOURS_MATCH_I1"                 1)
(defconstant    "CV_CONTOURS_MATCH_I2"                 2)
(defconstant    "CV_CONTOURS_MATCH_I3"                 3)

(defconstant    "CV_CONTOUR_TREES_MATCH_I1"            1)

(defconstant    "CV_THRESH_BINARY"                     0)
(defconstant    "CV_THRESH_BINARY_INV"                 1)
(defconstant    "CV_THRESH_TRUNC"                      2)
(defconstant    "CV_THRESH_TOZERO"                     3)
(defconstant    "CV_THRESH_TOZERO_INV"                 4)

(defconstant    "CV_STDDEV_ADAPTIVE_THRESH"            0)

(defconstant    "CV_RODRIGUES_M2V"                     0)
(defconstant    "CV_RODRIGUES_V2M"                     1)

;; ********************************************************

(dhc-make ()
  dummy_aux_const
)
