Skip to content

Commit 42ff0f8

Browse files
committed
add copy() and get(x, y, w, h) signatures to Movie and Capture classes
1 parent 2499235 commit 42ff0f8

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

src/processing/video/Capture.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,23 @@ public int get(int x, int y) {
350350
}
351351

352352

353+
/**
354+
* @param w width of pixel rectangle to get
355+
* @param h height of pixel rectangle to get
356+
*/
357+
public PImage get(int x, int y, int w, int h) {
358+
if (outdatedPixels) loadPixels();
359+
return super.get(x, y, w, h);
360+
}
361+
362+
363+
@Override
364+
public PImage copy() {
365+
if (outdatedPixels) loadPixels();
366+
return super.copy();
367+
}
368+
369+
353370
protected void getImpl(int sourceX, int sourceY,
354371
int sourceWidth, int sourceHeight,
355372
PImage target, int targetX, int targetY) {

src/processing/video/Movie.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,23 @@ public int get(int x, int y) {
449449
}
450450

451451

452+
/**
453+
* @param w width of pixel rectangle to get
454+
* @param h height of pixel rectangle to get
455+
*/
456+
public PImage get(int x, int y, int w, int h) {
457+
if (outdatedPixels) loadPixels();
458+
return super.get(x, y, w, h);
459+
}
460+
461+
462+
@Override
463+
public PImage copy() {
464+
if (outdatedPixels) loadPixels();
465+
return super.copy();
466+
}
467+
468+
452469
@Override
453470
protected void getImpl(int sourceX, int sourceY,
454471
int sourceWidth, int sourceHeight,

0 commit comments

Comments
 (0)