Skip to content

Commit 6c22e46

Browse files
committed
Add hasNewFrame method to check for new captured frames
1 parent dc00c9a commit 6c22e46

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/main/java/io/github/doblon8/openpnp/capture/CaptureStream.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,16 @@ public BufferedImage capture() {
5454
return image;
5555
}
5656

57+
/**
58+
* Check if a new frame has been captured.
59+
*
60+
* @return true if a new frame has been captured, false otherwise.
61+
*/
62+
public boolean hasNewFrame() {
63+
int result = Cap_hasNewFrame(context.getSegment(), id);
64+
return result == 1;
65+
}
66+
5767
/**
5868
* Check if a stream is open, i.e. is capturing data.
5969
*

0 commit comments

Comments
 (0)