public void CreateMainMenu (Gtk.Menu menu) { menu.Append (CropToSelection.CreateAcceleratedMenuItem (Gdk.Key.X, Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask)); menu.Append (AutoCrop.CreateAcceleratedMenuItem (Gdk.Key.X, Gdk.ModifierType.Mod1Mask | Gdk.ModifierType.ControlMask)); menu.Append (Resize.CreateAcceleratedMenuItem (Gdk.Key.R, Gdk.ModifierType.ControlMask)); menu.Append (CanvasSize.CreateAcceleratedMenuItem (Gdk.Key.R, Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask)); menu.AppendSeparator (); menu.Append (FlipHorizontal.CreateMenuItem ()); menu.Append (FlipVertical.CreateMenuItem ()); menu.AppendSeparator (); menu.Append (RotateCW.CreateAcceleratedMenuItem (Gdk.Key.H, Gdk.ModifierType.ControlMask)); menu.Append (RotateCCW.CreateAcceleratedMenuItem (Gdk.Key.G, Gdk.ModifierType.ControlMask)); menu.Append (Rotate180.CreateAcceleratedMenuItem (Gdk.Key.J, Gdk.ModifierType.ControlMask)); menu.AppendSeparator (); menu.Append (Flatten.CreateAcceleratedMenuItem (Gdk.Key.F, Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask)); }
public void RegisterActions(Gtk.Application app, GLib.Menu menu) { app.AddAccelAction(CropToSelection, "<Primary><Shift>X"); menu.AppendItem(CropToSelection.CreateMenuItem()); app.AddAccelAction(AutoCrop, "<Ctrl><Alt>X"); menu.AppendItem(AutoCrop.CreateMenuItem()); app.AddAccelAction(Resize, "<Primary>R"); menu.AppendItem(Resize.CreateMenuItem()); app.AddAccelAction(CanvasSize, "<Primary><Shift>R"); menu.AppendItem(CanvasSize.CreateMenuItem()); var flip_section = new GLib.Menu(); menu.AppendSection(null, flip_section); app.AddAction(FlipHorizontal); flip_section.AppendItem(FlipHorizontal.CreateMenuItem()); app.AddAction(FlipVertical); flip_section.AppendItem(FlipVertical.CreateMenuItem()); var rotate_section = new GLib.Menu(); menu.AppendSection(null, rotate_section); app.AddAccelAction(RotateCW, "<Primary>H"); rotate_section.AppendItem(RotateCW.CreateMenuItem()); app.AddAccelAction(RotateCCW, "<Primary>G"); rotate_section.AppendItem(RotateCCW.CreateMenuItem()); app.AddAccelAction(Rotate180, "<Primary>J"); rotate_section.AppendItem(Rotate180.CreateMenuItem()); var flatten_section = new GLib.Menu(); menu.AppendSection(null, flatten_section); app.AddAccelAction(Flatten, "<Primary><Shift>F"); flatten_section.AppendItem(Flatten.CreateMenuItem()); }
public void PopulateEquirectangular() { var options = new EquirectangularOptions { AutoCrop = true, Tint = "ff0000", SpatialResolution = Constants.Satellite.SpatialResolution.FourKm, InterpolationType = InterpolationOptions.B, IntervalMinutes = 30, Brightness = 1.2f, Saturation = 0.5f, Force = true, Verbose = true, LongitudeRange = "-180:180", LatitudeRange = "-50:50" }; var renderOptions = OptionsParser.Populate(options); Assert.NotNull(renderOptions.EquirectangularRender); renderOptions.EquirectangularRender !.AutoCrop.Should().BeTrue(); Assert.NotNull(renderOptions.EquirectangularRender.LatitudeRange); Assert.NotNull(renderOptions.EquirectangularRender.LongitudeRange); renderOptions.EquirectangularRender.LatitudeRange !.Value.Start.Should().Be(Angle.FromDegrees(-50).Radians); renderOptions.EquirectangularRender.LatitudeRange !.Value.End.Should().Be(Angle.FromDegrees(50).Radians); renderOptions.EquirectangularRender.LongitudeRange !.Value.Start.Should().Be(Angle.FromDegrees(-180).Radians); renderOptions.EquirectangularRender.LongitudeRange !.Value.End.Should().Be(Angle.FromDegrees(180).Radians); renderOptions.SpatialResolution.Should().Be(Constants.Satellite.SpatialResolution.FourKm); renderOptions.Tint.Should().Be(Color.FromRgb(255, 0, 0)); renderOptions.InterpolationType.Should().Be(InterpolationType.Bilinear); renderOptions.ImageSize.Should().Be(Constants.Satellite.ImageSize.FourKm); renderOptions.ImageOffset.Should().Be(Constants.Satellite.Offset.FourKm); renderOptions.Interval.Should().Be(TimeSpan.FromMinutes(30)); renderOptions.Brightness.Should().Be(1.2f); renderOptions.Saturation.Should().Be(0.5f); renderOptions.Force.Should().BeTrue(); renderOptions.Verbose.Should().BeTrue(); }
// Real shape public Shape(string filePath, string sourceFolder, string targetFolder, int index, Point startingLocation) { var fileName = AutoCrop.FilepathToFilename(filePath, sourceFolder); var fileAsBitmap = AutoCrop.FilepathToBitmap(filePath); this.SourcePath = fileName; this.FileName = fileName; this.ImageRef = AutoCrop.TrimWhiteSpace(this, fileAsBitmap); this.BoundingBoxPoints = AutoCrop.GenerateBoundingBox(this, Config.BoundarBoxAccuracy); var processedPath = targetFolder + "//" + this.FileName + "_trimmed.png"; this.ProcessedPath = processedPath; this.ImageRef.Save(processedPath, ImageFormat.Png); this.Location = startingLocation; this.Rotation = 0; this.BestLocation = this.Location; this.Index = index; }