package com.pyrohail.averageframe;

import org.opencv.core.Mat;
import org.opencv.videoio.VideoCapture;

public final class VideoReader {
	private final VideoCapture videoCapture;

	public VideoReader() {
		videoCapture = new VideoCapture();
	}

	public VideoReader(String fileName) {
		videoCapture = new VideoCapture();
		open(fileName);
	}

	public void open(String fileName) {
		videoCapture.open(fileName);
		if (!videoCapture.isOpened()) {
			System.out.println("Failure - videoCapture did not open");
			throw new RuntimeException();
		}
	}

	public Mat getFrame() {
		Mat frame = new Mat();
		videoCapture.read(frame);
		return frame;
	}

	public VideoCapture getVideoCapture() {
		return videoCapture;
	}
}

@@ -98,16 +98,91 @@
 pture;%0A%0A
+%0A/**%0A * Handles the input of video files%0A *%0A * @author Justin Harrison%0A */%0A
 public f
@@ -249,16 +249,54 @@
 pture;%0A%0A
+%09/**%0A%09 * VideoReader constructor%0A%09 */%0A
 %09public 
@@ -348,24 +348,115 @@
 ture();%0A%09%7D%0A%0A
+%09/**%0A%09 * VideoReader constructor%0A%09 *%0A%09 * @param fileName the location of a video file%0A%09 */%0A
 %09public Vide
@@ -537,24 +537,119 @@
 eName);%0A%09%7D%0A%0A
+%09/**%0A%09 * VideoCapture.open() wrapper%0A%09 *%0A%09 * @param fileName the location of a video file%0A%09 */%0A
 %09public void
@@ -837,24 +837,197 @@
 ();%0A%09%09%7D%0A%09%7D%0A%0A
+%09/**%0A%09 * VideoCapture.read() wrapper.%0A%09 * Each access automatically increases the current frame position.%0A%09 *%0A%09 * @return the current frame in the form of a Mat object%0A%09 */%0A
 %09public Mat 
@@ -1112,16 +1112,79 @@
 me;%0A%09%7D%0A%0A
+%09/**%0A%09 * videoCapture getter%0A%09 *%0A%09 * @return videoCapture%0A%09 */%0A
 %09public 

Add documentation to VideoReader.java