private int Read(Point point)
        {
            if (m_imageEncoder.GetValue(point) != 1)
            {
                return(0);
            }

            m_imageEncoder.SetValue(point, value: 0);
            return(1);
        }
        public Point Search()
        {
            int imageWidth = m_imageEncoder.GetImageWidth();
            int imageHight = m_imageEncoder.GetImageHight();

            for (int i = 0; i < imageWidth; i++)
            {
                for (int j = 0; j < imageHight; j++)
                {
                    Point point = new Point(i, j);

                    int value = m_imageEncoder.GetValue(point);;

                    if (value == 1)
                    {
                        return(point);
                    }
                }
            }

            return(default(Point));
        }
        private int Read(Point point)
        {
            CellType value = (CellType)m_imageEncoder.GetValue(point);

            switch (value)
            {
            case CellType.Contour:
            case CellType.BlackPixel:
                m_imageEncoder.SetValue(point, value: (int)CellType.Contour);

                SavePosition(point);
                return(1);

            case CellType.WhitePixel:
                m_imageEncoder.SetValue(point, value: (int)CellType.ExternalContour);
                break;

            case CellType.ExternalContour:
                break;
            }

            return(0);
        }