diff --git a/DeathSocket/Domain.fs b/DeathSocket/Domain.fs index 3980415..5bf5a4b 100644 --- a/DeathSocket/Domain.fs +++ b/DeathSocket/Domain.fs @@ -96,8 +96,10 @@ ///The number of columns the grid will have. columns: int } + /// Discriminated Union representing the various specification types + /// Death Socket can use to apply a grid to an image. type ImageSpec = - | BrushSpec of BrushSpec - | RGBASpec of RGBASpec - | SkiaSpec of SkiaSpec - | SkiaRGBSpec of SkiaRGBSpec \ No newline at end of file + | Brush of BrushSpec + | RGBA of RGBASpec + | Skia of SkiaSpec + | SkiaRGB of SkiaRGBSpec \ No newline at end of file diff --git a/DeathSocket/GridPainter.fs b/DeathSocket/GridPainter.fs index 40af0b8..1c7c718 100644 --- a/DeathSocket/GridPainter.fs +++ b/DeathSocket/GridPainter.fs @@ -219,17 +219,18 @@ namespace DeathSocket async { try match spec with - | BrushSpec b -> + | Brush b -> validateIO b.originalPath b.savePath |> ignore drawBrushSpecGrid b - | RGBASpec r -> + | RGBA r -> validateIO r.originalPath r.savePath |> ignore drawRGBAGrid r - | SkiaSpec s -> + | Skia s -> validateIO s.originalPath s.savePath |> ignore drawSkiaGrid s - | SkiaRGBSpec sR -> + | SkiaRGB sR -> validateIO sR.originalPath sR.savePath |> ignore + drawSkiaRGBGrid sR with | :? FileNotFoundException as ex -> printfn "File could not be found at %s" ex.Message diff --git a/DeathSocketCLI/Commands.fs b/DeathSocketCLI/Commands.fs index 8a3df0b..995776e 100644 --- a/DeathSocketCLI/Commands.fs +++ b/DeathSocketCLI/Commands.fs @@ -39,8 +39,9 @@ let ``add-default`` imgPath newPath = try printfn "[INFO.] Adding default grid to image..." - buildDefaultSpec imgPath newPath - |> applyBrushSpecGridAsync + Brush (buildDefaultSpec imgPath newPath) + |> applyImageToGrid + //|> applyBrushSpecGridAsync |> Async.Start showEndOfCommandMessage with @@ -126,12 +127,12 @@ let dutest () = printf "saving image..." let b = - BrushSpec (buildDefaultSpec "C:\Users\craig\Desktop\du-test.jpg" "C:\Users\craig\Desktop\du-test-brush.jpg") + Brush (buildDefaultSpec "C:\Users\craig\Desktop\du-test.jpg" "C:\Users\craig\Desktop\du-test-brush.jpg") // let r = buildRGBASpec... let s = - SkiaSpec (buildSkiaSpec "C:\Users\craig\Desktop\du-test.jpg" 5 5 (float32 2) "Red" "C:\Users\craig\Desktop\du-test-skia.jpg") + Skia (buildSkiaSpec "C:\Users\craig\Desktop\du-test.jpg" 5 5 (float32 2) "Red" "C:\Users\craig\Desktop\du-test-skia.jpg") let sR = - SkiaRGBSpec (buildSkiaRGBSpec "C:\Users\craig\Desktop\du-test.jpg" 5 5 (float32 2) 12 56 121 "C:\Users\craig\Desktop\du-test-skia.jpg") + SkiaRGB (buildSkiaRGBSpec "C:\Users\craig\Desktop\du-test.jpg" 5 5 (float32 2) 12 56 121 "C:\Users\craig\Desktop\du-test-skia.jpg") sR |> applyImageToGrid |> Async.RunSynchronously