Exemple #1
0
 /// <summary>
 /// 1 This is buggy.  It seems to locate watersheds that are
 ///     duplicates.  The watershed extraction after complete fill
 ///     grabs some regions belonging to existing watersheds.
 ///     See prog/watershedtest.c for testing.
 /// </summary>
 /// <param name="wshed">generated from wshedCreate()</param>
 /// <returns>false if OK, true on error</returns>
 public static bool wshedApply(this L_WShed wshed)
 {
     if (null == wshed)
     {
         throw new ArgumentNullException("wshed cannot be null.");
     }
     return(Native.DllImports.wshedApply((HandleRef)wshed));
 }
Exemple #2
0
        // Output
        /// <summary>
        ///
        /// </summary>
        /// <param name="wshed"></param>
        /// <param name="ppixa">[optional] mask of watershed basins</param>
        /// <param name="pnalevels">[optional] watershed levels</param>
        /// <returns>false if OK, true on error</returns>
        public static bool wshedBasins(this L_WShed wshed, ref Pixa ppixa, ref Numa pnalevels)
        {
            if (null == wshed)
            {
                throw new ArgumentNullException("wshed cannot be null.");
            }

            IntPtr ppixaPtr     = (IntPtr)ppixa;
            IntPtr pnalevelsPtr = (IntPtr)pnalevels;

            return(Native.DllImports.wshedBasins((HandleRef)wshed, ref ppixaPtr, ref pnalevelsPtr));
        }
Exemple #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="pwshed">will be set to null before returning</param>
        public static void wshedDestroy(this L_WShed pwshed)
        {
            if (null == pwshed)
            {
                throw new ArgumentNullException("pwshed cannot be null");
            }

            var pointer = (IntPtr)pwshed;

            Native.DllImports.wshedDestroy(ref pointer);
            pwshed = null;
        }
Exemple #4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="wshed"></param>
        /// <returns>pixd initial image with all basins filled, or NULL on error</returns>
        public static Pix wshedRenderColors(this L_WShed wshed)
        {
            if (null == wshed)
            {
                throw new ArgumentNullException("wshed cannot be null.");
            }

            var pointer = Native.DllImports.wshedRenderColors((HandleRef)wshed);

            if (IntPtr.Zero == pointer)
            {
                return(null);
            }
            else
            {
                return(new Pix(pointer));
            }
        }