Skip to content

Logic flow

Logic flow diagram for the Web capture library

flowchart TD
    A(Component mounted) --> AA[/beforeInitialize/]
    AA --> B[Initialize security and detection modules]
    B --> BB{Successful initialization}
    BB -->|Security module error| D[/error/]
    BB -->|Detection module error| D
    BB -->|Yes| E[/initialize/]

    F(Action openCamera) --> G[/beforeOpen/]
    G --> H[Request camera permission and show video]
    H --> HH{Successful camera opening}
    HH -->|Permission denied| DDD[/error/]
    HH -->|Camera error| DDD
    HH -->|Yes| I[/open/]
    I --> J[Start detection]
    J --> K[/detection/]
    K --> KK{Successful detection}
    KK -->|No| K
    KK -->|Yes| M

    L(Action takePhoto) --> M[/beforeCapture/]
    M --> N[Capture photo and encrypt data]
    N --> NN{Successful capturing and encryption}
    NN -->|Capture error| DDDD[/error/]
    NN -->|Encryption error| DDDD
    NN -->|Yes| O[/capture/]
    O --> Q

    P(Action closeCamera) --> Q[Close camera and hide video]
    Q --> R[/close/]