Multi-Projector
Loading...
Searching...
No Matches
Multi-Projector.SharedData.SharedData Class Reference

This class is used to store shared data between different classes. More...

Public Member Functions

 __init__ (self)
 Initializes the SharedData instance.
 
 write_to_config (self, filename='config.ini')
 Saves current settings to a configuration file.
 
 read_from_config (self, filename='config.ini')
 Loads settings from a configuration file.
 

Public Attributes

 left_image = None
 
 right_image = None
 
int overlap_region = 200
 
bool leftSide = True
 

Detailed Description

This class is used to store shared data between different classes.

The SharedData class maintains information such as images, overlap region width, and a flag for which side (left or right) is active. This data is accessible to other classes, allowing them to read and modify these shared attributes. The class also includes methods for saving and loading the settings to and from a configuration file.

Constructor & Destructor Documentation

◆ __init__()

Multi-Projector.SharedData.SharedData.__init__ ( self)

Initializes the SharedData instance.

The constructor sets up initial values for shared data attributes.

Member Function Documentation

◆ read_from_config()

Multi-Projector.SharedData.SharedData.read_from_config ( self,
filename = 'config.ini' )

Loads settings from a configuration file.

This method reads overlap_region and leftSide values from a specified configuration file (default name: config.ini). If the file is not found, default values are retained.

Parameters
filenameThe name of the configuration file to read from, defaulting to 'config.ini'.
Returns
None

◆ write_to_config()

Multi-Projector.SharedData.SharedData.write_to_config ( self,
filename = 'config.ini' )

Saves current settings to a configuration file.

This method writes the current values of overlap_region and leftSide to a configuration file (default name: config.ini) in the [DEFAULT] section. This allows the settings to be persisted across sessions and loaded later.

Parameters
filenameThe name of the configuration file to write to, defaulting to 'config.ini'.
selfthe object pointer
Returns
None

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