Package paletai.mapping
Class Screen
java.lang.Object
paletai.mapping.Screen
Represents a physical or virtual display screen for video mapping.
The Screen class manages the rendering of media content to a specific display, handling both normal rendering and transitions between scenes. Each screen can be assigned to a physical display or used as a virtual screen for preview.
Key features include:
- Display assignment and configuration
- Media content rendering with transition effects
- Offscreen buffer management for efficient rendering
- Mouse interaction handling for media items
- XML serialization for project saving/loading
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionScreen(processing.core.PApplet p, int id) Constructs a new Screen with the specified ID. -
Method Summary
Modifier and TypeMethodDescriptionvoidassignToDisplay(Rectangle bounds) Assigns this screen to a physical display with specified bounds.processing.opengl.PGraphics2DReturns the offscreen graphics buffer for this screen.voidmoveHoverPoint(float mousex, float mousey) Updates hover point position for all media items on this screen.voidrender(int mousex, int mousey) Renders the screen content and displays it at the correct position.voidsetPreviewArea(float px, float py, float pw, float ph) Sets the preview area dimensions for media item preview rendering.voidsetTransitionState(ArrayList<MediaItem> currentMedia, ArrayList<MediaItem> nextMedia, float progress) Sets up transition state between two sets of media items.voidshow()Displays the screen buffer at its assigned position.voidUpdates the media list for normal rendering without transitions.
-
Field Details
-
pg
public processing.opengl.PGraphics2D pgOffscreen buffers for current and next scene rendering -
nextPg
public processing.opengl.PGraphics2D nextPgOffscreen buffers for current and next scene rendering
-
-
Constructor Details
-
Screen
public Screen(processing.core.PApplet p, int id) Constructs a new Screen with the specified ID. Initializes with default unassigned dimensions and creates offscreen buffers.- Parameters:
p- The parent PApplet instanceid- The unique identifier for this screen
-
-
Method Details
-
updateMediaList
Updates the media list for normal rendering without transitions. Replaces the current media items and exits transition state.- Parameters:
m- The new list of media items to display
-
setTransitionState
public void setTransitionState(ArrayList<MediaItem> currentMedia, ArrayList<MediaItem> nextMedia, float progress) Sets up transition state between two sets of media items. Stores both current and next scene media for cross-fade transition.- Parameters:
currentMedia- Media items from the current scenenextMedia- Media items from the next sceneprogress- Transition progress (0.0 to 1.0)- See Also:
-
assignToDisplay
Assigns this screen to a physical display with specified bounds. Configures screen dimensions and position based on display geometry, recreates offscreen buffers, and updates all assigned media items.- Parameters:
bounds- The display bounds to assign this screen to- See Also:
-
render
public void render(int mousex, int mousey) Renders the screen content and displays it at the correct position. Updates the offscreen buffer with current media and shows the result.- Parameters:
mousex- The current x-coordinate of the mousemousey- The current y-coordinate of the mouse- See Also:
-
show
public void show()Displays the screen buffer at its assigned position. Only renders if the screen is assigned to a physical display. -
setPreviewArea
public void setPreviewArea(float px, float py, float pw, float ph) Sets the preview area dimensions for media item preview rendering. Propagates the preview area configuration to all assigned media items.- Parameters:
px- Preview area x-coordinatepy- Preview area y-coordinatepw- Preview area widthph- Preview area height- See Also:
-
moveHoverPoint
public void moveHoverPoint(float mousex, float mousey) Updates hover point position for all media items on this screen. Used for interactive media elements that respond to mouse movement.- Parameters:
mousex- The current x-coordinate of the mousemousey- The current y-coordinate of the mouse- See Also:
-
getScreen
public processing.opengl.PGraphics2D getScreen()Returns the offscreen graphics buffer for this screen.- Returns:
- PGraphics2D buffer containing the rendered screen content
-