UML Diagram » History » Revision 13
Revision 12 (Areeba KHAN, 01/16/2025 01:52 PM) → Revision 13/17 (Areeba KHAN, 01/16/2025 01:59 PM)
h1. UML Diagram [[Wiki]] | [[About_Us]] | [[Project_Overview]] | [[UML_Diagram]] | [[Codes]] | !PBL4UMLdiagram.png! | h1. **1. Config Class** 1. **Config Class ** : - Represents the configuration settings for image processing and display. h2. **Attributes**: - `projection_distance: float`: The distance of the projector. - `projector_distance: float = prd`: Alias for `projection_distance`. - `img_width: int`: Width of the image. - `img_height: int`: Height of the image. - `img_path: String`: Path to the image file. - `gamma: float`: Gamma value for image correction. - `overlapWidth: int`: Overlap width between two projected images. - `side: String`: The side (e.g., left or right) of the image projection. - `isDualMonitor: boolean`: Indicates if dual monitors are being used. - `monitorWidth: int`: Width of the monitor. h2. **Functions**: - `__init__(...)`: Constructor to initialize configuration Attributes include parameters such as like projection distance, image dimensions, dimensions (width and height), gamma, overlap width, etc. and monitor details. - `getProjectionDistance(): float`: Returns the projection distance. - `getImgWidth(): int`: Returns the width of the image. - `getImgHeight(): int`: Returns the height of the image. - `getImgPath(): String`: Returns the path of the image. - `getGamma(): float`: Returns the gamma value. - `getOverlapWidth(): int`: Returns the overlap width. - `getSide(): String`: Returns the side (e.g., "left" or "right"). - `getIsDualMonitor(): boolean`: Indicates if dual monitors are used. - `getMonitorWidth(): int`: Returns the width of the monitor. - `readConfigFile(): Config`: Reads Provides methods to retrieve and manipulate configuration details from a file data, such as `getProjectionDistance()`, `getImgHeight()`, `getSide()`, and returns a Config object. h1. **2. ImgProcessor Class** `readConfigFile()`. 2. **ImgProcessor Class**: - Handles image processing tasks like blending, gamma correction, and cropping. h2. **Attributes**: tasks. - `config: Config`: Holds Uses a reference to a Config object for accessing to access configuration settings. h2. **Functions**: - `__init__(config: Config): void`: Constructor to initialize the ImgProcessor with a Config object. - `alphaBlend(l_img: byte[], r_img: byte[]): NDArray`: Blends two images (left and right) and returns the result as an array. - `GammaCorrection(img: byte[]): byte[]`: Applies gamma correction to the given Key methods include alphaBlend() for blending images, GammaCorrection() for image enhancement, and returns the corrected image. CropImage() for cropping images. 3. **DisplayImg Class**: - `CropImage(): byte[]`: Crops the image as per configuration and returns the cropped image. - `operation0(): void`: A placeholder method for any additional operation (not detailed in the diagram). h1. **3. DisplayImg Class** Represents an image to be displayed, with attributes like displayed. - Attributes include image width, height, overlap, overlap information, and side. h2. **Attributes**: - `p_width: int`: Width of the image. - `p_height: int`: Height side of the image. display. - `p_overlap: float`: Overlap area of the image. - `img: byte[]`: The image data in byte format. - `side: String`: The side (e.g., "left" or "right") where the image is displayed. h2. **Functions**: - `__init__(w: int, h: int, overlap: float, img: byte[], side: String): void`: Constructor Methods allow access to initialize the image dimensions, overlap, properties, such as `getImg()`, `getWidth()`, `getHeight()`, and side. `getSide()`. 4. **MainStitcher Class**: - `getImg(): byte[]`: Returns Acts as the image data. - `getWidth(): int`: Returns the width of the image. - `getHeight(): int`: Returns the height of the image. - `getOverlap(): int`: Returns the overlap area. - `getSide(): String`: Returns the side of the image. h1. **4. MainStitcher Class** Main controller main control class for image stitching and display. h2. **Attributes**: displaying images. - `displayImg: DisplayImg`: Holds Has a reference to a dependency on DisplayImg object for managing image display. h2. **Functions**: - `__init__(dlImg: int): void`: Constructor to initialize manage the main stitcher with a DisplayImg object. - `singleDisplay(): void`: Manages the display of a stitched images. - Provides methods for single image. and double displays (`singleDisplay()` and `doubleDisplay()`). - `doubleDisplay(monitorWidth: int): void`: Manages Contains the display of two images, considering the monitor width. - `main(): void`: The main main() method that runs to execute the entire program workflow. h1. Summary program. Each class is modular, focusing on specific aspects of Interactions: - The Config class provides settings to other classes (`ImgProcessor` and `MainStitcher`). - The ImgProcessor uses Config to process images. - The DisplayImg class stores the image data and provides its properties to `MainStitcher`. - The MainStitcher orchestrates the overall workflow, including image stitching and display management. system, with clear interactions between them.