示例#1
0
        public static int dewarpaRestoreModels(this L_Dewarpa dewa)
        {
            if (null == dewa)
            {
                throw new ArgumentNullException("dewa cannot be null.");
            }

            return(Native.DllImports.dewarpaRestoreModels((HandleRef)dewa));
        }
示例#2
0
        // Query model status
        public static int dewarpaModelStatus(this L_Dewarpa dewa, int pageno, out int pvsuccess, out int phsuccess)
        {
            if (null == dewa)
            {
                throw new System.IO.FileNotFoundException("dewa cannot be null.");
            }

            return(Native.DllImports.dewarpaModelStatus((HandleRef)dewa, pageno, out pvsuccess, out phsuccess));
        }
示例#3
0
        public static int dewarpaInsertRefModels(this L_Dewarpa dewa, int notests, int debug)
        {
            if (null == dewa)
            {
                throw new ArgumentNullException("dewa cannot be null.");
            }

            return(Native.DllImports.dewarpaInsertRefModels((HandleRef)dewa, notests, debug));
        }
示例#4
0
        public static int dewarpaShowArrays(this L_Dewarpa dewa, float scalefact, int first, int last)
        {
            if (null == dewa)
            {
                throw new ArgumentNullException("dewa cannot be null.");
            }

            return(Native.DllImports.dewarpaShowArrays((HandleRef)dewa, scalefact, first, last));
        }
示例#5
0
        public static int dewarpaModelStats(this L_Dewarpa dewa, out int pnnone, out int pnvsuccess, out int pnvvalid, out int pnhsuccess, out int pnhvalid, out int pnref)
        {
            if (null == dewa)
            {
                throw new ArgumentNullException("fp, dewa cannot be null.");
            }

            return(Native.DllImports.dewarpaModelStats((HandleRef)dewa, out pnnone, out pnvsuccess, out pnvvalid, out pnhsuccess, out pnhvalid, out pnref));
        }
示例#6
0
        public static int dewarpShowResults(this L_Dewarpa dewa, Sarray sa, Boxa boxa, int firstpage, int lastpage, string pdfout)
        {
            if (null == dewa ||
                null == sa)
            {
                throw new ArgumentNullException("dewa, sa cannot be null.");
            }

            return(Native.DllImports.dewarpShowResults((HandleRef)dewa, (HandleRef)sa, (HandleRef)boxa, firstpage, lastpage, pdfout));
        }
示例#7
0
        // Dewarp debugging output
        public static int dewarpaInfo(IntPtr fp, L_Dewarpa dewa)
        {
            if (null == dewa ||
                IntPtr.Zero == fp)
            {
                throw new ArgumentNullException("fp, dewa cannot be null.");
            }

            return(Native.DllImports.dewarpaInfo(fp, (HandleRef)dewa));
        }
示例#8
0
        // Top-level single page dewarper
        public static int dewarpSinglePage(this Pix pixs, int thresh, int adaptive, int useboth, int check_columns, out Pix ppixd, out L_Dewarpa pdewa, int debug)
        {
            if (null == pixs)
            {
                throw new ArgumentNullException("pixs cannot be null.");
            }

            IntPtr ppixdPtr, pdewaPtr;
            var    success = Native.DllImports.dewarpSinglePage((HandleRef)pixs, thresh, adaptive, useboth, check_columns, out ppixdPtr, out pdewaPtr, debug);

            ppixd = new Pix(ppixdPtr);
            pdewa = new L_Dewarpa(pdewaPtr);

            return(success);
        }
示例#9
0
        public static int dewarpSinglePageRun(this Pix pixs, Pix pixb, L_Dewarpa dewa, out Pix ppixd, int debug)
        {
            if (null == pixs ||
                null == pixb ||
                null == dewa)
            {
                throw new ArgumentNullException("pixs, pixb,  cannot be null.");
            }

            IntPtr ppixdPtr;
            var    success = Native.DllImports.dewarpSinglePageRun((HandleRef)pixs, (HandleRef)pixb, (HandleRef)dewa, out ppixdPtr, debug);

            ppixd = new Pix(ppixdPtr);

            return(success);
        }
示例#10
0
        // Apply disparity array to pix
        public static int dewarpaApplyDisparity(this L_Dewarpa dewa, int pageno, Pix pixs, int grayin, int x, int y, out Pix ppixd, string debugfile)
        {
            if (null == pixs ||
                null == dewa)
            {
                throw new ArgumentNullException("pixs, dewa cannot be null.");
            }

            IntPtr ppixdPtr;
            var    success = Native.DllImports.dewarpaApplyDisparity((HandleRef)dewa, pageno, (HandleRef)pixs, grayin, x, y, out ppixdPtr, debugfile);

            if (IntPtr.Zero == ppixdPtr)
            {
                ppixd = null;
            }
            else
            {
                ppixd = new Pix(ppixdPtr);
            }
            return(success);
        }
示例#11
0
        // Apply disparity array to boxa
        public static int dewarpaApplyDisparityBoxa(this L_Dewarpa dewa, int pageno, Pix pixs, Boxa boxas, int mapdir, int x, int y, out Boxa pboxad, string debugfile)
        {
            if (null == pixs ||
                null == dewa ||
                null == boxas)
            {
                throw new ArgumentNullException("pixs, dewa, boxas cannot be null.");
            }

            IntPtr pboxadPtr;
            var    success = Native.DllImports.dewarpaApplyDisparityBoxa((HandleRef)dewa, pageno, (HandleRef)pixs, (HandleRef)boxas, mapdir, x, y, out pboxadPtr, debugfile);

            if (IntPtr.Zero == pboxadPtr)
            {
                pboxad = null;
            }
            else
            {
                pboxad = new Boxa(pboxadPtr);
            }
            return(success);
        }