X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=Parasitemia%2FParasitemiaUI%2FTypes.fs;h=92d39b823e692cad018a0d1983652482053f52c7;hb=c4a76a01f62568c6353396ff85551a3151fc5236;hp=7d8029487095efe6ffc2f0e6d22ccf749fcc7e4f;hpb=4bfa3cbdc6145e6944f02e24829ab2ef3a851ac1;p=master-thesis.git diff --git a/Parasitemia/ParasitemiaUI/Types.fs b/Parasitemia/ParasitemiaUI/Types.fs index 7d80294..92d39b8 100644 --- a/Parasitemia/ParasitemiaUI/Types.fs +++ b/Parasitemia/ParasitemiaUI/Types.fs @@ -2,10 +2,14 @@ open System open System.Windows +open System.Windows.Media open Emgu.CV open Emgu.CV.Structure +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 @@ -18,7 +22,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