Browse Source

Fix glow/vignette

Former-commit-id: a54034b7230609232a91bb6e9c59d184b26c69dc
Former-commit-id: 23ad01e51ee979e6ce4d571b34624175c1305e0a
Former-commit-id: 61bded86dc05bc1718e67222fa423b2c1be3721d
af/merge-core
James Jackson-South 11 years ago
parent
commit
7ed3079e8b
  1. 2
      src/ImageProcessor/Filters/Glow.cs
  2. 11
      src/ImageProcessor/Filters/Vignette.cs

2
src/ImageProcessor/Filters/Glow.cs

@ -49,7 +49,7 @@ namespace ImageProcessor.Filters
{
float distance = Vector2.Distance(centre, new Vector2(x, y));
Color sourceColor = target[x, y];
target[x, y] = Color.Lerp(sourceColor, glowColor, .5f * (1 - distance / maxDistance));
target[x, y] = Color.Lerp(glowColor, sourceColor, .5f * (distance / maxDistance));
}
});
}

11
src/ImageProcessor/Filters/Vignette.cs

@ -17,7 +17,7 @@ namespace ImageProcessor.Filters
/// <summary>
/// Gets or sets the vignette color to apply.
/// </summary>
public Color Color { get; set; } = new Color(0, 0, 0, 1);
public Color Color { get; set; } = Color.Black;
/// <summary>
/// Gets or sets the the x-radius.
@ -49,14 +49,7 @@ namespace ImageProcessor.Filters
{
float distance = Vector2.Distance(centre, new Vector2(x, y));
Color sourceColor = target[x, y];
//if (sourceColor.A > 0)
//{
target[x, y] = Color.Lerp(sourceColor, vignetteColor, .9f * distance / maxDistance);
//}
//else
//{
// target[x, y] = Color.Lerp(sourceColor, color, distance / maxDistance);
//}
target[x, y] = Color.Lerp(vignetteColor, sourceColor, 1 - .9f * distance / maxDistance);
}
});
}

Loading…
Cancel
Save