/// <summary>
        /// Detects the vertices of the supplied texture data. (PolygonDetectionType.Integrated)
        /// </summary>
        /// <param name="data">The texture data.</param>
        /// <param name="width">The texture width.</param>
        /// <returns></returns>
        public static Vertices DetectVertices(uint[] data, int width)
        {
            TextureConverter tc = new TextureConverter(data, width);

            List <DetectedVertices> detectedVerticesList = tc.DetectVertices();

            return(detectedVerticesList[0]);
        }
        /// <summary>
        /// Detects the vertices of the supplied texture data.
        /// </summary>
        /// <param name="data">The texture data.</param>
        /// <param name="width">The texture width.</param>
        /// <param name="holeDetection">if set to <c>true</c> it will perform hole detection.</param>
        /// <param name="hullTolerance">The hull tolerance.</param>
        /// <param name="alphaTolerance">The alpha tolerance.</param>
        /// <param name="multiPartDetection">if set to <c>true</c> it will perform multi part detection.</param>
        /// <returns></returns>
        public static List <Vertices> DetectVertices(uint[] data, int width, float hullTolerance,
                                                     byte alphaTolerance, bool multiPartDetection, bool holeDetection)
        {
            TextureConverter tc =
                new TextureConverter(data, width)
            {
                HullTolerance      = hullTolerance,
                AlphaTolerance     = alphaTolerance,
                MultipartDetection = multiPartDetection,
                HoleDetection      = holeDetection
            };

            List <DetectedVertices> detectedVerticesList = tc.DetectVertices();
            List <Vertices>         result = new List <Vertices>();

            for (int i = 0; i < detectedVerticesList.Count; i++)
            {
                result.Add(detectedVerticesList[i]);
            }

            return(result);
        }
Exemple #3
0
 /// <summary>
 /// Detects the vertices by analyzing the texture data.
 /// </summary>
 /// <param name="data">The texture data.</param>
 /// <param name="width">The texture width.</param>
 /// <param name="holeDetection">if set to <c>true</c> it will perform hole detection.</param>
 /// <returns></returns>
 public static Vertices CreatePolygon(uint[] data, int width, bool holeDetection)
 {
     return(TextureConverter.DetectVertices(data, width, holeDetection));
 }
Exemple #4
0
 /// <summary>
 /// Detects the vertices by analyzing the texture data.
 /// </summary>
 /// <param name="data">The texture data.</param>
 /// <param name="width">The texture width.</param>
 /// <param name="hullTolerance">The hull tolerance.</param>
 /// <param name="alphaTolerance">The alpha tolerance.</param>
 /// <param name="multiPartDetection">if set to <c>true</c> it will perform multi part detection.</param>
 /// <param name="holeDetection">if set to <c>true</c> it will perform hole detection.</param>
 /// <returns></returns>
 public static List <Vertices> CreatePolygon(uint[] data, int width, float hullTolerance,
                                             byte alphaTolerance, bool multiPartDetection, bool holeDetection)
 {
     return(TextureConverter.DetectVertices(data, width, hullTolerance, alphaTolerance,
                                            multiPartDetection, holeDetection));
 }
Exemple #5
0
 /// <summary>
 /// Detects the vertices by analyzing the texture data.
 /// </summary>
 /// <param name="data">The texture data.</param>
 /// <param name="width">The texture width.</param>
 /// <returns></returns>
 public static Vertices CreatePolygon(uint[] data, int width)
 {
     return(TextureConverter.DetectVertices(data, width));
 }