Multi Projector System 4
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
ui.ImageDisplayApp Class Reference

Main application class for projection blending controller. More...

Public Member Functions

 __init__ (self, tk.Tk root)
 Constructor that initializes the application.
 
 setup_window (self)
 Sets up the main application window properties.
 
 setup_ui (self)
 Creates and arranges all UI components.
 
 run_processing_update (self)
 Executes image processing with current parameters.
 
 update_display (self, images_dict)
 Updates the GUI with processed images.
 
 show_fullscreen (self, key)
 Displays an image in fullscreen mode.
 
 run_calibration (self)
 Runs the auto-calibration process.
 

Public Attributes

 root
 The main Tkinter root window.
 
 cfg
 Configuration reader instance for loading settings.
 
 processor
 Image processor instance for handling projections.
 
 labels
 Dictionary of image label widgets.
 
 image_paths
 Dictionary of image file paths.
 
 image_frame
 
 param_var
 Integer variable for overlap parameter.
 
 blend_var
 String variable for blend mode selection.
 

Protected Member Functions

 debounced_update (self)
 Schedules a debounced update after parameter changes.
 

Protected Attributes

 _update_job
 Job ID for debounced update scheduling.
 

Detailed Description

Main application class for projection blending controller.

The ImageDisplayApp class creates a GUI application that allows users to:

The application uses configuration files to load initial settings and processes images in real-time based on user input.

Usage Example

root = tk.Tk()
app = ImageDisplayApp(root)
root.mainloop()

Constructor & Destructor Documentation

◆ __init__()

ui.ImageDisplayApp.__init__ (   self,
tk.Tk  root 
)

Constructor that initializes the application.

Initializes the projection blending controller application by:

  • Setting up the main window
  • Loading configuration from config.ini
  • Creating the image processor
  • Building the user interface
Parameters
rootThe Tkinter root window instance
Exceptions
ExceptionIf configuration file is missing or initialization fails

Member Function Documentation

◆ debounced_update()

ui.ImageDisplayApp.debounced_update (   self)
protected

Schedules a debounced update after parameter changes.

Cancels any pending updates and schedules a new update after 500ms delay. This prevents excessive processing during rapid parameter changes.

Returns
None

◆ run_calibration()

ui.ImageDisplayApp.run_calibration (   self)

Runs the auto-calibration process.

Executes calibration to automatically adjust the overlap parameter for optimal projection alignment. Updates the overlap value and triggers image reprocessing.

Returns
None
Exceptions
ExceptionShows error dialog if calibration fails

◆ run_processing_update()

ui.ImageDisplayApp.run_processing_update (   self)

Executes image processing with current parameters.

Retrieves current overlap and blend mode values, processes the images, and updates the display with the results.

Returns
None
Exceptions
ExceptionPrints error message if processing fails

◆ setup_ui()

ui.ImageDisplayApp.setup_ui (   self)

Creates and arranges all UI components.

Sets up the user interface including:

  • Image display labels for main, left, and right projections
  • Control widgets for overlap and blend mode
  • Action buttons for fullscreen and calibration
  • Event bindings for parameter updates
Returns
None

◆ setup_window()

ui.ImageDisplayApp.setup_window (   self)

Sets up the main application window properties.

Configures the window title, size, and background color.

Returns
None

◆ show_fullscreen()

ui.ImageDisplayApp.show_fullscreen (   self,
  key 
)

Displays an image in fullscreen mode.

Opens a fullscreen window displaying the specified image. The window can be closed by pressing the Escape key. The image refreshes every 100ms to show updates.

Parameters
keyThe image key ("main", "left", or "right")
Returns
None
Warning
Shows warning message if image file doesn't exist

◆ update_display()

ui.ImageDisplayApp.update_display (   self,
  images_dict 
)

Updates the GUI with processed images.

Converts numpy arrays to PhotoImage objects and displays them in the corresponding label widgets. Handles both BGR and BGRA formats.

Parameters
images_dictDictionary mapping image keys to numpy arrays
Returns
None

Member Data Documentation

◆ _update_job

ui.ImageDisplayApp._update_job
protected

Job ID for debounced update scheduling.

Used to cancel pending updates when new changes occur

◆ image_paths

ui.ImageDisplayApp.image_paths

Dictionary of image file paths.

Maps image types to their file paths

◆ labels

ui.ImageDisplayApp.labels

Dictionary of image label widgets.

Maps keys ("main", "left", "right") to their Label widgets


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