コード例 #1
0
        public void Constructor()
        {
            WritableImage image = new WritableImage(gisImagePath);
            OutputRaster <Erdas74Pixel8> raster = new OutputRaster <Erdas74Pixel8>(image);

            raster.Close();
        }
コード例 #2
0
        public void Constructor()
        {
            ErdasImageFile image = new ErdasImageFile(gisImagePath, RWFlag.Write);
            OutputRaster <Erdas74Pixel8> raster = new OutputRaster <Erdas74Pixel8>(image);

            raster.Close();
        }
コード例 #3
0
        //---------------------------------------------------------------------

        /// <summary>
        /// Called when a partial output raster is closed.
        /// </summary>
        public static void Closed(OutputRaster outputRaster)
        {
            if (CloseEvent != null)
            {
                CloseEvent(outputRaster.Path, outputRaster.Dimensions,
                           outputRaster.PixelsWritten);
            }
        }
コード例 #4
0
        public void Dimensions()
        {
            WritableImage image = new WritableImage(gisImagePath);
            OutputRaster <Erdas74Pixel8> raster = new OutputRaster <Erdas74Pixel8>(image);

            Assert.AreEqual(60, raster.Dimensions.Rows);
            Assert.AreEqual(40, raster.Dimensions.Columns);
            raster.Close();
        }
コード例 #5
0
        public void Dimensions()
        {
            ErdasImageFile image = new ErdasImageFile(gisImagePath, RWFlag.Write);
            OutputRaster <Erdas74Pixel8> raster = new OutputRaster <Erdas74Pixel8>(image);

            Assert.AreEqual(60, raster.Dimensions.Rows);
            Assert.AreEqual(40, raster.Dimensions.Columns);
            raster.Close();
        }
コード例 #6
0
        public void Metadata()
        {
            WritableImage image = new WritableImage(gisImagePath);
            OutputRaster <Erdas74Pixel8> raster = new OutputRaster <Erdas74Pixel8>(image);

            double data = 0.0;

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

            raster.Close();
        }
コード例 #7
0
        public void WritePixels()
        {
            WritableImage image = new WritableImage(gisImagePath);
            OutputRaster <Erdas74Pixel8> raster = new OutputRaster <Erdas74Pixel8>(image);
            Erdas74Pixel8 pixel8    = new Erdas74Pixel8();
            int           totPixels = raster.Dimensions.Rows * raster.Dimensions.Columns;

            for (int i = 0; i < totPixels; i++)
            {
                raster.WritePixel(pixel8);
            }
            raster.Close();
        }
コード例 #8
0
        private void TryCtor <T>(string imagePath)
            where T : IPixel, new()
        {
            WritableImage image = null;

            try {
                image = new WritableImage(imagePath);
                OutputRaster <T> raster = new OutputRaster <T>(image);
            }
            catch (System.Exception exc) {
                Data.Output.WriteLine(exc.Message);
                throw;
            }
            finally {
                if (image != null)
                {
                    image.Close();
                }
            }
        }
コード例 #9
0
 public void WriteTooManyPixels()
 {
     try {
         WritableImage image = new WritableImage(gisImagePath);
         OutputRaster <Erdas74Pixel8> raster = new OutputRaster <Erdas74Pixel8>(image);
         using (raster) {
             Erdas74Pixel8 pixel8    = new Erdas74Pixel8();
             int           totPixels = raster.Dimensions.Rows * raster.Dimensions.Columns;
             for (int i = 0; i < totPixels; i++)
             {
                 raster.WritePixel(pixel8);
             }
             // write one too many
             raster.WritePixel(pixel8);
         }
     }
     catch (System.Exception exc) {
         Data.Output.WriteLine(exc.Message);
         throw;
     }
 }
コード例 #10
0
        private void TryCtor <T>(string imagePath,
                                 RWFlag rwFlag)
            where T : IPixel, new()
        {
            ErdasImageFile image = null;

            try {
                image = new ErdasImageFile(imagePath, rwFlag);
                OutputRaster <T> raster = new OutputRaster <T>(image);
            }
            catch (System.Exception exc) {
                Data.Output.WriteLine(exc.Message);
                throw;
            }
            finally {
                if (image != null)
                {
                    image.Close();
                }
            }
        }
コード例 #11
0
		//---------------------------------------------------------------------

		/// <summary>
		/// Called when a partial output raster is closed.
		/// </summary>
		public static void Closed(OutputRaster outputRaster)
		{
			if (CloseEvent != null)
				CloseEvent(outputRaster.Path, outputRaster.Dimensions,
				           outputRaster.PixelsWritten);
		}