diff --git a/src/Aardvark.Base.Tensors.CSharp/PixImage/PixImageCube.cs b/src/Aardvark.Base.Tensors.CSharp/PixImage/PixCube.cs similarity index 94% rename from src/Aardvark.Base.Tensors.CSharp/PixImage/PixImageCube.cs rename to src/Aardvark.Base.Tensors.CSharp/PixImage/PixCube.cs index 48bb322a..376378bd 100644 --- a/src/Aardvark.Base.Tensors.CSharp/PixImage/PixImageCube.cs +++ b/src/Aardvark.Base.Tensors.CSharp/PixImage/PixCube.cs @@ -33,7 +33,7 @@ public enum CubeSideFlags /// /// A cube map consisting of six image mipmaps. /// - public class PixImageCube : IPix + public class PixCube : IPix { /// /// Array of image mipmaps representing the cube sides. @@ -47,7 +47,7 @@ public class PixImageCube : IPix /// The order of the array follows the enumeration. /// /// An array of mipmaps representing the sides of the mipmap. - public PixImageCube(PixImageMipMap[] sides) + public PixCube(PixImageMipMap[] sides) => MipMapArray = sides; /// @@ -55,7 +55,7 @@ public PixImageCube(PixImageMipMap[] sides) /// The order of the array follows the enumeration. /// /// An array of images representing the sides of the mipmap. - public PixImageCube(PixImage[] sides) + public PixCube(PixImage[] sides) => MipMapArray = sides.Map(image => new PixImageMipMap(image)); #endregion diff --git a/src/Aardvark.Base.Tensors/Aardvark.Base.Tensors.fsproj b/src/Aardvark.Base.Tensors/Aardvark.Base.Tensors.fsproj index 30e60ff9..c282cff2 100644 --- a/src/Aardvark.Base.Tensors/Aardvark.Base.Tensors.fsproj +++ b/src/Aardvark.Base.Tensors/Aardvark.Base.Tensors.fsproj @@ -22,7 +22,7 @@ - + diff --git a/src/Aardvark.Base.Tensors/PixImage/PixImageCube.fs b/src/Aardvark.Base.Tensors/PixImage/PixCube.fs similarity index 77% rename from src/Aardvark.Base.Tensors/PixImage/PixImageCube.fs rename to src/Aardvark.Base.Tensors/PixImage/PixCube.fs index 12b7651f..8b12514c 100644 --- a/src/Aardvark.Base.Tensors/PixImage/PixImageCube.fs +++ b/src/Aardvark.Base.Tensors/PixImage/PixCube.fs @@ -4,12 +4,12 @@ open System.Runtime.CompilerServices open System.Runtime.InteropServices [] -module FSharpPixImageCubeExtensions = +module FSharpPixCubeExtensions = - type PixImageCube with + type PixCube with member x.Transformed (m : CubeSide -> CubeSide * ImageTrafo) = - PixImageCube( + PixCube( x.MipMapArray |> Array.mapi (fun i mipMap -> let side = unbox i @@ -32,16 +32,16 @@ module FSharpPixImageCubeExtensions = ) static member Create (images : Map) = - PixImageCube(images |> Map.toArray |> Array.map snd) + PixCube(images |> Map.toArray |> Array.map snd) static member Create (images : Map) = - PixImageCube(images |> Map.toArray |> Array.map (fun (_,pi) -> PixImageMipMap [|pi|])) + PixCube(images |> Map.toArray |> Array.map (fun (_,pi) -> PixImageMipMap [|pi|])) static member Load (images : Map, [] loader : IPixLoader) = - PixImageCube(images |> Map.toArray |> Array.map (fun (_,file) -> PixImageMipMap [|PixImage.Load(file, loader)|])) + PixCube(images |> Map.toArray |> Array.map (fun (_,file) -> PixImageMipMap [|PixImage.Load(file, loader)|])) [] - module PixImageCube = + module PixCube = module Trafo = @@ -163,62 +163,62 @@ module FSharpPixImageCubeExtensions = |> List.map snd |> List.toArray - PixImageCube(faces) + PixCube(faces) - let rotX90 (c : PixImageCube) = + let rotX90 (c : PixCube) = c.Transformed Trafo.RotX90 - let rotX180 (c : PixImageCube) = + let rotX180 (c : PixCube) = c.Transformed Trafo.RotX180 - let rotX270 (c : PixImageCube) = + let rotX270 (c : PixCube) = c.Transformed Trafo.RotX270 - let rotY90 (c : PixImageCube) = + let rotY90 (c : PixCube) = c.Transformed Trafo.RotY90 - let rotY180 (c : PixImageCube) = + let rotY180 (c : PixCube) = c.Transformed Trafo.RotY180 - let rotY270 (c : PixImageCube) = + let rotY270 (c : PixCube) = c.Transformed Trafo.RotY270 - let rotZ90 (c : PixImageCube) = + let rotZ90 (c : PixCube) = c.Transformed Trafo.RotZ90 - let rotZ180 (c : PixImageCube) = + let rotZ180 (c : PixCube) = c.Transformed Trafo.RotZ180 - let rotZ270 (c : PixImageCube) = + let rotZ270 (c : PixCube) = c.Transformed Trafo.RotZ270 - let invertX (c : PixImageCube) = + let invertX (c : PixCube) = c.Transformed Trafo.InvertX - let invertY (c : PixImageCube) = + let invertY (c : PixCube) = c.Transformed Trafo.InvertY - let invertZ (c : PixImageCube) = + let invertZ (c : PixCube) = c.Transformed Trafo.InvertZ - let ofOpenGlConvention (c : PixImageCube) = + let ofOpenGlConvention (c : PixCube) = c.Transformed Trafo.OfOpenGlConventionTrafo - let toOpenGlConvention (c : PixImageCube) = + let toOpenGlConvention (c : PixCube) = c.Transformed Trafo.ToOpenGlConventionTrafo [] -type PixImageCubeExtensions private() = +type PixCubeExtensions private() = [] - static member Transformed(x : PixImageCube, f : System.Func>) = + static member Transformed(x : PixCube, f : System.Func>) = x.Transformed(fun side -> let t = f.Invoke(side) t.E0, t.E1 ) [] - static member Transformed(x : PixImageCube, d : System.Collections.Generic.Dictionary>) = + static member Transformed(x : PixCube, d : System.Collections.Generic.Dictionary>) = x.Transformed (fun side -> match d.TryGetValue side with | (true, t) -> t.E0, t.E1 @@ -228,20 +228,20 @@ type PixImageCubeExtensions private() = ) - [] static member RotX90(x : PixImageCube) = PixImageCube.rotX90 x - [] static member RotX180(x : PixImageCube) = PixImageCube.rotX180 x - [] static member RotX270(x : PixImageCube) = PixImageCube.rotX270 x + [] static member RotX90(x : PixCube) = PixCube.rotX90 x + [] static member RotX180(x : PixCube) = PixCube.rotX180 x + [] static member RotX270(x : PixCube) = PixCube.rotX270 x - [] static member RotY90(x : PixImageCube) = PixImageCube.rotY90 x - [] static member RotY180(x : PixImageCube) = PixImageCube.rotY180 x - [] static member RotY270(x : PixImageCube) = PixImageCube.rotY270 x + [] static member RotY90(x : PixCube) = PixCube.rotY90 x + [] static member RotY180(x : PixCube) = PixCube.rotY180 x + [] static member RotY270(x : PixCube) = PixCube.rotY270 x - [] static member RotZ90(x : PixImageCube) = PixImageCube.rotZ90 x - [] static member RotZ180(x : PixImageCube) = PixImageCube.rotZ180 x - [] static member RotZ270(x : PixImageCube) = PixImageCube.rotZ270 x + [] static member RotZ90(x : PixCube) = PixCube.rotZ90 x + [] static member RotZ180(x : PixCube) = PixCube.rotZ180 x + [] static member RotZ270(x : PixCube) = PixCube.rotZ270 x - [] static member InvertX(x : PixImageCube) = PixImageCube.invertX x - [] static member InvertY(x : PixImageCube) = PixImageCube.invertY x - [] static member InvertZ(x : PixImageCube) = PixImageCube.invertZ x - [] static member FromOpenGlConvention(x : PixImageCube) = PixImageCube.ofOpenGlConvention x - [] static member ToOpenGlConvention(x : PixImageCube) = PixImageCube.toOpenGlConvention x \ No newline at end of file + [] static member InvertX(x : PixCube) = PixCube.invertX x + [] static member InvertY(x : PixCube) = PixCube.invertY x + [] static member InvertZ(x : PixCube) = PixCube.invertZ x + [] static member FromOpenGlConvention(x : PixCube) = PixCube.ofOpenGlConvention x + [] static member ToOpenGlConvention(x : PixCube) = PixCube.toOpenGlConvention x \ No newline at end of file