Project

General

Profile

Feature #1315 » img_processor.py

Jiaye DING, 01/08/2025 12:11 AM

 
1
#!/usr/bin/env python
2
# -*- coding: utf-8 -*-
3

    
4
class DisplayImg(object):
5
    """
6
    @class DisplayImg
7
    @brief Represents the display settings and image configuration for a projection system.
8

    
9
    This class includes properties like display dimensions, projector distance, overlap,
10
    and the image to be displayed. It provides methods to access these properties.
11
    """
12

    
13
    def __init__(self, w, h, d, len, overlap, img, s, config):
14
        """
15
        @brief Initializes the DisplayImg object with the given parameters.
16
        @param w Width of the projection area in pixels.
17
        @param h Height of the projection area in pixels.
18
        @param d Distance between the projectors and the display surface.
19
        @param len Reserved parameter (currently unused in the code).
20
        @param overlap Overlap between adjacent projectors in pixels.
21
        @param img File path or identifier for the image to be displayed.
22
        @param s Side of the projection (e.g., left or right, depending on system design).
23
        @param config Configuration settings for the projection (unused in this implementation).
24
        """
25
        self.__p_width = w
26
        self.__p_height = h
27
        self.__p_distance = d
28
        self.__p_overlap = overlap
29
        self.__img = img
30
        self.__side = s
31

    
32
    def getImage(self):
33
        """
34
        @brief Retrieves the image configuration or file path.
35
        @return The file path or identifier for the image to be displayed.
36
        @note Consider extending this method to return a drawn or processed image output in the future.
37
        """
38
        return self.__img
39

    
40
    def getWidth(self):
41
        """
42
        @brief Retrieves the width of the projection area.
43
        @return The width of the projection area in pixels.
44
        """
45
        return self.__p_width
46

    
47
    def getHeight(self):
48
        """
49
        @brief Retrieves the height of the projection area.
50
        @return The height of the projection area in pixels.
51
        """
52
        return self.__p_height
53

    
54
    def getOverlap(self):
55
        """
56
        @brief Retrieves the overlap between adjacent projectors.
57
        @return The overlap value in pixels.
58
        """
59
        return self.__p_overlap
(3-3/4)