Skip to content

Commit

Permalink
vignette final
Browse files Browse the repository at this point in the history
  • Loading branch information
nisaldilshan committed Mar 20, 2017
1 parent 8826231 commit 3544227
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion Image Processing Studio 1.0/ImageProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,16 @@ public static UMat getColorTemperatureAdjusted(ref UMat img, int r, int g, int b

public static void PaintVignette(Graphics g, Rectangle bounds, int radi, int intense)
{
int red = 0;
int green = 0;
int blue = 0;
if (intense < 0)
{
intense = -intense;
red = 255;
green = 255;
blue = 255;
}
Rectangle ellipsebounds = bounds;
ellipsebounds.Offset(-ellipsebounds.X, -ellipsebounds.Y);
int x = ellipsebounds.Width - (int)Math.Round((radi * ellipsebounds.Width)/10.0);
Expand All @@ -224,7 +234,7 @@ public static void PaintVignette(Graphics g, Rectangle bounds, int radi, int int
{
brush.WrapMode = WrapMode.Tile;
brush.CenterColor = Color.FromArgb(0, 0, 0, 0);
brush.SurroundColors = new Color[] { Color.FromArgb(intense, 0, 0, 0) };
brush.SurroundColors = new Color[] { Color.FromArgb(intense, red, green, blue) };
Blend blend = new Blend();
blend.Positions = new float[] { 0.0f, 0.2f, 0.4f, 0.6f, 0.8f, 1.0F };
blend.Factors = new float[] { 0.0f, 0.5f, 1f, 1f, 1.0f, 1.0f };
Expand Down
2 changes: 1 addition & 1 deletion Image Processing Studio 1.0/Vignette.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public partial class Vignette : UserControl

private const double MIN_RAD = 5.0;
private const double MAX_RAD = 9.0;
private const double MIN_INTENSITY = 100.0;
private const double MIN_INTENSITY = -255.0;
private const double MAX_INTENSITY = 255.0;
private const double DEFAULT_RAD = 7.0;
private const double DEFAULT_INTENSITY = 200.0;
Expand Down

0 comments on commit 3544227

Please sign in to comment.