public class VideoWall
extends java.lang.Object
import nl.sensorlab.videowall.*; VideoWall videoWall; // Ball members float x = 0; float speed = 2; float radius; void settings() { // Setting the canvas to the native image size to prevent scaling which // saves performance) size(VideoWall.STREAM_IMAGE_WIDTH, VideoWall.STREAM_IMAGE_HEIGHT); } void setup() { // Initialize the videoWall stream videoWall = new VideoWall("192.168.1.90", 10233, this); videoWall.start(); // Setup drawing variables radius = height / 2; ellipseMode(RADIUS); noStroke(); fill(255); } void draw() { // Update the ball's x position x += speed; if (x > (width + radius)) { x = -radius; } // Draw on the canvas as you normally would background(255, 0, 255); fill(255); ellipse(x, radius, radius, radius); // Stream the canvas to video wall videoWall.streamImage(get()); }
Modifier and Type | Field and Description |
---|---|
static int |
CROP
Resize the image by taking a rectangle of the native stream size from the
center of the image
|
static int |
STREAM_IMAGE_HEIGHT
Native height for the video stream image.
|
static int |
STREAM_IMAGE_WIDTH
Native width for the video stream image.
|
static int |
STRETCH
Resize the image by stretching the source image to the size of the native
stream image size
|
static java.lang.String |
VERSION |
Constructor and Description |
---|
VideoWall(java.lang.String host,
int port,
PApplet parent)
a Constructor, usually called in the setup() method in your sketch to
initialize and start the Library.
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Close the socket
|
int |
scaleMode()
Get the scale mode for scaling the supplied images to the correct stream image size.
|
void |
setScaleMode(int scaleMode)
Set the scale mode for scaling supplied images to the correct stream image size.
|
void |
start()
Open the socket
|
void |
streamImage(PImage image)
Stream image to the video wall
|
static java.lang.String |
version()
return the version of the Library.
|
public static final java.lang.String VERSION
public static final int CROP
public static final int STRETCH
public static final int STREAM_IMAGE_WIDTH
public static final int STREAM_IMAGE_HEIGHT
public VideoWall(java.lang.String host, int port, PApplet parent)
host
- the network host (hostname or IP) to send the UDP packets toport
- the network port to send the UDP packets toparent
- the parent sketchimport nl.sensorlab.videowall.*; VideoWall videoWall; // Ball members float x = 0; float speed = 2; float radius; void settings() { // Setting the canvas to the native image size to prevent scaling which // saves performance) size(VideoWall.STREAM_IMAGE_WIDTH, VideoWall.STREAM_IMAGE_HEIGHT); } void setup() { // Initialize the videoWall stream videoWall = new VideoWall("192.168.1.90", 10233, this); videoWall.start(); // Setup drawing variables radius = height / 2; ellipseMode(RADIUS); noStroke(); fill(255); } void draw() { // Update the ball's x position x += speed; if (x > (width + radius)) { x = -radius; } // Draw on the canvas as you normally would background(255, 0, 255); fill(255); ellipse(x, radius, radius, radius); // Stream the canvas to video wall videoWall.streamImage(get()); }
public void setScaleMode(int scaleMode)
scaleMode
- either VideoWall.NOSCALE, VideoWall.CROP or VideoWall.STRETCHpublic int scaleMode()
public static java.lang.String version()
public void streamImage(PImage image)
image
- public void start()
public void dispose()
Processing Library SensorLabVideoWall by Wilco Tomassen & Agathe Lenclen. (c) 2016