Skip to content

Commit 0107f78

Browse files
committed
Updated video examples to reflect new library and class names
1 parent a4821f5 commit 0107f78

23 files changed

Lines changed: 210 additions & 214 deletions

File tree

java/libraries/video/examples/Capture/AsciiVideo/AsciiVideo.pde

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@
99
* See the keyPressed function for more options, like changing the font size.
1010
*/
1111

12-
import processing.opengl.*;
13-
import codeanticode.gsvideo.*;
12+
import processing.video.*;
1413

15-
GSCapture video;
14+
Capture video;
1615
boolean cheatScreen;
1716

1817
// All ASCII characters, sorted according to their visual density
@@ -34,7 +33,7 @@ public void setup() {
3433
//size(screen.width, screen.height, OPENGL);
3534

3635
// Uses the default video input, see the reference if this causes an error
37-
video = new GSCapture(this, 160, 120);
36+
video = new Capture(this, 160, 120);
3837
video.start();
3938
int count = video.width * video.height;
4039
println(count);
@@ -61,7 +60,7 @@ public void setup() {
6160
}
6261

6362

64-
public void captureEvent(GSCapture c) {
63+
public void captureEvent(Capture c) {
6564
c.read();
6665
}
6766

java/libraries/video/examples/Capture/BackgroundSubtraction/BackgroundSubtraction.pde

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@
99
*/
1010

1111

12-
import codeanticode.gsvideo.*;
12+
import processing.video.*;
1313

1414
int numPixels;
1515
int[] backgroundPixels;
16-
GSCapture video;
16+
Capture video;
1717

1818
void setup() {
1919
// Change size to 320 x 240 if too slow at 640 x 480
2020
size(640, 480);
2121

22-
video = new GSCapture(this, width, height);
22+
video = new Capture(this, width, height);
2323
video.start();
2424
numPixels = video.width * video.height;
2525
// Create array to store the background image

java/libraries/video/examples/Capture/BrightnessThresholding/BrightnessThresholding.pde

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@
99
*/
1010

1111

12-
import codeanticode.gsvideo.*;
12+
import processing.video.*;
1313

1414
color black = color(0);
1515
color white = color(255);
1616
int numPixels;
17-
GSCapture video;
17+
Capture video;
1818

1919
void setup() {
2020
size(640, 480); // Change size to 320 x 240 if too slow at 640 x 480
2121
strokeWeight(5);
2222
// Uses the default video input, see the reference if this causes an error
23-
video = new GSCapture(this, width, height);
23+
video = new Capture(this, width, height);
2424
video.start();
2525
numPixels = video.width * video.height;
2626
noCursor();

java/libraries/video/examples/Capture/BrightnessTracking/BrightnessTracking.pde

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
*/
99

1010

11-
import codeanticode.gsvideo.*;
11+
import processing.video.*;
1212

13-
GSCapture video;
13+
Capture video;
1414

1515
void setup() {
1616
size(640, 480); // Change size to 320 x 240 if too slow at 640 x 480
1717
// Uses the default video input, see the reference if this causes an error
18-
video = new GSCapture(this, width, height);
18+
video = new Capture(this, width, height);
1919
video.start();
2020
noStroke();
2121
smooth();

java/libraries/video/examples/Capture/ColorSorting/ColorSorting.pde

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
*/
1010

1111

12-
import codeanticode.gsvideo.*;
12+
import processing.video.*;
1313

14-
GSCapture video;
14+
Capture video;
1515
boolean cheatScreen;
1616

1717
Tuple[] captureColors;
@@ -27,7 +27,7 @@ public void setup() {
2727

2828
noCursor();
2929
// Uses the default video input, see the reference if this causes an error
30-
video = new GSCapture(this, 160, 120);
30+
video = new Capture(this, 160, 120);
3131
video.start();
3232

3333
int count = (video.width * video.height) / (increment * increment);

java/libraries/video/examples/Capture/Disgrand/Disgrand.pde

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@
88
* and arranges them into vertical bars.
99
*/
1010

11-
12-
import codeanticode.gsvideo.*;
11+
import processing.video.*;
1312

14-
GSCapture video;
13+
Capture video;
1514
boolean cheatScreen;
1615

1716
Tuple[] captureColors;
@@ -27,7 +26,7 @@ public void setup() {
2726

2827
noCursor();
2928
// Uses the default video input, see the reference if this causes an error
30-
video = new GSCapture(this, 160, 120);
29+
video = new Capture(this, 160, 120);
3130
video.start();
3231

3332
int count = (video.width * video.height) / (increment * increment);

java/libraries/video/examples/Capture/FrameDifferencing/FrameDifferencing.pde

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
88
*/
99

1010

11-
import codeanticode.gsvideo.*;
11+
import processing.video.*;
1212

1313
int numPixels;
1414
int[] previousFrame;
15-
GSCapture video;
15+
Capture video;
1616

1717
void setup() {
1818
size(640, 480); // Change size to 320 x 240 if too slow at 640 x 480
1919
// Uses the default video input, see the reference if this causes an error
20-
video = new GSCapture(this, width, height);
20+
video = new Capture(this, width, height);
2121
video.start();
2222
numPixels = video.width * video.height;
2323
// Create an array to store the previously captured frame

java/libraries/video/examples/Capture/Framingham/Framingham.pde

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
*/
99

1010

11-
import codeanticode.gsvideo.*;
11+
import processing.video.*;
1212

13-
GSCapture video;
13+
Capture video;
1414
int column;
1515
int columnCount;
1616
int lastRow;
@@ -23,7 +23,7 @@ void setup() {
2323
size(640, 480, P3D);
2424

2525
// Uses the default video input, see the reference if this causes an error
26-
video = new GSCapture(this, 160, 120);
26+
video = new Capture(this, 160, 120);
2727
video.start();
2828
// Also try with other video sizes
2929

java/libraries/video/examples/Capture/GettingStartedCaptureLinux/GettingStartedCaptureLinux.pde

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
*
66
* Reading and displaying an image from an attached Capture device.
77
*/
8-
import codeanticode.gsvideo.*;
8+
import processing.video.*;
99

10-
GSCapture cam;
10+
Capture cam;
1111

1212
void setup() {
1313
size(640, 480);
1414

1515
/*
1616
// List functionality still not ready on Linux
17-
String[] cameras = GSCapture.list();
17+
String[] cameras = Capture.list();
1818
1919
if (cameras.length == 0)
2020
{
@@ -24,16 +24,16 @@ void setup() {
2424
println("Available cameras:");
2525
for (int i = 0; i < cameras.length; i++)
2626
println(cameras[i]);
27-
cam = new GSCapture(this, 640, 480, cameras[0]);
27+
cam = new Capture(this, 640, 480, cameras[0]);
2828
}
2929
3030
However, different cameras can be selected by using their device file:
31-
cam = new GSCapture(this, 640, 480, "/dev/video0");
32-
cam = new GSCapture(this, 640, 480, "/dev/video1");
31+
cam = new Capture(this, 640, 480, "/dev/video0");
32+
cam = new Capture(this, 640, 480, "/dev/video1");
3333
etc.
3434
*/
3535

36-
cam = new GSCapture(this, 640, 480);
36+
cam = new Capture(this, 640, 480);
3737
cam.start();
3838

3939
/*

java/libraries/video/examples/Capture/GettingStartedCaptureMac/GettingStartedCaptureMac.pde

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
*
66
* Reading and displaying an image from an attached Capture device.
77
*/
8-
import codeanticode.gsvideo.*;
8+
import processing.video.*;
99

10-
GSCapture cam;
10+
Capture cam;
1111

1212
void setup() {
1313
size(640, 480);
1414

1515
/*
1616
// List functionality hasn't been tested on Mac OSX. Uncomment this
1717
// code to try it out.
18-
String[] cameras = GSCapture.list();
18+
String[] cameras = Capture.list();
1919
2020
if (cameras.length == 0)
2121
{
@@ -25,10 +25,10 @@ void setup() {
2525
println("Available cameras:");
2626
for (int i = 0; i < cameras.length; i++)
2727
println(cameras[i]);
28-
cam = new GSCapture(this, 320, 240, cameras[0]);
28+
cam = new Capture(this, 320, 240, cameras[0]);
2929
}
3030
*/
31-
cam = new GSCapture(this, 640, 480);
31+
cam = new Capture(this, 640, 480);
3232
cam.start();
3333

3434
/*

0 commit comments

Comments
 (0)