Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
LoneWandererProductions committed Nov 13, 2024
1 parent 4340208 commit 32bda84
Show file tree
Hide file tree
Showing 13 changed files with 305 additions and 280 deletions.
6 changes: 2 additions & 4 deletions Imaging/ITextureGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Bitmap GenerateCrosshatchBitmap(
int height);

/// <summary>
/// Generates the concrete bitmap.
/// Generates the concrete bitmap.
/// </summary>
/// <param name="width">The width.</param>
/// <param name="height">The height.</param>
Expand All @@ -89,7 +89,7 @@ Bitmap GenerateConcreteBitmap(
int height);

/// <summary>
/// Generates the canvas bitmap.
/// Generates the canvas bitmap.
/// </summary>
/// <param name="width">The width.</param>
/// <param name="height">The height.</param>
Expand Down Expand Up @@ -117,7 +117,5 @@ Bitmap GenerateTexture(
MaskShape shape,
Point? startPoint = null,
object shapeParams = null);


}
}
14 changes: 7 additions & 7 deletions Imaging/LayerSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public LayerSettings()
}

/// <summary>
/// Initializes a new instance of the <see cref="LayerSettings"/> class.
/// Initializes a new instance of the <see cref="LayerSettings" /> class.
/// </summary>
/// <param name="isVisible">if set to <c>true</c> [is visible].</param>
/// <param name="alpha">The alpha.</param>
Expand All @@ -18,26 +18,26 @@ public LayerSettings(bool isVisible, float alpha)
}

/// <summary>
/// Gets or sets a value indicating whether this instance is visible.
/// Gets or sets a value indicating whether this instance is visible.
/// </summary>
/// <value>
/// <c>true</c> if this instance is visible; otherwise, <c>false</c>.
/// <c>true</c> if this instance is visible; otherwise, <c>false</c>.
/// </value>
public bool IsVisible { get; set; } = true; // Determines if the layer is visible

/// <summary>
/// Gets or sets the alpha.
/// Gets or sets the alpha.
/// </summary>
/// <value>
/// The alpha.
/// The alpha.
/// </value>
public float Alpha { get; set; } = 1.0f; // Transparency level (0 = fully transparent, 1 = fully opaque)

/// <summary>
/// Gets the name of the layer.
/// Gets the name of the layer.
/// </summary>
/// <value>
/// The name of the layer.
/// The name of the layer.
/// </value>
public string LayerName { get; internal set; }
}
Expand Down
12 changes: 4 additions & 8 deletions Imaging/Texture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -427,27 +427,23 @@ internal static Bitmap GenerateCanvasBitmap(


//no Simd for now
using (Graphics g = Graphics.FromImage(canvasBitmap.Bitmap))
using (var g = Graphics.FromImage(canvasBitmap.Bitmap))
{
g.Clear(Color.White);

// Draw vertical fibers
for (int x = 0; x < width; x += lineSpacing)
{
for (var x = 0; x < width; x += lineSpacing)
using (var fiberBrush = new SolidBrush(Color.FromArgb(alpha, lineColor)))
{
g.FillRectangle(fiberBrush, x, 0, lineThickness, height);
}
}

// Draw horizontal fibers
for (int y = 0; y < height; y += lineSpacing)
{
for (var y = 0; y < height; y += lineSpacing)
using (var fiberBrush = new SolidBrush(Color.FromArgb(alpha, lineColor)))
{
g.FillRectangle(fiberBrush, 0, y, width, lineThickness);
}
}
}

return canvasBitmap.Bitmap;
Expand Down Expand Up @@ -510,7 +506,7 @@ private static double SmoothNoise(double x, double y)
}

/// <summary>
/// Adds a minor random variation to an integer value within a given range.
/// Adds a minor random variation to an integer value within a given range.
/// </summary>
private static int RandomVariation(int min, int max)
{
Expand Down
6 changes: 2 additions & 4 deletions Imaging/TextureGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public Bitmap GenerateCrosshatchBitmap(int width, int height)
}

/// <summary>
/// Generates the concrete bitmap.
/// Generates the concrete bitmap.
/// </summary>
/// <param name="width">The width.</param>
/// <param name="height">The height.</param>
Expand All @@ -210,7 +210,7 @@ public Bitmap GenerateConcreteBitmap(int width, int height)
}

/// <summary>
/// Generates the canvas bitmap.
/// Generates the canvas bitmap.
/// </summary>
/// <param name="width">The width.</param>
/// <param name="height">The height.</param>
Expand All @@ -228,7 +228,5 @@ public Bitmap GenerateCanvasBitmap(int width, int height)
config.Alpha
);
}


}
}
4 changes: 2 additions & 2 deletions Imaging/TextureType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ public enum TextureType
Crosshatch,

/// <summary>
/// The concrete
/// The concrete
/// </summary>
Concrete,

/// <summary>
/// The canvas
/// The canvas
/// </summary>
Canvas
}
Expand Down
Loading

0 comments on commit 32bda84

Please sign in to comment.