Example #1
0
        /// <summary>
        /// Detects any edges within the image.
        /// </summary>
        /// <typeparam name="T">The pixel format.</typeparam>
        /// <typeparam name="TP">The packed format. <example>long, float.</example></typeparam>
        /// <param name="source">The image this method extends.</param>
        /// <param name="rectangle">
        /// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
        /// </param>
        /// <param name="filter">The filter for detecting edges.</param>
        /// <param name="progressHandler">A delegate which is called as progress is made processing the image.</param>
        /// <returns>The <see cref="Image{T,TP}"/>.</returns>
        public static Image <T, TP> DetectEdges <T, TP>(this Image <T, TP> source, Rectangle rectangle, IEdgeDetectorFilter <T, TP> filter, ProgressEventHandler progressHandler = null)
            where T : IPackedVector <TP>
            where TP : struct
        {
            filter.OnProgress += progressHandler;

            try
            {
                return(source.Process(rectangle, filter));
            }
            finally
            {
                filter.OnProgress -= progressHandler;
            }
        }
Example #2
0
 /// <summary>
 /// Detects any edges within the image.
 /// </summary>
 /// <typeparam name="T">The pixel format.</typeparam>
 /// <typeparam name="TP">The packed format. <example>long, float.</example></typeparam>
 /// <param name="source">The image this method extends.</param>
 /// <param name="filter">The filter for detecting edges.</param>
 /// <param name="progressHandler">A delegate which is called as progress is made processing the image.</param>
 /// <returns>The <see cref="Image{T,TP}"/>.</returns>
 public static Image <T, TP> DetectEdges <T, TP>(this Image <T, TP> source, IEdgeDetectorFilter <T, TP> filter, ProgressEventHandler progressHandler = null)
     where T : IPackedVector <TP>
     where TP : struct
 {
     return(DetectEdges(source, source.Bounds, filter, progressHandler));
 }
Example #3
0
 /// <summary>
 /// Detects any edges within the image.
 /// </summary>
 /// <typeparam name="TColor">The pixel format.</typeparam>
 /// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
 /// <param name="source">The image this method extends.</param>
 /// <param name="rectangle">
 /// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
 /// </param>
 /// <param name="filter">The filter for detecting edges.</param>
 /// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
 public static Image <TColor, TPacked> DetectEdges <TColor, TPacked>(this Image <TColor, TPacked> source, Rectangle rectangle, IEdgeDetectorFilter <TColor, TPacked> filter)
     where TColor : struct, IPackedPixel <TPacked>
     where TPacked : struct
 {
     return(source.Process(rectangle, filter));
 }
Example #4
0
 /// <summary>
 /// Detects any edges within the image.
 /// </summary>
 /// <typeparam name="TColor">The pixel format.</typeparam>
 /// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
 /// <param name="source">The image this method extends.</param>
 /// <param name="filter">The filter for detecting edges.</param>
 /// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
 public static Image <TColor, TPacked> DetectEdges <TColor, TPacked>(this Image <TColor, TPacked> source, IEdgeDetectorFilter <TColor, TPacked> filter)
     where TColor : struct, IPackedPixel <TPacked>
     where TPacked : struct
 {
     return(DetectEdges(source, source.Bounds, filter));
 }
        /// <summary>
        /// Detects any edges within the image.
        /// </summary>
        /// <param name="source">The image this method extends.</param>
        /// <param name="rectangle">
        /// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
        /// </param>
        /// <param name="filter">The filter for detecting edges.</param>
        /// <param name="progressHandler">A delegate which is called as progress is made processing the image.</param>
        /// <returns>The <see cref="Image"/>.</returns>
        public static Image DetectEdges(this Image source, Rectangle rectangle, IEdgeDetectorFilter filter, ProgressEventHandler progressHandler = null)
        {
            filter.OnProgress += progressHandler;

            try
            {
                return source.Process(rectangle, filter);
            }
            finally
            {
                filter.OnProgress -= progressHandler;
            }
        }
 /// <summary>
 /// Detects any edges within the image.
 /// </summary>
 /// <param name="source">The image this method extends.</param>
 /// <param name="filter">The filter for detecting edges.</param>
 /// <param name="progressHandler">A delegate which is called as progress is made processing the image.</param>
 /// <returns>The <see cref="Image"/>.</returns>
 public static Image DetectEdges(this Image source, IEdgeDetectorFilter filter, ProgressEventHandler progressHandler = null)
 {
     return DetectEdges(source, source.Bounds, filter, progressHandler);
 }