;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; 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")



#? *** viewmorphing

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

;; #? * (dummy_viewmorphing)

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

;;  /****************************************************************************************\
;;  *                                      ViewMorphing                                      *
;;  \****************************************************************************************/

#? * (cvfindfundamentalmatrix <points1> <points2> <npoints> <method> <matrix>)
;;.PRE
;;  OPENCVAPI  void  cvFindFundamentalMatrix( int*       points1,
;;                                          int*       points2,
;;                                          int        numpoints,
;;                                          int        method,
;;                                          float* matrix );

(de cvFindFundamentalMatrix (points1 points2 npoints method matrix)
    ((-gptr- "int *") points1 points2)
    ((-int-) npoints method)
    ((-gptr- "float *") matrix)
    #{ cvFindFundamentalMatrix($points1, $points2, $npoints, $method, $matrix);  #}
    ())

#? * (cvmakescanlines <matrix> <imgsize> <scanlines1> <scanlines2> <lens1> <lens2> <nlines>)
;;.PRE
;;  OPENCVAPI  void  cvMakeScanlines( const CvMatrix3* matrix,
;;                                  CvSize     imgSize,
;;                                  int*       scanlines_1,
;;                                  int*       scanlines_2,
;;                                  int*       lens_1,
;;                                  int*       lens_2,
;;                                  int*       numlines);

(de cvMakeScanlines(mat imgsize scanlines1 scanlines2 lens1 lens2 nlines)
    ((-gptr- "const CvMatrix3 *") mat)
    ((-gptr- "CvSize *") imgsize)
    ((-gptr- "int *") scanlines1 scanlines2 lens1 lens2 nlines)
    #{ cvMakeScanlines($mat, *$imgsize, $scanlines1, $scanlines2, $lens1, $lens2, $nlines);  #}
    ())

#? * (cvprewarpimage <nlines> <img> <dst> <ndst> <scanlines>)
;;.PRE
;;  OPENCVAPI  void  cvPreWarpImage( int       numLines,
;;                                 IplImage* img,
;;                                 uchar*    dst,
;;                                 int*      dst_nums,
;;                                 int*      scanlines);

(de cvPreWarpImage(nlines img dst ndst scanlines)
    ((-int-) nlines)
    ((-gptr- "IplImage *") img)
    ((-gptr- "uchar *") dst)
    ((-gptr- "int *") ndst scanlines)
    #{  cvPreWarpImage($nlines, $img, $dst, $ndst, $scanlines); #}
    ())

#? * (cvfindruns <nlines> <prewarp1> <prewarp2> <linelens1> <linelens2> <runs1> <runs2> <nruns1> <nruns2>)
;;.PRE
;;  OPENCVAPI  void  cvFindRuns( int    numLines,
;;                             uchar* prewarp_1,
;;                             uchar* prewarp_2,
;;                             int*   line_lens_1,
;;                             int*   line_lens_2,
;;                             int*   runs_1,
;;                             int*   runs_2,
;;                             int*   num_runs_1,
;;                             int*   num_runs_2);

(de cvFindRuns( nlines prewarp1 prewarp2 linelens1 linelens2 runs1 runs2 nruns1 nruns2)
    ((-int-) nlines)
    ((-gptr- "uchar *") prewarp1 prewarp2)
    ((-gptr- "int *") linelens1 linelens2 runs1 runs2 nruns1 nruns2)
    #{ cvFindRuns($nlines, $prewarp1, $prewarp2, $linelens1, $linelens2, $runs1, $runs2, $nruns1, $nruns2);  #}
    ())

#? * (cvdynamiccorrespondmulti <lines> <first> <firstruns> <second> <secondruns> <firstcorr> <secondcorr>)
;;.PRE
;;  OPENCVAPI  void  cvDynamicCorrespondMulti( int  lines,
;;                                           int* first,
;;                                           int* first_runs,
;;                                           int* second,
;;                                           int* second_runs,
;;                                           int* first_corr,
;;                                           int* second_corr);

(de cvDynamicCorrespondMulti(lines first firstruns second secondruns firstcorr secondcorr)
    ((-int-) lines)
    ((-gptr- "int *") first firstruns second secondruns firstcorr secondcorr)
    #{ cvDynamicCorrespondMulti($lines, $first, $firstruns, $second, $secondruns, $firstcorr, $secondcorr); #}
    ())


#? * (cvmakealphascanlines <scanlines1> <scanlines2> <scanlinesa> <lens> <nlines> <alpha>)
;;.PRE
;;  OPENCVAPI  void  cvMakeAlphaScanlines( int*  scanlines_1,
;;                                       int*  scanlines_2,
;;                                       int*  scanlines_a,
;;                                       int*  lens,
;;                                       int   numlines,
;;                                       float alpha);

(de cvMakeAlphaScanlines(scanlines1 scanlines2 scanlinesa lens nlines alpha)
    ((-gptr- "int *") scanlines1 scanlines2 scanlinesa lens)
    ((-int-) nlines)
    ((-float-) alpha)
    #{ cvMakeAlphaScanlines($scanlines1, $scanlines2, $scanlinesa, $lens, $nlines, $alpha); #}
    ())

#? * (cvmorphepilinesmulti <lines> <firstpix> <firstnum> <secondpix> <secondnum> <dstpix> <dstnum> <alpha> <first> <firstruns> <second> <secondruns> <firstcorr> <secondcorr>)
;;.PRE
;;  OPENCVAPI  void  cvMorphEpilinesMulti( int    lines,
;;                                       uchar* first_pix,
;;                                       int*   first_num,
;;                                       uchar* second_pix,
;;                                       int*   second_num,
;;                                       uchar* dst_pix,
;;                                       int*   dst_num,
;;                                       float  alpha,
;;                                       int*   first,
;;                                       int*   first_runs,
;;                                       int*   second,
;;                                       int*   second_runs,
;;                                       int*   first_corr,
;;                                       int*   second_corr);

(de cvMorphEpilinesMulti(lines firstpix firstnum secondpix secondnum dstpix dstnum alpha first firstruns second secondruns firstcorr secondcorr)
    ((-int-) lines)
    ((-gptr- "uchar *") firstpix secondpix dstpix )
    ((-gptr- "int *") firstnum secondnum dstnum first firstruns second secondruns firstcorr secondcorr)
    ((-float-) alpha)
    #{ cvMorphEpilinesMulti($lines,$firstpix, $firstnum, $secondpix, $secondnum, $dstpix, $dstnum, $alpha, $first, $firstruns, $second,$secondruns, $firstcorr, $secondcorr); #}
    ())

#? * (cvdeletemoire <img>)
;;.PRE
;;  OPENCVAPI  void  cvDeleteMoire( IplImage*  img);

(de cvDeleteMoire(img)
    ((-gptr- "IplImage *") img)
    #{ cvDeleteMoire($img); #}
    ())

#? * (cvpostwarpimage <nlines> <src> <srcnums> <img> <scanlines>)
;;.PRE
;;  OPENCVAPI  void  cvPostWarpImage( int       numLines,
;;                                  uchar*    src,
;;                                  int*      src_nums,
;;                                  IplImage* img,
;;                                  int*      scanlines);

(de cvPostWarpImage(nlines src srcnums img scanlines)
    ((-int-) nlines)
    ((-gptr- "uchar *") src)
    ((-gptr- "int *") srcnums)
    ((-gptr- "IplImage *") img)
    ((-gptr- "int *") scanlines)
    #{ cvPostWarpImage( $nlines, $src, $srcnums, $img, $scanlines); #}
    ())

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

(dhc-make ()
  dummy_viewmorphing
  cvfindfundamentalmatrix
  cvmakescanlines
  cvprewarpimage
  cvfindruns
  cvdynamiccorrespondmulti
  cvmakealphascanlines
  cvmorphepilinesmulti
  cvdeletemoire
  cvpostwarpimage
)
