Browse Source

add XML comments and minor refactoring to GridPainter.

master
Craig Oates 5 years ago
parent
commit
6ef653714c
  1. 2
      DeathSocket/Domain.fs
  2. 29
      DeathSocket/GridPainter.fs

2
DeathSocket/Domain.fs

@ -106,7 +106,7 @@
| SkiaRGB of SkiaRGBSpec
/// Discriminated Union representing the graphics libraries used by
/// Desth Socket. Useful for selecting which one you want to use.
/// Death Socket. Useful for selecting which one you want to use.
/// System.Drawing for using Windows/Mono and SkiaSharp for Xamarin.
type ImageType =
| SkiaSharp of string

29
DeathSocket/GridPainter.fs

@ -15,7 +15,6 @@ namespace DeathSocket
open Validation
open ImageServices
open System
/// <summary>
/// Uses the information included in spec to create a gridded image.
@ -26,10 +25,6 @@ namespace DeathSocket
/// ImageSpec is a discriminated union, consisting of a Brush, RGBA,
/// Skia or SkiaRGB spec.
/// </param>
/// <exeption cref="System.IO.FileNotFoundException">
/// If the file the grid is being applied to cannot be found,
/// a FileNotFoundException will be thrown.
/// </exception>
/// <remarks>
/// Make sure the image, which is having the overlay added to it,
/// is not in use or needed by another program/process.
@ -85,12 +80,22 @@ namespace DeathSocket
// NOT TESTED
/// <summary>
///
/// Reads an (jpg or png) image and return its width and height as a
/// tuple, (width * hight).
/// </summary>
/// <param name="imageType"></param>
let determineImageDimensions imageType =
/// <param name="imageType">
/// The name of the graphics library used to read and determine the
/// images dimensions.
/// </param>
/// <remarks>
/// The image type is determined by the graphics library used. It is
/// called "ImageType" and not "GraphicsLibUsed" because the image/file
/// information is the thing this function cares about most of all. How
/// it is read and what library it uses it secondary.
///</remarks>
let determineImageDimensions (iType: ImageType) =
try
match imageType with
match iType with
| SkiaSharp s ->
validateFilePath s |> ignore
determineSkiaDimensions s
@ -100,7 +105,7 @@ namespace DeathSocket
with
| :? FileNotFoundException as ex ->
printfn "%s" ex.Message
(0,0)
reraise ()
// System.Drawing Functions
// ========================================================================
@ -151,8 +156,8 @@ namespace DeathSocket
/// Use this function when targeting .Net/Mono).
/// </summary>
/// <param name="spec">
///The specification which the brush is made from.
///</param>
/// The specification which the brush is made from.
/// </param>
/// <remarks>
/// Death Socket uses System.Drawing and not System.Media for colours
/// and brushes.

Loading…
Cancel
Save