Exemplo n.º 1
0
 /// <summary>
 /// 別のCubeオブジェクトを連結
 /// </summary>
 /// <param name="other">別のCubeオブジェクト</param>
 public void Add(Cube other)
 {
     // ピクセルを連結
     Pixels.AddRange(other.Pixels);
     // 再度初期化する
     Initialize();
 }
Exemplo n.º 2
0
        /// <summary>
        /// Analyzes image by resizing it and storing pixels in list
        /// </summary>
        /// <param name="forceReanalyze">If true, the image is analyzed even if it's already been</param>
        public void AnalyzeImage(bool forceReanalyze = false)
        {
            if (Pixels.Count != 0 && !forceReanalyze)
            {
                return;
            }

            if (forceReanalyze && Pixels.Count > 0)
            {
                Pixels.Clear();
            }

            var image = GetImage();

            if (image == null)
            {
                // Image is invalid
                _isImage = false;
                return;
            }

            Pixels.AddRange(GetPixels(image));
        }
Exemplo n.º 3
0
 public Image(int size)
 {
     Pixels.AddRange(new int[size]);
 }