Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

Commit

Permalink
Added the CIDarkenBlendMode filter
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Beisecker committed Mar 8, 2012
1 parent 97cb327 commit 5f251f7
Showing 1 changed file with 25 additions and 5 deletions.
30 changes: 25 additions & 5 deletions CoreImage/AppDelegate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public override bool FinishedLaunching (UIApplication app, NSDictionary options)
new RootElement ("ColorBlendMode", (x) => Demo (ColorBlendMode)),
new RootElement ("ColorBurnBlendMode", (x) => Demo (ColorBurnBlendMode)),
new RootElement ("ColorDodgeBlendMode", (x) => Demo (ColorDodgeBlendMode)),
new RootElement ("DarkenBlendMode", (x) => Demo (DarkenBlendMode)),
new RootElement ("DifferenceBlendMode", (x) => Demo (DifferenceBlendMode)),
new RootElement ("ExclusionBlendMode", (x) => Demo (ExclusionBlendMode)),
new RootElement ("HardLightBlendMode", (x) => Demo (HardLightBlendMode)),
Expand Down Expand Up @@ -193,11 +194,12 @@ public CIImage ColorMatrix()
[Filter]
public CIImage ColorControls ()
{
var colorCtrls = new CIColorControls (){
var colorCtrls = new CIColorControls ()
{
Image = flower,
Brightness = .5F,
Saturation = 1.2F,
Contrast = 3.1F
Brightness = .5F, // Min: 0 Max: 2
Saturation = 1.2F, // Min: -1 Max: 1
Contrast = 3.1F // Min: 0 Max: 4
};

return colorCtrls.OutputImage;
Expand Down Expand Up @@ -386,7 +388,7 @@ public CIImage ColorMonochrome ()
{
Image = flower,
Color = inputColor,
Intensity = 1F,
Intensity = 1F, // Default 1
};

return monoChrome.OutputImage;
Expand Down Expand Up @@ -648,6 +650,24 @@ public CIImage ColorDodgeBlendMode ()
return colorDodgeBlend.OutputImage;
}

/// <summary>
/// Creates composite image samples by choosing the darker samples (from either the source image or the background).
/// </summary>
/// <returns>
/// The composite Image
/// </returns>
[Filter]
public CIImage DarkenBlendMode()
{
var darkenBlend = new CIDarkenBlendMode()
{
Image = heron,
BackgroundImage = clouds
};

return darkenBlend.OutputImage;
}

/// <summary>
/// Subtracts either the source image sample color from the background image sample color, or the reverse, depending on which sample has the greater brightness value.
/// </summary>
Expand Down

0 comments on commit 5f251f7

Please sign in to comment.