X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=Parasitemia%2FParasitemiaUI%2FTypes.fs;h=e29465c0008a1b686b7a9f9c58fe1483660baece;hb=154264f33619b78e17182082b483cba97e128698;hp=7d8029487095efe6ffc2f0e6d22ccf749fcc7e4f;hpb=4bfa3cbdc6145e6944f02e24829ab2ef3a851ac1;p=master-thesis.git diff --git a/Parasitemia/ParasitemiaUI/Types.fs b/Parasitemia/ParasitemiaUI/Types.fs index 7d80294..e29465c 100644 --- a/Parasitemia/ParasitemiaUI/Types.fs +++ b/Parasitemia/ParasitemiaUI/Types.fs @@ -2,14 +2,23 @@ open System open System.Windows +open System.Windows.Media open Emgu.CV open Emgu.CV.Structure +open Newtonsoft.Json + +let healthyRBColor = Color.FromRgb(255uy, 255uy, 0uy) // Yellow-green. +let infectedRBColor = Color.FromRgb(255uy, 0uy, 40uy) // Red with a bit of blue. + type RBC = { num: int + [] mutable infected: bool + + [] mutable setManually: bool center: Point @@ -18,7 +27,22 @@ type RBC = { type SourceImage = { mutable num: int + mutable name: string + mutable config: ParasitemiaCore.Config.Config mutable dateLastAnalysis: DateTime // UTC. img: Image - mutable rbcs: RBC list } \ No newline at end of file + mutable rbcs: RBC list + + mutable healthyRBCBrightness: float32 + mutable infectedRBCBrightness: float32 } with + + member this.HealthyRBCColor: SolidColorBrush = + let mutable color = healthyRBColor * this.healthyRBCBrightness + color.A <- 255uy; + SolidColorBrush(color) + + member this.InfectedRBCColor: SolidColorBrush = + let mutable color = infectedRBColor * this.infectedRBCBrightness + color.A <- 255uy; + SolidColorBrush(color) \ No newline at end of file