1
|
from configparser import ConfigParser
|
2
|
|
3
|
##
|
4
|
# @brief
|
5
|
#
|
6
|
# This class reads initial values that will be needed to process the edge-blending.
|
7
|
# This class is made by Son and Minghao, Doxygened by Konatsu.
|
8
|
#
|
9
|
|
10
|
|
11
|
class ConfigureReader(object):
|
12
|
|
13
|
# The constructor.
|
14
|
def __init__(self):
|
15
|
self.config = ConfigParser()
|
16
|
self.config.read('config.ini')
|
17
|
|
18
|
##
|
19
|
# @brief
|
20
|
# Get split image height.
|
21
|
# @return image height in int.
|
22
|
def getImageWidth(self):
|
23
|
return int(self.config['DEFAULT']['ImageWidth'])
|
24
|
|
25
|
##
|
26
|
# @brief
|
27
|
# Get split image width.
|
28
|
# @return image width in int.
|
29
|
def getImageHeight(self):
|
30
|
return int(self.config['DEFAULT']['ImageHeight'])
|
31
|
|
32
|
##
|
33
|
# @brief
|
34
|
# Get distance between two projectors.
|
35
|
# @return projector distance in float.
|
36
|
def getProjectorDistance(self):
|
37
|
return float(self.config['DEFAULT']['projector_distance'])
|
38
|
|
39
|
##
|
40
|
# @brief
|
41
|
# Get projected image width.
|
42
|
# @return image width in float.
|
43
|
def getProjectorImageWidth(self):
|
44
|
return float(self.config['DEFAULT']['projector_image_width'])
|
45
|
|
46
|
##
|
47
|
# @brief
|
48
|
# Get gamma value.
|
49
|
# @return gamma value in float.
|
50
|
def getGamma(self):
|
51
|
return float(self.config['DEFAULT']['gamma'])
|
52
|
|
53
|
##
|
54
|
# @brief
|
55
|
# Get edge-blending method.
|
56
|
# @return method in string.
|
57
|
def getMethod(self):
|
58
|
return str(self.config['DEFAULT']['method'])
|
59
|
|
60
|
##
|
61
|
# @brief
|
62
|
# Get image path (image should be put inside src).
|
63
|
# @return image path in string.
|
64
|
def getImagePath(self):
|
65
|
return 'src/' + str(self.config['DEFAULT']['ImageNameLeft']), 'src/' + str(self.config['DEFAULT']['ImageNameRight'])
|
66
|
|
67
|
# @var config
|
68
|
# The configuration file.
|