PBL Group 21

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | List of all members
config_reader.ConfigReader Class Reference
Inheritance diagram for config_reader.ConfigReader:

## Public Member Functions
| __init__ (self)
| getProjectedImageWidth (self)
| getDistanceBetweenProjectors (self)
| getImageWidth (self)
| getImageHeight (self)
| getImageName (self)
| getSide (self)
| getGamma (self)

## Public Attributes
| CONFIG_FILENAME

## Static Public Attributes
str | CONFIG_FILENAME = "config.json"

## Protected Member Functions
| _load_config (self)

## Detailed Description

    @brief A helper class for reading configuration values from config.json.
    @details
    The class loads parameters only once during initialization and provides
    getters which will be used by the MainAlphaBlender class.
    @see main_alpha_blender.py

## Constructor & Destructor Documentation

## ◆ __init__()

config_reader.ConfigReader.__init__ | ( |  | self | ) |

    @brief This is the constructor and this loads config.json into memory if it exists.
    @details
    If the JSON file does not exist, default values will be used.

## Member Function Documentation

## ◆ _load_config()

config_reader.ConfigReader._load_config | ( |  | self | ) |
| protected

    @brief Internal function to load JSON configuration.
    @details
    This function opens config.json (if present) and loads settings into a dictionary.
    For the missing files, this will not raise any error but defaults will be used instead.

## ◆ getDistanceBetweenProjectors()

config_reader.ConfigReader.getDistanceBetweenProjectors | ( |  | self | ) |

    @brief This returns the physical distance between projector lenses in centimeters.
    @details this is used to compute percentage of overlap between the two images.
    @return return  Distance between projectors in float or 0 in case of wrong format.
    @see main_alpha_blender.py

## ◆ getGamma()

config_reader.ConfigReader.getGamma | ( |  | self | ) |

    @brief This returns the gamma value used for mask correction.
    @details Typical projector gamma is around 2.2.
    @return return Gamma value in float.
    @see main_alpha_blender.py

## ◆ getImageHeight()

config_reader.ConfigReader.getImageHeight | ( |  | self | ) |

    @brief this returns the pixel height of the input image.
    @return return the Pixel height (default 1080) in int.
    @see main_alpha_blender.py

## ◆ getImageName()

config_reader.ConfigReader.getImageName | ( |  | self | ) |

    @brief this returns the file name of the image to process.
    @return return Input image path in string.
    @see main_alpha_blender.py

## ◆ getImageWidth()

config_reader.ConfigReader.getImageWidth | ( |  | self | ) |

    @brief this returns the pixel width of the input image.
    @return return the Pixel width (default 1920) in int.
    @see main_alpha_blender.py

## ◆ getProjectedImageWidth()

config_reader.ConfigReader.getProjectedImageWidth | ( |  | self | ) |

    @brief This returns the physical width of the projected image.
    @details This is the width of *one* projector's image in centimeters.
    @return return  Projected image width in float or 0 if not found or invalid.
    @see main_alpha_blender.py

## ◆ getSide()

config_reader.ConfigReader.getSide | ( |  | self | ) |

    @brief This returns which projector side this instance represents.
    @details Valid values are `"left"` or `"right"`. Defaults to `"left"`.
    @return return the  Blend side in lowercase in string i.e "left" or "right".
    @see main_alpha_blender.py

The documentation for this class was generated from the following file:

- /Users/kaungzinthu/Desktop/projectpbl2/config_reader.py