Add an option to change the brightness of the highlight box color (healthy/infected...
[master-thesis.git] / Parasitemia / ParasitemiaUI / Types.fs
1 module ParasitemiaUI.Types
2
3 open System
4 open System.Windows
5 open System.Windows.Media
6
7 open Emgu.CV
8 open Emgu.CV.Structure
9
10 let healthyRBColor = Color.FromRgb(255uy, 255uy, 0uy) // Yellow-green.
11 let infectedRBColor = Color.FromRgb(255uy, 0uy, 40uy) // Red with a bit of blue.
12
13 type RBC = {
14 num: int
15
16 mutable infected: bool
17 mutable setManually: bool
18
19 center: Point
20 size: Size
21 infectedArea: int }
22
23 type SourceImage = {
24 mutable num: int
25 mutable config: ParasitemiaCore.Config.Config
26 mutable dateLastAnalysis: DateTime // UTC.
27 img: Image<Bgr, byte>
28 mutable rbcs: RBC list
29
30 mutable healthyRBCBrightness: float32
31 mutable infectedRBCBrightness: float32 } with
32
33 member this.HealthyRBCColor: SolidColorBrush =
34 let mutable color = healthyRBColor * this.healthyRBCBrightness
35 color.A <- 255uy;
36 SolidColorBrush(color)
37
38 member this.InfectedRBCColor: SolidColorBrush =
39 let mutable color = infectedRBColor * this.infectedRBCBrightness
40 color.A <- 255uy;
41 SolidColorBrush(color)