Compare commits

...

2 Commits

Author SHA1 Message Date
Samuele Lorefice
f1d1749c40 Merge branch 'ILGpu' 2025-04-07 07:59:37 +02:00
mm00
07c00117f1 Added directional blur for final image 2025-04-02 19:45:20 +02:00

View File

@@ -45,8 +45,8 @@ public static class Program {
Images.Add(new(pixels, pixels.GetLength(0), pixels.GetLength(1))); Images.Add(new(pixels, pixels.GetLength(0), pixels.GetLength(1)));
pixels = ImageUtil.LoadImage<Vector3>($"./spherefull.png"); pixels = ImageUtil.LoadImage<Vector3>($"./spherefull.png");
Images.Add(new(pixels, pixels.GetLength(0), pixels.GetLength(1))); Images.Add(new(pixels, pixels.GetLength(0), pixels.GetLength(1)));
*/ */
//check if all the images in Images are the same resolution //check if all the images in Images are the same resolution
if (Images.Select(img => (img.Width, img.Height)).Distinct().Count() > 1) { if (Images.Select(img => (img.Width, img.Height)).Distinct().Count() > 1) {
Console.WriteLine("Error: Not all images have the same resolution."); Console.WriteLine("Error: Not all images have the same resolution.");
@@ -251,8 +251,10 @@ public static class Program {
static T Lerp<T>(T a, T b, float t) static T Lerp<T>(T a, T b, float t)
where T : INumber<T>, IMultiplyOperators<T, float, T>, IAdditionOperators<T, T, T> where T : INumber<T>, IMultiplyOperators<T, float, T>, IAdditionOperators<T, T, T>
=> a * (1 - t) + b * t; => a * (1 - t) + b * t;
static Vector3 Lerp(Vector3 a, Vector3 b, float t) => a * (1 - t) + b * t;
static T Remap<T>(T value, T min, T max, T newMin, T newMax) static T Remap<T>(T value, T min, T max, T newMin, T newMax)
where T : INumber<T>, ISubtractionOperators<T, T, T>, IMultiplyOperators<T, T, T>, IAdditionOperators<T, T, T> where T : INumber<T>, ISubtractionOperators<T, T, T>, IMultiplyOperators<T, T, T>, IAdditionOperators<T, T, T>
=> (value - min) / (max - min) * (newMax - newMin) + newMin; => (value - min) / (max - min) * (newMax - newMin) + newMin;
} }