Compare commits
2 Commits
ILGpu
...
f1d1749c40
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f1d1749c40 | ||
|
|
07c00117f1 |
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user