f-spot r4442 - in trunk/extensions/Editors: . BlackoutEditor PixelateEditor



Author: lmilesi
Date: Tue Sep 23 15:08:28 2008
New Revision: 4442
URL: http://svn.gnome.org/viewvc/f-spot?rev=4442&view=rev

Log:
2008-09-23  Lorenzo Milesi  <maxxer yetopen it>

        * BlackoutEditor/*:
        * PixelateEditor/*: two new editors from Brian J. Murrell. Fix
        bgo#552890.


Added:
   trunk/extensions/Editors/BlackoutEditor/
   trunk/extensions/Editors/BlackoutEditor/.gitignore
   trunk/extensions/Editors/BlackoutEditor/BlackoutEditor.addin.xml
   trunk/extensions/Editors/BlackoutEditor/BlackoutEditor.cs
   trunk/extensions/Editors/BlackoutEditor/Makefile
   trunk/extensions/Editors/PixelateEditor/
   trunk/extensions/Editors/PixelateEditor/.gitignore
   trunk/extensions/Editors/PixelateEditor/Makefile
   trunk/extensions/Editors/PixelateEditor/PixelateEditor.addin.xml
   trunk/extensions/Editors/PixelateEditor/PixelateEditor.cs
Modified:
   trunk/extensions/Editors/ChangeLog

Added: trunk/extensions/Editors/BlackoutEditor/.gitignore
==============================================================================
--- (empty file)
+++ trunk/extensions/Editors/BlackoutEditor/.gitignore	Tue Sep 23 15:08:28 2008
@@ -0,0 +1 @@
+/BlackoutEditor.dll

Added: trunk/extensions/Editors/BlackoutEditor/BlackoutEditor.addin.xml
==============================================================================
--- (empty file)
+++ trunk/extensions/Editors/BlackoutEditor/BlackoutEditor.addin.xml	Tue Sep 23 15:08:28 2008
@@ -0,0 +1,15 @@
+<Addin namespace="FSpot"
+	id="BlackoutEditor"
+	version="0.5.0.0"
+	name="BlackoutEditor"
+	description="Blacks out an area of the image."
+	author="Brian J. Murrell"
+	url="http://f-spot.org/Extensions";
+	category="Editors">
+	<Dependencies>
+		<Addin id="Core" version="0.5.0.0"/>
+	</Dependencies>
+	<Extension path = "/FSpot/Editors">
+		<Editor editor_type = "FSpot.Addins.Editors.BlackoutEditor"/>
+	</Extension>
+</Addin>

Added: trunk/extensions/Editors/BlackoutEditor/BlackoutEditor.cs
==============================================================================
--- (empty file)
+++ trunk/extensions/Editors/BlackoutEditor/BlackoutEditor.cs	Tue Sep 23 15:08:28 2008
@@ -0,0 +1,42 @@
+/*
+ * BlackoutEditor.cs
+ *
+ * Author(s)
+ * 	Brian J. Murrell <brian interlinx bc ca>
+ *
+ * This is free software. See COPYING for details.
+ */
+
+using FSpot;
+using FSpot.Editors;
+using Gdk;
+using Gtk;
+using Mono.Unix;
+
+namespace FSpot.Addins.Editors {
+	class BlackoutEditor : Editor {
+		public BlackoutEditor () : base (Catalog.GetString ("Blackout"), null) {
+			CanHandleMultiple = false;
+			NeedsSelection = true;
+		}
+
+		public override Widget ConfigurationWidget () {
+			VBox vbox = new VBox ();
+
+			Label info = new Label (Catalog.GetString ("Select the area that you want blacked out."));
+
+			vbox.Add (info);
+
+			return vbox;
+		}
+
+		protected override Pixbuf Process (Pixbuf input, Cms.Profile input_profile) {
+			Pixbuf output = input.Copy ();
+
+			Pixbuf sub = new Pixbuf (output, State.Selection.x, State.Selection.y,
+					State.Selection.width, State.Selection.height);
+			sub.Fill (0x00000000);
+			return output;
+		}
+	}
+}

Added: trunk/extensions/Editors/BlackoutEditor/Makefile
==============================================================================
--- (empty file)
+++ trunk/extensions/Editors/BlackoutEditor/Makefile	Tue Sep 23 15:08:28 2008
@@ -0,0 +1,29 @@
+all: BlackoutEditor.dll
+
+PACKAGES = \
+	-pkg:f-spot \
+	-pkg:gtk-sharp-2.0
+
+ASSEMBLIES = \
+	-r:Mono.Posix
+
+RESOURCES = \
+	-resource:BlackoutEditor.addin.xml
+
+SOURCES = \
+	BlackoutEditor.cs
+
+install: all
+	cp *.dll ~/.gnome2/f-spot/addins/
+
+mpack: BlackoutEditor.dll
+	mautil p BlackoutEditor.dll
+
+BlackoutEditor.dll: $(SOURCES) BlackoutEditor.addin.xml
+	gmcs -target:library $(SOURCES) $(PACKAGES) $(ASSEMBLIES) $(RESOURCES)
+
+clean:
+	rm -f *.dll *~ *.bak .mpack
+
+PHONY:
+	install clean all mpack

Added: trunk/extensions/Editors/PixelateEditor/.gitignore
==============================================================================
--- (empty file)
+++ trunk/extensions/Editors/PixelateEditor/.gitignore	Tue Sep 23 15:08:28 2008
@@ -0,0 +1 @@
+/PixelateEditor.dll

Added: trunk/extensions/Editors/PixelateEditor/Makefile
==============================================================================
--- (empty file)
+++ trunk/extensions/Editors/PixelateEditor/Makefile	Tue Sep 23 15:08:28 2008
@@ -0,0 +1,29 @@
+all: PixelateEditor.dll
+
+PACKAGES = \
+	-pkg:f-spot \
+	-pkg:gtk-sharp-2.0
+
+ASSEMBLIES = \
+	-r:Mono.Posix
+
+RESOURCES = \
+	-resource:PixelateEditor.addin.xml
+
+SOURCES = \
+	PixelateEditor.cs
+
+install: all
+	cp *.dll ~/.gnome2/f-spot/addins/
+
+mpack: PixelateEditor.dll
+	mautil p PixelateEditor.dll
+
+PixelateEditor.dll: $(SOURCES) PixelateEditor.addin.xml
+	gmcs -target:library $(SOURCES) $(PACKAGES) $(ASSEMBLIES) $(RESOURCES)
+
+clean:
+	rm -f *.dll *~ *.bak .mpack
+
+PHONY:
+	install clean all mpack

Added: trunk/extensions/Editors/PixelateEditor/PixelateEditor.addin.xml
==============================================================================
--- (empty file)
+++ trunk/extensions/Editors/PixelateEditor/PixelateEditor.addin.xml	Tue Sep 23 15:08:28 2008
@@ -0,0 +1,15 @@
+<Addin namespace="FSpot"
+	id="PixelateEditor"
+	version="0.5.0.0"
+	name="PixelateEditor"
+	description="Pixelates an area of the image."
+	author="Brian J. Murrell"
+	url="http://f-spot.org/Extensions";
+	category="Editors">
+	<Dependencies>
+		<Addin id="Core" version="0.5.0.0"/>
+	</Dependencies>
+	<Extension path = "/FSpot/Editors">
+		<Editor editor_type = "FSpot.Addins.Editors.PixelateEditor"/>
+	</Extension>
+</Addin>

Added: trunk/extensions/Editors/PixelateEditor/PixelateEditor.cs
==============================================================================
--- (empty file)
+++ trunk/extensions/Editors/PixelateEditor/PixelateEditor.cs	Tue Sep 23 15:08:28 2008
@@ -0,0 +1,47 @@
+/*
+ * PixelateEditor.cs
+ *
+ * Author(s)
+ * 	Brian J. Murrell <brian interlinx bc ca>
+ *
+ * This is free software. See COPYING for details.
+ */
+
+using FSpot;
+using FSpot.Editors;
+using Gdk;
+using Gtk;
+using Mono.Unix;
+
+namespace FSpot.Addins.Editors {
+	class PixelateEditor : Editor {
+		public PixelateEditor () : base (Catalog.GetString ("Pixelate"), null) {
+			CanHandleMultiple = false;
+			NeedsSelection = true;
+		}
+
+		public override Widget ConfigurationWidget () {
+			VBox vbox = new VBox ();
+
+			Label info = new Label (Catalog.GetString ("Select the area that you want pixelated."));
+
+			vbox.Add (info);
+
+			return vbox;
+		}
+
+		protected override Pixbuf Process (Pixbuf input, Cms.Profile input_profile) {
+			Pixbuf output = input.Copy ();
+
+			Pixbuf sub = new Pixbuf (output, State.Selection.x, State.Selection.y,
+					State.Selection.width, State.Selection.height);
+			/* lazy man's pixelate: scale down and then back up */
+			Pixbuf down = sub.ScaleSimple (State.Selection.width/75, State.Selection.height/75,
+					InterpType.Nearest);
+			Pixbuf up = down.ScaleSimple (State.Selection.width, State.Selection.height,
+					InterpType.Nearest);
+			up.CopyArea (0, 0, State.Selection.width, State.Selection.height, sub, 0, 0);
+			return output;
+		}
+	}
+}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]