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

A class to handle various commands related to image processing and display. More...

Public Member Functions

 __init__ (self, gui, shared_data)
 Initializes the Commands instance.
 
 load_left_image (self)
 Loads the left image from a file.
 
 load_right_image (self)
 Loads the right image from a file.
 
 smooth_gradient (self, length, rate)
 Creates a smooth gradient for the overlap region.
 
 show_left_image (self)
 Displays the left image with a smooth gradient applied to the overlap region.
 
 show_right_image (self)
 Displays the right image with a smooth gradient applied to the overlap region.
 
 show_right_original (self)
 Displays the original left image without any modifications.
 
 show_left_original (self)
 Displays the original right image without any modifications.
 
 set_overlap_region (self)
 Sets the overlap region for image processing.
 
 increase_overlap (self)
 Increases the overlap region value by one.
 
 decrease_overlap (self)
 Decreases the overlap region value by one.
 

Public Attributes

 gui = gui
 
 shared_data = shared_data
 
 io = ImageIO(shared_data)
 

Detailed Description

A class to handle various commands related to image processing and display.

The Commands class provides methods for loading, displaying, and adjusting the overlap region for images within a graphical user interface (GUI). It also supports image blending for overlapping regions with smooth gradient transitions.

Constructor & Destructor Documentation

◆ __init__()

Multi-Projector.Commands.Commands.__init__ ( self,
gui,
shared_data )

Initializes the Commands instance.

Sets up the GUI interface, shared data, and ImageIO for image operations.

Parameters
guiThe GUI instance used for displaying images and receiving user input.
shared_dataThe shared data structure that holds images and other state information.
Returns
None

Member Function Documentation

◆ decrease_overlap()

Multi-Projector.Commands.Commands.decrease_overlap ( self)

Decreases the overlap region value by one.

Decrements the overlap region by one (ensuring it does not go negative) and redisplays the current image with the updated overlap.

Returns
None

◆ increase_overlap()

Multi-Projector.Commands.Commands.increase_overlap ( self)

Increases the overlap region value by one.

Increments the overlap region by one and redisplays the current image with the updated overlap.

Returns
None

◆ load_left_image()

Multi-Projector.Commands.Commands.load_left_image ( self)

Loads the left image from a file.

Opens a file dialog for the user to select a left image file. If a file is selected, it is loaded into the shared data.

Returns
None
Warning
This method does not check the file format or image content.

◆ load_right_image()

Multi-Projector.Commands.Commands.load_right_image ( self)

Loads the right image from a file.

Opens a file dialog for the user to select a right image file. If a file is selected, it is loaded into the shared data.

Returns
None
Warning
This method does not check the file format or image content.

◆ set_overlap_region()

Multi-Projector.Commands.Commands.set_overlap_region ( self)

Sets the overlap region for image processing.

Updates the overlap region value from the GUI input, updates the shared data, and redisplays the current image (left or right) with the new overlap setting.

Returns
None

◆ show_left_image()

Multi-Projector.Commands.Commands.show_left_image ( self)

Displays the left image with a smooth gradient applied to the overlap region.

If a left image is available, this method applies a smooth gradient to its overlapping region and displays it on the GUI canvas. If no left image is loaded, an error message is shown.

Returns
None

◆ show_left_original()

Multi-Projector.Commands.Commands.show_left_original ( self)

Displays the original right image without any modifications.

If a right image is loaded, it displays the original right image on the GUI canvas.

Returns
Nothing returned.

◆ show_right_image()

Multi-Projector.Commands.Commands.show_right_image ( self)

Displays the right image with a smooth gradient applied to the overlap region.

If a right image is available, this method applies a smooth gradient to its overlapping region and displays it on the GUI canvas. If no right image is loaded, an error message is shown.

Returns
None

◆ show_right_original()

Multi-Projector.Commands.Commands.show_right_original ( self)

Displays the original left image without any modifications.

If a left image is loaded, it displays the original left image on the GUI canvas.

Returns
None

◆ smooth_gradient()

Multi-Projector.Commands.Commands.smooth_gradient ( self,
length,
rate )

Creates a smooth gradient for the overlap region.

Generates a gradient that transitions from full brightness to zero using a non-linear quadratic falloff. The gradient is scaled by the specified rate and clipped to be between 0 and 1.

Parameters
lengthThe length of the gradient.
rateA scaling factor to control the gradient's intensity.
Returns
A numpy array containing the gradient.

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