From 67e12b95ea7b68f4904a7484d77ecfd787d16d0c Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Tue, 30 Oct 2007 09:05:31 +0000 Subject: * Optimized usings * Shortened type references * Removed redundant 'this' qualifier --- .../Terrain.BasicTerrain/libTerrainBSD/Channel/File.cs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/File.cs') diff --git a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/File.cs b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/File.cs index 5949759..b4eda47 100644 --- a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/File.cs +++ b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/File.cs @@ -27,9 +27,8 @@ */ using System; -using System.Collections.Generic; -using System.Text; using System.Drawing; +using System.Drawing.Imaging; namespace libTerrain { @@ -48,7 +47,7 @@ namespace libTerrain for (y = 0; y < bit.Height; y++) { Color val = bit.GetPixel(x, y); - chan.map[x, y] = (((double)val.R + (double)val.G + (double)val.B) / 3.0) / 255.0; + chan.map[x, y] = (((double) val.R + (double) val.G + (double) val.B)/3.0)/255.0; } } @@ -57,21 +56,21 @@ namespace libTerrain public void SaveImage(string filename) { - Channel outmap = this.Copy(); + Channel outmap = Copy(); outmap.Normalise(); - Bitmap bit = new Bitmap(w, h, System.Drawing.Imaging.PixelFormat.Format24bppRgb); + Bitmap bit = new Bitmap(w, h, PixelFormat.Format24bppRgb); int x, y; for (x = 0; x < w; x++) { for (y = 0; y < h; y++) { - int val = Math.Min(255, (int)(outmap.map[x,y] * 255)); - Color col = Color.FromArgb(val,val,val); + int val = Math.Min(255, (int) (outmap.map[x, y]*255)); + Color col = Color.FromArgb(val, val, val); bit.SetPixel(x, y, col); } } bit.Save(filename); } } -} +} \ No newline at end of file -- cgit v1.1