# olsoldin/openview architecture

> Architecture diagram of the GitHub repository olsoldin/openview, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/olsoldin/openview
- Repository: https://github.com/olsoldin/openview

## Overview

##### Main Components

a) Input Processing Layer
- IMQ file input handling
- JSON configuration/metadata processing
- Engineering data extraction

b) Core Decompression Engine
- Main decompression logic (based on Decomp.java)
- Huffman First Difference decoding process
- Utility functions (from Util.java)

c) Image Processing Layer
- Image reconstruction components
- Format conversion capabilities

d) Output Generation Layer
- PNG image output
- JSON metadata output

##### Component Relationships

**[IMQ Input] → [Metadata Extractor] → [Decompression Engine] → [Image Processor] → [Output Generator]**
- ↓                                                                    ↓
- [JSON Metadata] ←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←← [Final Output]

##### Technical Details

- Blue: Input components
- Green: Processing components
- Orange: Output components
- Gray: Data flows

Technical specifications:
- Input format: IMQ (Voyager image format)
- Output formats: PNG + JSON
- Image specifications (800x800 pixels, 8-bit)
- Encoding type: Huffman First Difference
- Key metadata fields (spacecraft name, timing, etc.)

##### Implementation Details

Key classes and their relationships:
- Main.java: Entry point and orchestration
- IMQ.java: Image format handling
- Decomp.java: Core decompression logic
- Util.java: Support functions
- Test.java: Validation components

##### Future Extensions

- GUI Frontend (planned)
- Unknown Record Handler (planned)
- Corruption Recovery System (planned)

##### System Requirements

- Java 7+ requirement
- Apache Ant build system
- JVM compatibility

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles and classes
    classDef input fill:#a8d1f0,stroke:#000
    classDef processing fill:#90EE90,stroke:#000
    classDef output fill:#FFB347,stroke:#000
    classDef planned fill:#fff,stroke:#666,stroke-dasharray: 5 5
    classDef reference fill:#D3D3D3,stroke:#000
    classDef error fill:#FFB6C1,stroke:#000

    %% Main Pipeline
    subgraph Pipeline
        Input["IMQ File Input"]:::input
        MetaExtract["Metadata Extractor"]:::processing
        DecompEngine["Decompression Engine"]:::processing
        ImgProc["Image Processor"]:::processing
        OutGen["Output Generator"]:::output
        JsonMeta["JSON Metadata"]:::output
        FinalOut["Final Output\n(PNG + JSON)"]:::output

        Input --> MetaExtract
        MetaExtract --> DecompEngine
        MetaExtract --> JsonMeta
        DecompEngine --> ImgProc
        ImgProc --> OutGen
        JsonMeta --> FinalOut
        OutGen --> FinalOut
    end

    %% Implementation Components
    subgraph Implementation
        Main["Main.java\n(Orchestration)"]:::processing
        IMQ["IMQ.java\n(Format Handler)"]:::processing
        Decomp["Decomp.java\n(Core Logic)"]:::processing
        Util["Util.java\n(Support)"]:::processing
        Test["Test.java\n(Validation)"]:::processing
    end

    %% Reference Section
    subgraph Reference
        Archive["Archive"]:::reference
        ForImpl["FORTRAN Implementation"]:::reference
        CImpl["C Implementation"]:::reference
        
        Archive --> ForImpl
        Archive --> CImpl
    end

    %% Planned Features
    subgraph Future
        direction TB
        GUI["GUI Frontend"]:::planned
        UnkHandler["Unknown Record Handler"]:::planned
        CorrRecov["Corruption Recovery"]:::planned
    end

    %% Error Handling
    subgraph ErrorHandling
        ErrSystem["Error Processing\nPartial Recovery"]:::error
    end

    %% System Requirements
    subgraph Requirements
        SysReq["System Requirements\nJava 7+\nApache Ant\nJVM Compatible"]:::reference
    end

    %% Click events for component mapping
    click Main "https://github.com/olsoldin/OpenView/blob/master/src/Main.java"
    click IMQ "https://github.com/olsoldin/OpenView/blob/master/src/IMQ.java"
    click Decomp "https://github.com/olsoldin/OpenView/blob/master/src/Decomp.java"
    click Util "https://github.com/olsoldin/OpenView/blob/master/src/Util.java"
    click Test "https://github.com/olsoldin/OpenView/blob/master/src/Test.java"
    click Archive "https://github.com/olsoldin/OpenView/tree/master/archive/software/"
    click ForImpl "https://github.com/olsoldin/OpenView/blob/master/archive/software/decomp.for"
    click CImpl "https://github.com/olsoldin/OpenView/blob/master/archive/software/decomp.c"

    %% Legend
    subgraph Legend
        L1["Input Component"]:::input
        L2["Processing Component"]:::processing
        L3["Output Component"]:::output
        L4["Planned Feature"]:::planned
        L5["Reference Component"]:::reference
        L6["Error Handling"]:::error
    end
```
