[f-spot/rubenv-gsoc-2009: 55/86] Convert sepia and desaturate into repeatable editors.
- From: Ruben Vermeersch <rubenv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [f-spot/rubenv-gsoc-2009: 55/86] Convert sepia and desaturate into repeatable editors.
- Date: Sun, 23 May 2010 12:36:34 +0000 (UTC)
commit a1a4b6e37fcf82f0cd3bd8eb3477aa8a6f0c51b8
Author: Ruben Vermeersch <ruben savanne be>
Date: Tue Aug 4 20:50:46 2009 +0200
Convert sepia and desaturate into repeatable editors.
src/ColorAdjustment/Desaturate.cs | 40 ----------------------
src/ColorAdjustment/FullColorAdjustment.cs | 11 +++++-
src/ColorAdjustment/SepiaTone.cs | 50 ----------------------------
src/Editors/DesaturateEditor.cs | 16 ++++++---
src/Editors/Processing/ColorAdjustStep.cs | 5 +++
src/Editors/SepiaEditor.cs | 16 ++++++---
src/Makefile.am | 2 -
7 files changed, 37 insertions(+), 103 deletions(-)
---
diff --git a/src/ColorAdjustment/FullColorAdjustment.cs b/src/ColorAdjustment/FullColorAdjustment.cs
index 049d2b7..4dcabc0 100644
--- a/src/ColorAdjustment/FullColorAdjustment.cs
+++ b/src/ColorAdjustment/FullColorAdjustment.cs
@@ -45,11 +45,20 @@ namespace FSpot.ColorAdjustment {
List <Cms.Profile> profiles = new List <Cms.Profile> ();
profiles.Add (InputProfile);
profiles.Add (Cms.Profile.CreateAbstract (nsteps,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ saturation,
+ null,
+ ColorCIExyY.D50,
+ ColorCIExyY.D50));
+ profiles.Add (Cms.Profile.CreateAbstract (nsteps,
Math.Pow (Math.Sqrt (2.0), exposure),
brightness,
contrast,
hue,
- saturation,
+ 0.0,
null,
src_wp.ToxyY (),
dest_wp.ToxyY ()));
diff --git a/src/Editors/DesaturateEditor.cs b/src/Editors/DesaturateEditor.cs
index 4824dd6..17f32ab 100644
--- a/src/Editors/DesaturateEditor.cs
+++ b/src/Editors/DesaturateEditor.cs
@@ -13,15 +13,21 @@ using Gdk;
using Mono.Unix;
namespace FSpot.Editors {
- class DesaturateEditor : Editor {
+ class DesaturateEditor : RepeatableEditor {
public DesaturateEditor () : base (Catalog.GetString ("Desaturate"), "color-desaturate") {
// FIXME: need tooltip Catalog.GetString ("Convert the photo to black and white")
CanHandleMultiple = true;
}
- protected override Pixbuf Process (Pixbuf input, Cms.Profile input_profile) {
- Desaturate desaturate = new Desaturate (input, input_profile);
- return desaturate.Adjust ();
- }
+ protected override void SetupPipeline ()
+ {
+ Pipeline.Set ("ColorAdjust", "Temperature", 5000);
+ Pipeline.Set ("ColorAdjust", "Tint", 0);
+ Pipeline.Set ("ColorAdjust", "Exposure", 0.0);
+ Pipeline.Set ("ColorAdjust", "Brightness", 0.0);
+ Pipeline.Set ("ColorAdjust", "Contrast", 0.0);
+ Pipeline.Set ("ColorAdjust", "Hue", 0.0);
+ Pipeline.Set ("ColorAdjust", "Saturation", -100.0);
+ }
}
}
diff --git a/src/Editors/Processing/ColorAdjustStep.cs b/src/Editors/Processing/ColorAdjustStep.cs
index 79f94d3..e5ae417 100644
--- a/src/Editors/Processing/ColorAdjustStep.cs
+++ b/src/Editors/Processing/ColorAdjustStep.cs
@@ -20,6 +20,11 @@ namespace FSpot.Editors.Processing {
public void Process (Pipeline pipeline, Pixbuf input, out Pixbuf output)
{
+ if (pipeline.Get (this, "Temperature").IsBlank) {
+ output = input.ShallowCopy ();
+ return;
+ }
+
Cms.ColorCIEXYZ src_wp;
Cms.ColorCIEXYZ dest_wp;
diff --git a/src/Editors/SepiaEditor.cs b/src/Editors/SepiaEditor.cs
index 26606f4..bb93f27 100644
--- a/src/Editors/SepiaEditor.cs
+++ b/src/Editors/SepiaEditor.cs
@@ -13,15 +13,21 @@ using Gdk;
using Mono.Unix;
namespace FSpot.Editors {
- class SepiaEditor : Editor {
+ class SepiaEditor : RepeatableEditor {
public SepiaEditor () : base (Catalog.GetString ("Sepia Tone"), "color-sepia") {
// FIXME: need tooltip Catalog.GetString ("Convert the photo to sepia tones")
CanHandleMultiple = true;
}
- protected override Pixbuf Process (Pixbuf input, Cms.Profile input_profile) {
- SepiaTone sepia = new SepiaTone (input, input_profile);
- return sepia.Adjust ();
- }
+ protected override void SetupPipeline ()
+ {
+ Pipeline.Set ("ColorAdjust", "Temperature", 9934);
+ Pipeline.Set ("ColorAdjust", "Tint", 0);
+ Pipeline.Set ("ColorAdjust", "Exposure", 0.0);
+ Pipeline.Set ("ColorAdjust", "Brightness", 32.0);
+ Pipeline.Set ("ColorAdjust", "Contrast", 0.0);
+ Pipeline.Set ("ColorAdjust", "Hue", 0.0);
+ Pipeline.Set ("ColorAdjust", "Saturation", -100.0);
+ }
}
}
diff --git a/src/Makefile.am b/src/Makefile.am
index b235eb4..c5aa53b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -172,9 +172,7 @@ F_SPOT_CSDISTFILES = \
$(srcdir)/PhotoList.cs \
$(srcdir)/ColorAdjustment/Adjustment.cs \
$(srcdir)/ColorAdjustment/AutoStretch.cs \
- $(srcdir)/ColorAdjustment/Desaturate.cs \
$(srcdir)/ColorAdjustment/FullColorAdjustment.cs \
- $(srcdir)/ColorAdjustment/SepiaTone.cs \
$(srcdir)/ControlOverlay.cs \
$(srcdir)/Core/App.cs \
$(srcdir)/Core/ColorManagement.cs \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]