Пример #1
0
        // recogident.c (1168, 1)
        // rchaDestroy(prcha) as Object
        // rchaDestroy(L_RCHA **) as void
        ///  <summary>
        /// rchaDestroy()
        ///  </summary>
        ///  <remarks>
        ///  </remarks>
        ///  <include file="..\CHM_Help\IncludeComments.xml" path="Comments/rchaDestroy/*"/>
        ///  <param name="prcha">[in,out] - to be nulled</param>
        public static void rchaDestroy(
            ref L_Rcha prcha)
        {
            IntPtr prchaPtr = IntPtr.Zero;  if (prcha != null)

            {
                prchaPtr = prcha.Pointer;
            }

            Natives.rchaDestroy(ref prchaPtr);
            if (prchaPtr == IntPtr.Zero)
            {
                prcha = null;
            }
            else
            {
                prcha = new L_Rcha(prchaPtr);
            };
        }
Пример #2
0
        // recogident.c (1281, 1)
        // rchaExtract(rcha, pnaindex, pnascore, psatext, pnasample, pnaxloc, pnayloc, pnawidth) as int
        // rchaExtract(L_RCHA *, NUMA **, NUMA **, SARRAY **, NUMA **, NUMA **, NUMA **, NUMA **) as l_ok
        ///  <summary>
        /// (1) This returns clones of the number and string arrays.  They must
        /// be destroyed by the caller.
        ///  </summary>
        ///  <remarks>
        ///  </remarks>
        ///  <include file="..\CHM_Help\IncludeComments.xml" path="Comments/rchaExtract/*"/>
        ///  <param name="rcha">[in] - </param>
        ///  <param name="pnaindex">[out][optional] - indices of best templates</param>
        ///  <param name="pnascore">[out][optional] - correl scores of best templates</param>
        ///  <param name="psatext">[out][optional] - character strings of best templates</param>
        ///  <param name="pnasample">[out][optional] - indices of best samples</param>
        ///  <param name="pnaxloc">[out][optional] - x-locations of templates</param>
        ///  <param name="pnayloc">[out][optional] - y-locations of templates</param>
        ///  <param name="pnawidth">[out][optional] - widths of best templates</param>
        ///   <returns>0 if OK, 1 on error</returns>
        public static int rchaExtract(
            L_Rcha rcha,
            out Numa pnaindex,
            out Numa pnascore,
            out Sarray psatext,
            out Numa pnasample,
            out Numa pnaxloc,
            out Numa pnayloc,
            out Numa pnawidth)
        {
            if (rcha == null)
            {
                throw new ArgumentNullException("rcha cannot be Nothing");
            }

            IntPtr pnaindexPtr  = IntPtr.Zero;
            IntPtr pnascorePtr  = IntPtr.Zero;
            IntPtr psatextPtr   = IntPtr.Zero;
            IntPtr pnasamplePtr = IntPtr.Zero;
            IntPtr pnaxlocPtr   = IntPtr.Zero;
            IntPtr pnaylocPtr   = IntPtr.Zero;
            IntPtr pnawidthPtr  = IntPtr.Zero;
            int    _Result      = Natives.rchaExtract(rcha.Pointer, out pnaindexPtr, out pnascorePtr, out psatextPtr, out pnasamplePtr, out pnaxlocPtr, out pnaylocPtr, out pnawidthPtr);

            if (pnaindexPtr == IntPtr.Zero)
            {
                pnaindex = null;
            }
            else
            {
                pnaindex = new Numa(pnaindexPtr);
            };
            if (pnascorePtr == IntPtr.Zero)
            {
                pnascore = null;
            }
            else
            {
                pnascore = new Numa(pnascorePtr);
            };
            if (psatextPtr == IntPtr.Zero)
            {
                psatext = null;
            }
            else
            {
                psatext = new Sarray(psatextPtr);
            };
            if (pnasamplePtr == IntPtr.Zero)
            {
                pnasample = null;
            }
            else
            {
                pnasample = new Numa(pnasamplePtr);
            };
            if (pnaxlocPtr == IntPtr.Zero)
            {
                pnaxloc = null;
            }
            else
            {
                pnaxloc = new Numa(pnaxlocPtr);
            };
            if (pnaylocPtr == IntPtr.Zero)
            {
                pnayloc = null;
            }
            else
            {
                pnayloc = new Numa(pnaylocPtr);
            };
            if (pnawidthPtr == IntPtr.Zero)
            {
                pnawidth = null;
            }
            else
            {
                pnawidth = new Numa(pnawidthPtr);
            };

            return(_Result);
        }