Exemple #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));
            }
        }
Exemple #2
0
 public static Pixa recogAddDigitPadTemplates(this L_Recog recog, Sarray sa)
 {
     throw new NotImplementedException();
 }
Exemple #3
0
 public static Pixa showExtractNumbers(this Pix pixs, Sarray sa, Boxaa baa, Numaa naa, out Pix ppixdb)
 {
     throw new NotImplementedException();
 }
Exemple #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();
 }
Exemple #5
0
 public static int sarrayGetRefcount(this Sarray sa)
 {
     return(Native.DllImports.sarrayGetRefcount((HandleRef)sa));
 }
Exemple #6
0
 public static IntPtr sarrayGetArray(this Sarray sa, out int pnalloc, out int pn)
 {
     throw new NotImplementedException();
 }
Exemple #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));
 }
Exemple #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));
 }
Exemple #9
0
 // Split string on separator list
 public static int sarraySplitString(this Sarray sa, string str, string separators)
 {
     throw new NotImplementedException();
 }
Exemple #10
0
 // Convert word sarray to(formatted) line sarray
 public static Sarray sarrayConvertWordsToLines(this Sarray sa, int linesize)
 {
     throw new NotImplementedException();
 }
Exemple #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();
 }
Exemple #12
0
 public static int sarrayAppendRange(this Sarray sa1, Sarray sa2, int start, int end)
 {
     throw new NotImplementedException();
 }
Exemple #13
0
 // Join 2 sarrays
 public static int sarrayJoin(this Sarray sa1, Sarray sa2)
 {
     throw new NotImplementedException();
 }
Exemple #14
0
 public static IntPtr sarrayToStringRange(this Sarray sa, int first, int nstrings, int addnlflag)
 {
     throw new NotImplementedException();
 }
Exemple #15
0
 // Conversion back to string
 public static IntPtr sarrayToString(this Sarray sa, int addnlflag)
 {
     throw new NotImplementedException();
 }
Exemple #16
0
 public static Sarray convertSortedToNumberedPathnames(this Sarray sa, int numpre, int numpost, int maxnum)
 {
     throw new NotImplementedException();
 }
Exemple #17
0
 public static Sarray sarrayClone(this Sarray sa)
 {
     throw new NotImplementedException();
 }
Exemple #18
0
 // Filter sarray
 public static Sarray sarraySelectBySubstring(this Sarray sain, string substr)
 {
     throw new NotImplementedException();
 }
Exemple #19
0
 public static IntPtr sarrayRemoveString(this Sarray sa, int index)
 {
     throw new NotImplementedException();
 }
Exemple #20
0
 public static Sarray sarraySelectByRange(this Sarray sain, int first, int last)
 {
     throw new NotImplementedException();
 }
Exemple #21
0
 public static int sarrayClear(this Sarray sa)
 {
     throw new NotImplementedException();
 }
Exemple #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();
 }
Exemple #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));
        }
Exemple #24
0
 public static int sarrayWrite(string filename, Sarray sa)
 {
     return(Native.DllImports.sarrayWrite(filename, (HandleRef)sa));
 }
Exemple #25
0
 public static int sarrayChangeRefcount(this Sarray sa, int delta)
 {
     throw new NotImplementedException();
 }
Exemple #26
0
 public static int sarrayWriteStream(IntPtr fp, Sarray sa)
 {
     throw new NotImplementedException();
 }
Exemple #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();
 }
Exemple #28
0
 public static int sarrayWriteMem(out IntPtr pdata, IntPtr psize, Sarray sa)
 {
     throw new NotImplementedException();
 }
Exemple #29
0
 public static PixaComp pixacompCreateFromSA(this Sarray sa, int comptype)
 {
     throw new NotImplementedException();
 }
Exemple #30
0
 public static int sarrayAppend(string filename, Sarray sa)
 {
     throw new NotImplementedException();
 }