Browse Source

Fix glow/vignette

Former-commit-id: 5543167383314e5d387a526a69fe2215a547d323
Former-commit-id: 4f587f2840c6658cb89e11e11fc3be8b7f06d060
Former-commit-id: d449169fc6db36b9d08bad258a5ed005b0a3fa56
af/merge-core
James Jackson-South 10 years ago
parent
commit
c5ff7aa243
  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