From 05e24c8f58e5cc41b3e7704b1912dfbe9703d4fe Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Mon, 21 Apr 2008 06:39:16 +0000 Subject: * Terrain Module code has been reformatted to comply with guidelines. * Fixed a variety of code quality issues. (Yes, I've found ReSharper.) --- .../Modules/Terrain/FileLoaders/JPEG.cs | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'OpenSim/Region/Environment/Modules/Terrain/FileLoaders/JPEG.cs') diff --git a/OpenSim/Region/Environment/Modules/Terrain/FileLoaders/JPEG.cs b/OpenSim/Region/Environment/Modules/Terrain/FileLoaders/JPEG.cs index d6430cd..f25b29b 100644 --- a/OpenSim/Region/Environment/Modules/Terrain/FileLoaders/JPEG.cs +++ b/OpenSim/Region/Environment/Modules/Terrain/FileLoaders/JPEG.cs @@ -26,8 +26,8 @@ */ using System; -using System.IO; using System.Drawing; +using System.Drawing.Imaging; using OpenSim.Region.Environment.Interfaces; namespace OpenSim.Region.Environment.Modules.Terrain.FileLoaders @@ -46,6 +46,15 @@ namespace OpenSim.Region.Environment.Modules.Terrain.FileLoaders throw new NotImplementedException(); } + public void SaveFile(string filename, ITerrainChannel map) + { + Bitmap colours = CreateBitmapFromMap(map); + + colours.Save(filename, ImageFormat.Jpeg); + } + + #endregion + public override string ToString() { return "JPEG"; @@ -70,20 +79,11 @@ namespace OpenSim.Region.Environment.Modules.Terrain.FileLoaders for (int x = 0; x < map.Width; x++) { // 512 is the largest possible height before colours clamp - int colorindex = (int)(Math.Max(Math.Min(1.0, map[x, y] / 512.0), 0.0) * (pallete - 1)); + int colorindex = (int) (Math.Max(Math.Min(1.0, map[x, y] / 512.0), 0.0) * (pallete - 1)); bmp.SetPixel(x, map.Height - y - 1, colours[colorindex]); } } return bmp; } - - public void SaveFile(string filename, ITerrainChannel map) - { - Bitmap colours = CreateBitmapFromMap(map); - - colours.Save(filename, System.Drawing.Imaging.ImageFormat.Jpeg); - } - - #endregion } -} +} \ No newline at end of file -- cgit v1.1