Project

General

Profile

UML Diagram » History » Version 13

Areeba KHAN, 01/16/2025 01:59 PM

1 1 Chung Hsi LIN
h1. UML Diagram
2 2 Chung Hsi LIN
3 7 Man Mong CHAN
[[Wiki]] | [[About_Us]] | [[Project_Overview]] | [[UML_Diagram]] | [[Codes]]
4 5 Mitsuki EIKI
5
6 10 Kentaro HARATAKE
| !PBL4UMLdiagram.png! |
7 12 Areeba KHAN
8 13 Areeba KHAN
h1.  **1. Config Class**
9
Represents configuration settings for image processing and display.
10 1 Chung Hsi LIN
11 13 Areeba KHAN
h2. **Attributes**:
12
- `projection_distance: float`: The distance of the projector.
13
- `projector_distance: float = prd`: Alias for `projection_distance`.
14
- `img_width: int`: Width of the image.
15
- `img_height: int`: Height of the image.
16
- `img_path: String`: Path to the image file.
17
- `gamma: float`: Gamma value for image correction.
18
- `overlapWidth: int`: Overlap width between two projected images.
19
- `side: String`: The side (e.g., left or right) of the image projection.
20
- `isDualMonitor: boolean`: Indicates if dual monitors are being used.
21
- `monitorWidth: int`: Width of the monitor.
22 1 Chung Hsi LIN
23 13 Areeba KHAN
h2. **Functions**:
24
- `__init__(...)`: Constructor to initialize configuration parameters such as projection distance, image dimensions, overlap width, etc.
25
- `getProjectionDistance(): float`: Returns the projection distance.
26
- `getImgWidth(): int`: Returns the width of the image.
27
- `getImgHeight(): int`: Returns the height of the image.
28
- `getImgPath(): String`: Returns the path of the image.
29
- `getGamma(): float`: Returns the gamma value.
30
- `getOverlapWidth(): int`: Returns the overlap width.
31
- `getSide(): String`: Returns the side (e.g., "left" or "right").
32
- `getIsDualMonitor(): boolean`: Indicates if dual monitors are used.
33
- `getMonitorWidth(): int`: Returns the width of the monitor.
34
- `readConfigFile(): Config`: Reads configuration details from a file and returns a Config object.
35 1 Chung Hsi LIN
36
37 13 Areeba KHAN
38
h1. **2. ImgProcessor Class**
39
Handles image processing tasks like blending, gamma correction, and cropping.
40
41
h2. **Attributes**:
42
- `config: Config`: Holds a reference to a Config object for accessing settings.
43
44
h2. **Functions**:
45
- `__init__(config: Config): void`: Constructor to initialize the ImgProcessor with a Config object.
46
- `alphaBlend(l_img: byte[], r_img: byte[]): NDArray`: Blends two images (left and right) and returns the result as an array.
47
- `GammaCorrection(img: byte[]): byte[]`: Applies gamma correction to the given image and returns the corrected image.
48
- `CropImage(): byte[]`: Crops the image as per configuration and returns the cropped image.
49
- `operation0(): void`: A placeholder method for any additional operation (not detailed in the diagram).
50
51
52
53
h1. **3. DisplayImg Class**
54
Represents an image to be displayed, with attributes like width, height, overlap, and side.
55
56
h2. **Attributes**:
57
- `p_width: int`: Width of the image.
58
- `p_height: int`: Height of the image.
59
- `p_overlap: float`: Overlap area of the image.
60
- `img: byte[]`: The image data in byte format.
61
- `side: String`: The side (e.g., "left" or "right") where the image is displayed.
62
63
h2. **Functions**:
64
- `__init__(w: int, h: int, overlap: float, img: byte[], side: String): void`: Constructor to initialize the image dimensions, overlap, and side.
65
- `getImg(): byte[]`: Returns the image data.
66
- `getWidth(): int`: Returns the width of the image.
67
- `getHeight(): int`: Returns the height of the image.
68
- `getOverlap(): int`: Returns the overlap area.
69
- `getSide(): String`: Returns the side of the image.
70
71
72
73
h1. **4. MainStitcher Class**
74
Main controller class for image stitching and display.
75
76
h2. **Attributes**:
77
- `displayImg: DisplayImg`: Holds a reference to a DisplayImg object for managing image display.
78
79
h2. **Functions**:
80
- `__init__(dlImg: int): void`: Constructor to initialize the main stitcher with a DisplayImg object.
81
- `singleDisplay(): void`: Manages the display of a single image.
82
- `doubleDisplay(monitorWidth: int): void`: Manages the display of two images, considering the monitor width.
83
- `main(): void`: The main method that runs the entire program workflow.
84
85
86
87
h1.  Summary of Interactions:
88
- The Config class provides settings to other classes (`ImgProcessor` and `MainStitcher`).
89
- The ImgProcessor uses Config to process images.
90
- The DisplayImg class stores the image data and provides its properties to `MainStitcher`.
91
- The MainStitcher orchestrates the overall workflow, including image stitching and display management.