X-Git-Url: http://git.euphorik.ch/?p=master-thesis.git;a=blobdiff_plain;f=Parasitemia%2FParasitemiaUI%2FTypes.fs;h=5de71e6ee967f5a2df1a481586a555445cbead9e;hp=7d8029487095efe6ffc2f0e6d22ccf749fcc7e4f;hb=cb90b01c85183b2c75ee6d22b378b3ca99df6bf3;hpb=074d6b0377f51e868deb1c427891c722d0270deb diff --git a/Parasitemia/ParasitemiaUI/Types.fs b/Parasitemia/ParasitemiaUI/Types.fs index 7d80294..5de71e6 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 @@ -21,4 +25,17 @@ type SourceImage = { 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