|
|
@ -15,6 +15,29 @@ namespace DeathSocket |
|
|
|
|
|
|
|
|
|
|
|
open Validation |
|
|
|
open Validation |
|
|
|
open ImageServices |
|
|
|
open ImageServices |
|
|
|
|
|
|
|
open System |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Not tested |
|
|
|
|
|
|
|
let applyGridToImageAsync (spec: ImageSpec) = |
|
|
|
|
|
|
|
async { |
|
|
|
|
|
|
|
try |
|
|
|
|
|
|
|
match spec with |
|
|
|
|
|
|
|
| Brush b -> |
|
|
|
|
|
|
|
validateIO b.originalPath b.savePath |> ignore |
|
|
|
|
|
|
|
drawBrushSpecGrid b |
|
|
|
|
|
|
|
| RGBA r -> |
|
|
|
|
|
|
|
validateIO r.originalPath r.savePath |> ignore |
|
|
|
|
|
|
|
drawRGBAGrid r |
|
|
|
|
|
|
|
| Skia s -> |
|
|
|
|
|
|
|
validateIO s.originalPath s.savePath |> ignore |
|
|
|
|
|
|
|
drawSkiaGrid s |
|
|
|
|
|
|
|
| SkiaRGB sR -> |
|
|
|
|
|
|
|
validateIO sR.originalPath sR.savePath |> ignore |
|
|
|
|
|
|
|
drawSkiaRGBGrid sR |
|
|
|
|
|
|
|
with |
|
|
|
|
|
|
|
| :? FileNotFoundException as ex -> |
|
|
|
|
|
|
|
printfn "File could not be found at %s" ex.Message |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// System.Drawing Functions |
|
|
|
// System.Drawing Functions |
|
|
|
// ======================================================================== |
|
|
|
// ======================================================================== |
|
|
@ -62,6 +85,7 @@ namespace DeathSocket |
|
|
|
/// is not in use or needed by another program/process. |
|
|
|
/// is not in use or needed by another program/process. |
|
|
|
/// This is because it is locked whilst in this function. |
|
|
|
/// This is because it is locked whilst in this function. |
|
|
|
/// </remarks> |
|
|
|
/// </remarks> |
|
|
|
|
|
|
|
[<Obsolete("Method is deprecated, use applyGridToImage instead.")>] |
|
|
|
let applyBrushSpecGridAsync (spec: BrushSpec) = |
|
|
|
let applyBrushSpecGridAsync (spec: BrushSpec) = |
|
|
|
async { |
|
|
|
async { |
|
|
|
try |
|
|
|
try |
|
|
@ -90,6 +114,7 @@ namespace DeathSocket |
|
|
|
/// is not in use or needed by another program/process. |
|
|
|
/// is not in use or needed by another program/process. |
|
|
|
/// This is because it is locked whilst in this function. |
|
|
|
/// This is because it is locked whilst in this function. |
|
|
|
/// </remarks> |
|
|
|
/// </remarks> |
|
|
|
|
|
|
|
[<Obsolete("Method is deprecated, use applyGridToImage instead.")>] |
|
|
|
let applyRGBAGridAsync (spec: RGBASpec) = |
|
|
|
let applyRGBAGridAsync (spec: RGBASpec) = |
|
|
|
async { |
|
|
|
async { |
|
|
|
try |
|
|
|
try |
|
|
@ -162,7 +187,6 @@ namespace DeathSocket |
|
|
|
let determineSKVerticalLines (width: int) (height: int) (columns: int) = |
|
|
|
let determineSKVerticalLines (width: int) (height: int) (columns: int) = |
|
|
|
createSKVerticalLines width height columns |
|
|
|
createSKVerticalLines width height columns |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// <summary> |
|
|
|
/// Uses the information included in spec to create a gridded image. |
|
|
|
/// Uses the information included in spec to create a gridded image. |
|
|
|
/// It then asynchronously saves it. Uses .jpg or .png formats only. |
|
|
|
/// It then asynchronously saves it. Uses .jpg or .png formats only. |
|
|
@ -178,6 +202,7 @@ namespace DeathSocket |
|
|
|
/// is not in use or needed by another program/process. |
|
|
|
/// is not in use or needed by another program/process. |
|
|
|
/// This is because it is locked whilst in this function. |
|
|
|
/// This is because it is locked whilst in this function. |
|
|
|
/// </remarks> |
|
|
|
/// </remarks> |
|
|
|
|
|
|
|
[<Obsolete("Method is deprecated, use applyGridToImage instead.")>] |
|
|
|
let applySkiaGridAsync (spec: SkiaSpec) = |
|
|
|
let applySkiaGridAsync (spec: SkiaSpec) = |
|
|
|
async { |
|
|
|
async { |
|
|
|
try |
|
|
|
try |
|
|
@ -204,6 +229,7 @@ namespace DeathSocket |
|
|
|
/// is not in use or needed by another program/process. |
|
|
|
/// is not in use or needed by another program/process. |
|
|
|
/// This is because it is locked whilst in this function. |
|
|
|
/// This is because it is locked whilst in this function. |
|
|
|
/// </remarks> |
|
|
|
/// </remarks> |
|
|
|
|
|
|
|
[<Obsolete("Method is deprecated, use applyGridToImage instead.")>] |
|
|
|
let applySkiaRGBGridAsync (spec: SkiaRGBSpec) = |
|
|
|
let applySkiaRGBGridAsync (spec: SkiaRGBSpec) = |
|
|
|
async { |
|
|
|
async { |
|
|
|
try |
|
|
|
try |
|
|
@ -213,26 +239,4 @@ namespace DeathSocket |
|
|
|
with |
|
|
|
with |
|
|
|
| :? FileNotFoundException as ex -> |
|
|
|
| :? FileNotFoundException as ex -> |
|
|
|
printfn "File could not be found at %s" ex.Message |
|
|
|
printfn "File could not be found at %s" ex.Message |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Not tested |
|
|
|
|
|
|
|
let applyImageToGrid (spec: ImageSpec) = |
|
|
|
|
|
|
|
async { |
|
|
|
|
|
|
|
try |
|
|
|
|
|
|
|
match spec with |
|
|
|
|
|
|
|
| Brush b -> |
|
|
|
|
|
|
|
validateIO b.originalPath b.savePath |> ignore |
|
|
|
|
|
|
|
drawBrushSpecGrid b |
|
|
|
|
|
|
|
| RGBA r -> |
|
|
|
|
|
|
|
validateIO r.originalPath r.savePath |> ignore |
|
|
|
|
|
|
|
drawRGBAGrid r |
|
|
|
|
|
|
|
| Skia s -> |
|
|
|
|
|
|
|
validateIO s.originalPath s.savePath |> ignore |
|
|
|
|
|
|
|
drawSkiaGrid s |
|
|
|
|
|
|
|
| SkiaRGB sR -> |
|
|
|
|
|
|
|
validateIO sR.originalPath sR.savePath |> ignore |
|
|
|
|
|
|
|
drawSkiaRGBGrid sR |
|
|
|
|
|
|
|
with |
|
|
|
|
|
|
|
| :? FileNotFoundException as ex -> |
|
|
|
|
|
|
|
printfn "File could not be found at %s" ex.Message |
|
|
|
|
|
|
|
} |
|
|
|
|