diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index b696517f..1c53739b 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -13,6 +13,7 @@ - `PixVolume` implements `IPixImage3d` - Added `PixVolume.BytesPerChannel` - Added `PixVolume.ToCanonicalDenseLayout` + - Added `Add PixImage.Transformed` (abstract `PixImage.Transformed` is renamed to `PixImage.TransformedPixImage`) - Removed obsolete loading API - Removed obsolete API: - [Color] obsolete conversion functions diff --git a/src/Aardvark.Base.Tensors.CSharp/PixImage/PixImage.cs b/src/Aardvark.Base.Tensors.CSharp/PixImage/PixImage.cs index 46bab405..d1bf5ce1 100644 --- a/src/Aardvark.Base.Tensors.CSharp/PixImage/PixImage.cs +++ b/src/Aardvark.Base.Tensors.CSharp/PixImage/PixImage.cs @@ -866,7 +866,7 @@ public PixImage ToPixImage(Col.Format format) #region Image Manipulation - public abstract PixImage Transformed(ImageTrafo trafo); + public abstract PixImage TransformedPixImage(ImageTrafo trafo); public abstract PixImage RemappedPixImage(Matrix xMap, Matrix yMap, ImageInterpolation ip = ImageInterpolation.Cubic); @@ -1282,13 +1282,14 @@ public IEnumerable> Channels #region Image Manipulation - public override PixImage Transformed(ImageTrafo trafo) + public override PixImage TransformedPixImage(ImageTrafo trafo) + => Transformed(trafo); + + public PixImage Transformed(ImageTrafo trafo) => new PixImage(Format, Volume.Transformed(trafo)); - public override PixImage RemappedPixImage( - Matrix xMap, Matrix yMap, - ImageInterpolation ip = ImageInterpolation.Cubic - ) => Remapped(xMap, xMap, ip); + public override PixImage RemappedPixImage(Matrix xMap, Matrix yMap, ImageInterpolation ip = ImageInterpolation.Cubic) + => Remapped(xMap, xMap, ip); public PixImage Remapped(Matrix xMap, Matrix yMap, ImageInterpolation ip = ImageInterpolation.Cubic) { @@ -1302,32 +1303,20 @@ public PixImage Remapped(Matrix xMap, Matrix yMap, ImageInterpo private static Func, Matrix, Matrix, ImageInterpolation, Volume> s_remappedFun = null; - public static void SetRemappedFun( - Func, Matrix, Matrix, ImageInterpolation, Volume> remappedFun - ) - { - s_remappedFun = remappedFun; - } + public static void SetRemappedFun(Func, Matrix, Matrix, ImageInterpolation, Volume> remappedFun) + => s_remappedFun = remappedFun; - public override PixImage ResizedPixImage( - V2i newSize, - ImageInterpolation ip = ImageInterpolation.Cubic - ) => Scaled((V2d)newSize / (V2d)Size, ip); + public override PixImage ResizedPixImage(V2i newSize, ImageInterpolation ip = ImageInterpolation.Cubic) + => Scaled((V2d)newSize / (V2d)Size, ip); - public PixImage Resized( - V2i newSize, - ImageInterpolation ip = ImageInterpolation.Cubic - ) => Scaled((V2d)newSize / (V2d)Size, ip); + public PixImage Resized(V2i newSize, ImageInterpolation ip = ImageInterpolation.Cubic) + => Scaled((V2d)newSize / (V2d)Size, ip); - public PixImage Resized( - int xSize, int ySize, - ImageInterpolation ip = ImageInterpolation.Cubic - ) => Scaled(new V2d(xSize, ySize) / (V2d)Size, ip); + public PixImage Resized(int xSize, int ySize, ImageInterpolation ip = ImageInterpolation.Cubic) + => Scaled(new V2d(xSize, ySize) / (V2d)Size, ip); - public override PixImage RotatedPixImage( - double angleInRadiansCCW, bool resize = true, - ImageInterpolation ip = ImageInterpolation.Cubic - ) => Rotated(angleInRadiansCCW, resize, ip); + public override PixImage RotatedPixImage(double angleInRadiansCCW, bool resize = true, ImageInterpolation ip = ImageInterpolation.Cubic) + => Rotated(angleInRadiansCCW, resize, ip); public PixImage Rotated(double angleInRadiansCCW, bool resize = true, ImageInterpolation ip = ImageInterpolation.Cubic) { @@ -1341,20 +1330,13 @@ public PixImage Rotated(double angleInRadiansCCW, bool resize = true, ImageIn private static Func, double, bool, ImageInterpolation, Volume> s_rotatedFun = null; - public static void SetRotatedFun( - Func, double, bool, ImageInterpolation, Volume> rotatedFun) - { - s_rotatedFun = rotatedFun; - } + public static void SetRotatedFun(Func, double, bool, ImageInterpolation, Volume> rotatedFun) + => s_rotatedFun = rotatedFun; - public override PixImage ScaledPixImage( - V2d scaleFactor, - ImageInterpolation ip = ImageInterpolation.Cubic - ) => Scaled(scaleFactor, ip); + public override PixImage ScaledPixImage(V2d scaleFactor, ImageInterpolation ip = ImageInterpolation.Cubic) + => Scaled(scaleFactor, ip); - public PixImage Scaled( - V2d scaleFactor, - ImageInterpolation ip = ImageInterpolation.Cubic) + public PixImage Scaled(V2d scaleFactor, ImageInterpolation ip = ImageInterpolation.Cubic) { if (s_scaledFun == null) { @@ -1373,19 +1355,13 @@ public PixImage Scaled( private static Func, V2d, ImageInterpolation, Volume> s_scaledFun = TensorExtensions.Scaled; public static void SetScaledFun(Func, V2d, ImageInterpolation, Volume> scaledFun) - { - s_scaledFun = scaledFun; - } + => s_scaledFun = scaledFun; - public PixImage Scaled( - double scaleFactor, - ImageInterpolation ip = ImageInterpolation.Cubic - ) => Scaled(new V2d(scaleFactor, scaleFactor), ip); + public PixImage Scaled(double scaleFactor, ImageInterpolation ip = ImageInterpolation.Cubic) + => Scaled(new V2d(scaleFactor, scaleFactor), ip); - public PixImage Scaled( - double xScaleFactor, double yScaleFactor, - ImageInterpolation ip = ImageInterpolation.Cubic - ) => Scaled(new V2d(xScaleFactor, yScaleFactor), ip); + public PixImage Scaled(double xScaleFactor, double yScaleFactor, ImageInterpolation ip = ImageInterpolation.Cubic) + => Scaled(new V2d(xScaleFactor, yScaleFactor), ip); #endregion diff --git a/src/Aardvark.Base.Tensors/PixImage/PixImageCube.fs b/src/Aardvark.Base.Tensors/PixImage/PixImageCube.fs index 1f14cee5..97d84efd 100644 --- a/src/Aardvark.Base.Tensors/PixImage/PixImageCube.fs +++ b/src/Aardvark.Base.Tensors/PixImage/PixImageCube.fs @@ -15,7 +15,7 @@ module FSharpPixImageCubeExtensions = |> Array.mapi (fun i mipMap -> let side = unbox i let (newSide, trafo) = m side - newSide, PixImageMipMap (mipMap.ImageArray |> Array.map (fun pi -> pi.Transformed(trafo))) + newSide, PixImageMipMap (mipMap.ImageArray |> Array.map (fun pi -> pi.TransformedPixImage(trafo))) ) |> Map.ofArray |> Map.toArray