org.openpnp.capture.CaptureDevice Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of openpnp-capture-java Show documentation
Show all versions of openpnp-capture-java Show documentation
OpenPnP Capture Java with all binaries included, packaged for Maven.
package org.openpnp.capture;
import java.util.ArrayList;
import java.util.List;
import org.openpnp.capture.library.CapFormatInfo;
import org.openpnp.capture.library.OpenpnpCaptureLibrary;
import com.sun.jna.Pointer;
public class CaptureDevice {
Pointer context;
int index;
String name;
List formats = new ArrayList<>();
public CaptureDevice(Pointer context, int index) {
this.context = context;
this.index = index;
this.name = OpenpnpCaptureLibrary.INSTANCE.Cap_getDeviceName(context, index).getString(0, "UTF8");
int formatCount = OpenpnpCaptureLibrary.INSTANCE.Cap_getNumFormats(context, index);
for (int formatIndex = 0; formatIndex < formatCount; formatIndex++) {
CapFormatInfo formatInfo = new CapFormatInfo();
OpenpnpCaptureLibrary.INSTANCE.Cap_getFormatInfo(context, index, formatIndex, formatInfo);
formats.add(formatInfo);
}
}
@Override
public String toString() {
return name;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy