コード例 #1
0
        /// <summary>
        ///      (1) This function is useful for selecting image files from a
        /// directory, where the integer %index is embedded into
        ///          the file name.
        ///      (2) This is typically done by generating the sarray using
        /// getNumberedPathnamesInDirectory(), so that the %index
        /// pathname would have the number %index in it.The size
        /// of the sarray should be the largest number(plus 1) appearing
        ///          in the file names, respecting the constraints in the
        /// call to getNumberedPathnamesInDirectory().
        ///      (3) Consequently, for some indices into the sarray, there may
        /// be no pathnames in the directory containing that number.
        /// By convention, we place empty C strings("") in those
        /// locations in the sarray, and it is not an error if such
        /// a string is encountered and no pix is returned.
        /// Therefore, the caller must verify that a pix is returned.
        ///      (4) See convertSegmentedPagesToPS() in src/psio1.c for an
        /// example of usage.
        /// </summary>
        /// <param name="sa">string array of full pathnames</param>
        /// <param name="index">index into pathname array</param>
        /// <returns>pix if OK; null if not found</returns>
        public static Pix pixReadIndexed(this Sarray sa, int index)
        {
            if (null == sa)
            {
                throw new ArgumentNullException("sa cannot be null.");
            }

            var pointer = Native.DllImports.pixReadIndexed((HandleRef)sa, index);

            if (IntPtr.Zero == pointer)
            {
                return(null);
            }
            else
            {
                return(new Pix(pointer));
            }
        }
コード例 #2
0
ファイル: RecogTrain.cs プロジェクト: bclgenki/tvn-cosine
 public static Pixa recogAddDigitPadTemplates(this L_Recog recog, Sarray sa)
 {
     throw new NotImplementedException();
 }
コード例 #3
0
 public static Pixa showExtractNumbers(this Pix pixs, Sarray sa, Boxaa baa, Numaa naa, out Pix ppixdb)
 {
     throw new NotImplementedException();
 }
コード例 #4
0
 // Greedy character splitting
 public static int recogCorrelationBestRow(this L_Recog recog, Pix pixs, out Boxa pboxa, out Numa pnascore, out Numa pnaindex, out Sarray psachar, int debug)
 {
     throw new NotImplementedException();
 }
コード例 #5
0
 public static int sarrayGetRefcount(this Sarray sa)
 {
     return(Native.DllImports.sarrayGetRefcount((HandleRef)sa));
 }
コード例 #6
0
 public static IntPtr sarrayGetArray(this Sarray sa, out int pnalloc, out int pn)
 {
     throw new NotImplementedException();
 }
コード例 #7
0
 public static int sarrayReplaceString(this Sarray sa, int index, string newstr, AccessAndStorageFlags copyflag)
 {
     return(Native.DllImports.sarrayReplaceString((HandleRef)sa, index, newstr, (int)copyflag));
 }
コード例 #8
0
 // Add/Remove string
 public static int sarrayAddString(this Sarray sa, string str, AccessAndStorageFlags copyflag)
 {
     return(Native.DllImports.sarrayAddString((HandleRef)sa, str, (int)copyflag));
 }
コード例 #9
0
 // Split string on separator list
 public static int sarraySplitString(this Sarray sa, string str, string separators)
 {
     throw new NotImplementedException();
 }
コード例 #10
0
 // Convert word sarray to(formatted) line sarray
 public static Sarray sarrayConvertWordsToLines(this Sarray sa, int linesize)
 {
     throw new NotImplementedException();
 }
コード例 #11
0
 // Pad an sarray to be the same size as another sarray
 public static int sarrayPadToSameSize(this Sarray sa1, Sarray sa2, string padstring)
 {
     throw new NotImplementedException();
 }
コード例 #12
0
 public static int sarrayAppendRange(this Sarray sa1, Sarray sa2, int start, int end)
 {
     throw new NotImplementedException();
 }
コード例 #13
0
 // Join 2 sarrays
 public static int sarrayJoin(this Sarray sa1, Sarray sa2)
 {
     throw new NotImplementedException();
 }
コード例 #14
0
 public static IntPtr sarrayToStringRange(this Sarray sa, int first, int nstrings, int addnlflag)
 {
     throw new NotImplementedException();
 }
コード例 #15
0
 // Conversion back to string
 public static IntPtr sarrayToString(this Sarray sa, int addnlflag)
 {
     throw new NotImplementedException();
 }
コード例 #16
0
 public static Sarray convertSortedToNumberedPathnames(this Sarray sa, int numpre, int numpost, int maxnum)
 {
     throw new NotImplementedException();
 }
コード例 #17
0
 public static Sarray sarrayClone(this Sarray sa)
 {
     throw new NotImplementedException();
 }
コード例 #18
0
 // Filter sarray
 public static Sarray sarraySelectBySubstring(this Sarray sain, string substr)
 {
     throw new NotImplementedException();
 }
コード例 #19
0
 public static IntPtr sarrayRemoveString(this Sarray sa, int index)
 {
     throw new NotImplementedException();
 }
コード例 #20
0
 public static Sarray sarraySelectByRange(this Sarray sain, int first, int last)
 {
     throw new NotImplementedException();
 }
コード例 #21
0
 public static int sarrayClear(this Sarray sa)
 {
     throw new NotImplementedException();
 }
コード例 #22
0
 public static int sarrayParseRange(this Sarray sa, int start, out int pactualstart, out int pend, out int pnewstart, string substr, int loc)
 {
     throw new NotImplementedException();
 }
コード例 #23
0
        public static string sarrayGetString(this Sarray sa, int index, AccessAndStorageFlags copyflag)
        {
            var pointer = Native.DllImports.sarrayGetString((HandleRef)sa, index, (int)copyflag);

            return(Marshal.PtrToStringAnsi(pointer));
        }
コード例 #24
0
 public static int sarrayWrite(string filename, Sarray sa)
 {
     return(Native.DllImports.sarrayWrite(filename, (HandleRef)sa));
 }
コード例 #25
0
 public static int sarrayChangeRefcount(this Sarray sa, int delta)
 {
     throw new NotImplementedException();
 }
コード例 #26
0
 public static int sarrayWriteStream(IntPtr fp, Sarray sa)
 {
     throw new NotImplementedException();
 }
コード例 #27
0
 public static int rchaExtract(this L_Rcha rcha, out Numa pnaindex, out Numa pnascore, out Sarray psatext, out Numa pnasample, out Numa pnaxloc, out Numa pnayloc, out Numa pnawidth)
 {
     throw new NotImplementedException();
 }
コード例 #28
0
 public static int sarrayWriteMem(out IntPtr pdata, IntPtr psize, Sarray sa)
 {
     throw new NotImplementedException();
 }
コード例 #29
0
ファイル: PixComp.cs プロジェクト: unitay/leptonica.net
 public static PixaComp pixacompCreateFromSA(this Sarray sa, int comptype)
 {
     throw new NotImplementedException();
 }
コード例 #30
0
 public static int sarrayAppend(string filename, Sarray sa)
 {
     throw new NotImplementedException();
 }