Project

General

Profile

Feature #1315 » display_img.py

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

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

    
4
class Config(object):
5
    """
6
    @class Config
7
    @brief This class holds configuration settings for an image projection system.
8

    
9
    It includes parameters such as projection distance, image dimensions,
10
    image file path, gamma correction value, and projector distance.
11
    """
12

    
13
    def __init__(self, pnd, w, h, p, gamma, prd):
14
        """
15
        @brief Initializes the Config object with the given parameters.
16
        @param pnd Distance between the screen and projectors (projection distance).
17
        @param w Image width in pixels.
18
        @param h Image height in pixels.
19
        @param p File path to the image.
20
        @param gamma Gamma correction value.
21
        @param prd Distance between projectors.
22
        """
23
        self.__projection_distance = pnd
24
        self.__img_width = w
25
        self.__img_height = h
26
        self.__img_path = p
27
        self.__gamma = gamma
28
        self.__projector_diatance = prd
29

    
30
    def getProjectionDistance(self):
31
        """
32
        @brief Retrieves the projection distance.
33
        @return The distance between the screen and projectors.
34
        """
35
        return self.__projection_distance
36

    
37
    def getImgWidth(self):
38
        """
39
        @brief Retrieves the image width.
40
        @return The width of the image in pixels.
41
        """
42
        return self.__img_width
43

    
44
    def getImgHeight(self):
45
        """
46
        @brief Retrieves the image height.
47
        @return The height of the image in pixels.
48
        """
49
        return self.__img_height
50

    
51
    def getImgPath(self):
52
        """
53
        @brief Retrieves the image file path.
54
        @return The file path of the image.
55
        """
56
        return self.__img_path
57

    
58
    def getGamma(self):
59
        """
60
        @brief Retrieves the gamma correction value.
61
        @return The gamma correction value.
62
        """
63
        return self.__gamma
64

    
65
    def readConfigFile(self):
66
        """
67
        @brief Reads configuration data from a file.
68
        @note This method is currently incomplete and requires implementation.
69
        """
70
        CReader = ConfigReader("config_left.ini")
71
        ##CHANGE THIS CUZ NOT DONE
(2-2/4)