public void Constructor()
        {
            ReadableImage image = new ReadableImage(gisImagePath);
            InputRaster <Erdas74Pixel8> raster = new InputRaster <Erdas74Pixel8>(image);

            raster.Close();
        }
        public void Constructor()
        {
            ErdasImageFile image = new ErdasImageFile(gisImagePath, RWFlag.Read);
            InputRaster <Erdas74Pixel8> raster = new InputRaster <Erdas74Pixel8>(image);

            raster.Close();
        }
        public void Dimensions()
        {
            ReadableImage image = new ReadableImage(gisImagePath);
            InputRaster <Erdas74Pixel8> raster = new InputRaster <Erdas74Pixel8>(image);

            Assert.AreEqual(60, raster.Dimensions.Rows);
            Assert.AreEqual(40, raster.Dimensions.Columns);
            raster.Close();
        }
        public void Dimensions()
        {
            ErdasImageFile image = new ErdasImageFile(gisImagePath, RWFlag.Read);
            InputRaster <Erdas74Pixel8> raster = new InputRaster <Erdas74Pixel8>(image);

            Assert.AreEqual(60, raster.Dimensions.Rows);
            Assert.AreEqual(40, raster.Dimensions.Columns);
            raster.Close();
        }
        public void Metadata()
        {
            ReadableImage image = new ReadableImage(gisImagePath);
            InputRaster <Erdas74Pixel8> raster = new InputRaster <Erdas74Pixel8>(image);

            double data = 0.0;

            Assert.AreEqual(false, raster.Metadata.TryGetValue <double>("Anything", ref data));

            raster.Close();
        }
        public void ReadPixels()
        {
            ReadableImage image = new ReadableImage(gisImagePath);
            InputRaster <Erdas74Pixel8> raster = new InputRaster <Erdas74Pixel8>(image);
            Erdas74Pixel8 pixel8    = new Erdas74Pixel8();
            int           totPixels = raster.Dimensions.Rows * raster.Dimensions.Columns;

            for (int i = 0; i < totPixels; i++)
            {
                pixel8 = raster.ReadPixel();
            }
            raster.Close();
        }
        private void TryCtor <T>(string imagePath)
            where T : IPixel, new()
        {
            ReadableImage image = null;

            try {
                image = new ReadableImage(imagePath);
                InputRaster <T> raster = new InputRaster <T>(image);
            }
            catch (System.Exception exc) {
                Data.Output.WriteLine(exc.Message);
                throw;
            }
            finally {
                if (image != null)
                {
                    image.Close();
                }
            }
        }
 public void ReadTooManyPixels()
 {
     try {
         ReadableImage image = new ReadableImage(gisImagePath);
         InputRaster <Erdas74Pixel8> raster = new InputRaster <Erdas74Pixel8>(image);
         using (raster) {
             Erdas74Pixel8 pixel8    = new Erdas74Pixel8();
             int           totPixels = raster.Dimensions.Rows * raster.Dimensions.Columns;
             for (int i = 0; i < totPixels; i++)
             {
                 pixel8 = raster.ReadPixel();
             }
             //one too many
             pixel8 = raster.ReadPixel();
         }
     }
     catch (System.Exception exc) {
         Data.Output.WriteLine(exc.Message);
         throw;
     }
 }
        private void TryCtor <T>(string imagePath,
                                 RWFlag rwFlag)
            where T : IPixel, new()
        {
            ErdasImageFile image = null;

            try {
                image = new ErdasImageFile(imagePath, rwFlag);
                InputRaster <T> raster = new InputRaster <T>(image);
            }
            catch (System.Exception exc) {
                Data.Output.WriteLine(exc.Message);
                throw;
            }
            finally {
                if (image != null)
                {
                    image.Close();
                }
            }
        }