Package org.openpnp.capture.library
Interface OpenpnpCaptureLibrary
- All Superinterfaces:
com.sun.jna.Library
public interface OpenpnpCaptureLibrary
extends com.sun.jna.Library
JNA Wrapper for library openpnp-capture
This file was autogenerated by JNAerator,
a tool written by Olivier Chafik that uses a few opensource projects..
For help, please visit NativeLibs4Java , Rococoa, or JNA.
This file was autogenerated by JNAerator,
a tool written by Olivier Chafik that uses a few opensource projects..
For help, please visit NativeLibs4Java , Rococoa, or JNA.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfacenative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.hNested classes/interfaces inherited from interface com.sun.jna.Library
com.sun.jna.Library.Handler -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intnative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.hstatic final intnative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.hstatic final intnative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.hstatic final intnative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.hstatic final intnative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.hstatic final intnative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.hstatic final intnative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.hstatic final intnative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.hstatic final intnative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.hstatic final intnative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.hstatic final intnative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.hstatic final intnative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.hstatic final intnative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.hstatic final intnative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.hstatic final intnative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.hstatic final intnative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.hstatic final intnative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.hstatic final intnative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.hstatic final intnative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.hstatic final OpenpnpCaptureLibrarystatic final StringFields inherited from interface com.sun.jna.Library
OPTION_ALLOW_OBJECTS, OPTION_CALLING_CONVENTION, OPTION_CLASSLOADER, OPTION_FUNCTION_MAPPER, OPTION_INVOCATION_MAPPER, OPTION_OPEN_FLAGS, OPTION_STRING_ENCODING, OPTION_STRUCTURE_ALIGNMENT, OPTION_SYMBOL_PROVIDER, OPTION_TYPE_MAPPER -
Method Summary
Modifier and TypeMethodDescriptionintCap_captureFrame(com.sun.jna.Pointer ctx, int stream, com.sun.jna.Pointer RGBbufferPtr, int RGBbufferBytes) this function copies the most recent RGB frame data
to the given buffer.
Original signature :CapResult Cap_captureFrame(CapContext, CapStream, void*, uint32_t)
native declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h:186intCap_closeStream(com.sun.jna.Pointer ctx, int stream) Close a capture streamcom.sun.jna.PointerInitialize the capture libraryintCap_getAutoProperty(com.sun.jna.Pointer ctx, int stream, int propID, com.sun.jna.ptr.IntByReference outValue) Deprecated.intCap_getAutoProperty(com.sun.jna.Pointer ctx, int stream, int propID, IntBuffer outValue) get the automatic flag of a camera/stream property (e.g.intCap_getDeviceCount(com.sun.jna.Pointer ctx) Get the number of capture devices on the system.
note: this can change dynamically due to the
pluggin and unplugging of USB devices.com.sun.jna.PointerCap_getDeviceName(com.sun.jna.Pointer ctx, int index) Get the name of a capture device.
This name is meant to be displayed in GUI applications,
i.e.com.sun.jna.PointerCap_getDeviceUniqueID(com.sun.jna.Pointer ctx, int index) Get the unique name of a capture device.
The string contains a unique concatenation
of the device name and other parameters.
These parameters are platform dependent.
Note: when a USB camera does not expose a serial number,
platforms might have trouble uniquely identifying
a camera.intCap_getFormatInfo(com.sun.jna.Pointer ctx, int index, int id, CapFormatInfo info) Get the format information from a device.com.sun.jna.PointerReturn the version of the library as a string.
In addition to a version number, this should
contain information on the platform,
e.g.intCap_getNumFormats(com.sun.jna.Pointer ctx, int index) Returns the number of formats supported by a certain device.
returns -1 if device does not exist.intCap_getProperty(com.sun.jna.Pointer ctx, int stream, int propID, com.sun.jna.ptr.IntByReference outValue) Deprecated.intCap_getProperty(com.sun.jna.Pointer ctx, int stream, int propID, IntBuffer outValue) get the value of a camera/stream property (e.g.intCap_getPropertyLimits(com.sun.jna.Pointer ctx, int stream, int propID, com.sun.jna.ptr.IntByReference min, com.sun.jna.ptr.IntByReference max, com.sun.jna.ptr.IntByReference dValue) Deprecated.intCap_getPropertyLimits(com.sun.jna.Pointer ctx, int stream, int propID, IntBuffer min, IntBuffer max, IntBuffer dValue) get the min/max limits and default value of a camera/stream property (e.g.intCap_getStreamFrameCount(com.sun.jna.Pointer ctx, int stream) returns the number of frames captured during the lifetime of the stream.intCap_hasNewFrame(com.sun.jna.Pointer ctx, int stream) returns 1 if a new frame has been captured, 0 otherwise
Original signature :uint32_t Cap_hasNewFrame(CapContext, CapStream)
native declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h:189voidinstall a custom callback for a logging function.
the callback function must have the following
structure:
void func(uint32_t level, const char *string);
Original signature :void Cap_installCustomLogFunction(CapCustomLogFunc)
native declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h:273intCap_isOpenStream(com.sun.jna.Pointer ctx, int stream) Check if a stream is open, i.e.intCap_openStream(com.sun.jna.Pointer ctx, int index, int formatID) Open a capture stream to a device with specific format requirements
Although the (internal) frame buffer format is set via the fourCC ID,
the frames returned by Cap_captureFrame are always 24-bit RGB.intCap_releaseContext(com.sun.jna.Pointer ctx) Un-initialize the capture library contextintCap_setAutoProperty(com.sun.jna.Pointer ctx, int stream, int propID, int bOnOff) set the automatic flag of a camera/stream property (e.g.voidCap_setLogLevel(int level) Set the logging level.
LOG LEVEL ID | LEVEL
------------- | -------------
LOG_EMERG | 0
LOG_ALERT | 1
LOG_CRIT | 2
LOG_ERR | 3
LOG_WARNING | 4
LOG_NOTICE | 5
LOG_INFO | 6
LOG_DEBUG | 7
LOG_VERBOSE | 8
Original signature :void Cap_setLogLevel(uint32_t)
native declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h:261intCap_setProperty(com.sun.jna.Pointer ctx, int stream, int propID, int value) set the value of a camera/stream property (e.g.
-
Field Details
-
JNA_LIBRARY_NAME
- See Also:
-
INSTANCE
-
CAPPROPID_EXPOSURE
static final int CAPPROPID_EXPOSUREnative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h- See Also:
-
CAPPROPID_FOCUS
static final int CAPPROPID_FOCUSnative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h- See Also:
-
CAPPROPID_ZOOM
static final int CAPPROPID_ZOOMnative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h- See Also:
-
CAPPROPID_WHITEBALANCE
static final int CAPPROPID_WHITEBALANCEnative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h- See Also:
-
CAPPROPID_GAIN
static final int CAPPROPID_GAINnative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h- See Also:
-
CAPPROPID_BRIGHTNESS
static final int CAPPROPID_BRIGHTNESSnative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h- See Also:
-
CAPPROPID_CONTRAST
static final int CAPPROPID_CONTRASTnative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h- See Also:
-
CAPPROPID_SATURATION
static final int CAPPROPID_SATURATIONnative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h- See Also:
-
CAPPROPID_GAMMA
static final int CAPPROPID_GAMMAnative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h- See Also:
-
CAPPROPID_HUE
static final int CAPPROPID_HUEnative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h- See Also:
-
CAPPROPID_SHARPNESS
static final int CAPPROPID_SHARPNESSnative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h- See Also:
-
CAPPROPID_BACKLIGHTCOMP
static final int CAPPROPID_BACKLIGHTCOMPnative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h- See Also:
-
CAPPROPID_POWERLINEFREQ
static final int CAPPROPID_POWERLINEFREQnative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h- See Also:
-
CAPPROPID_LAST
static final int CAPPROPID_LASTnative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h- See Also:
-
CAPRESULT_OK
static final int CAPRESULT_OKnative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h- See Also:
-
CAPRESULT_ERR
static final int CAPRESULT_ERRnative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h- See Also:
-
CAPRESULT_DEVICENOTFOUND
static final int CAPRESULT_DEVICENOTFOUNDnative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h- See Also:
-
CAPRESULT_FORMATNOTSUPPORTED
static final int CAPRESULT_FORMATNOTSUPPORTEDnative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h- See Also:
-
CAPRESULT_PROPERTYNOTSUPPORTED
static final int CAPRESULT_PROPERTYNOTSUPPORTEDnative declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h- See Also:
-
-
Method Details
-
Cap_createContext
com.sun.jna.Pointer Cap_createContext()Initialize the capture library- Returns:
- The context ID.
Original signature :CapContext Cap_createContext()
native declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h:79
-
Cap_releaseContext
int Cap_releaseContext(com.sun.jna.Pointer ctx) Un-initialize the capture library context- Parameters:
ctx- The ID of the context to destroy.- Returns:
- The context ID.
Original signature :CapResult Cap_releaseContext(CapContext)
native declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h:85
-
Cap_getDeviceCount
int Cap_getDeviceCount(com.sun.jna.Pointer ctx) Get the number of capture devices on the system.
note: this can change dynamically due to the
pluggin and unplugging of USB devices.- Parameters:
ctx- The ID of the context.- Returns:
- The number of capture devices found.
Original signature :uint32_t Cap_getDeviceCount(CapContext)
native declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h:93
-
Cap_getDeviceName
com.sun.jna.Pointer Cap_getDeviceName(com.sun.jna.Pointer ctx, int index) Get the name of a capture device.
This name is meant to be displayed in GUI applications,
i.e. its human readable.
if a device with the given index does not exist,
NULL is returned.- Parameters:
ctx- The ID of the context.index- The device index of the capture device.- Returns:
- a pointer to an UTF-8 string containting the name of the capture device.
Original signature :char* Cap_getDeviceName(CapContext, CapDeviceID)
native declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h:105
-
Cap_getDeviceUniqueID
com.sun.jna.Pointer Cap_getDeviceUniqueID(com.sun.jna.Pointer ctx, int index) Get the unique name of a capture device.
The string contains a unique concatenation
of the device name and other parameters.
These parameters are platform dependent.
Note: when a USB camera does not expose a serial number,
platforms might have trouble uniquely identifying
a camera. In such cases, the USB port location can
be used to add a unique feature to the string.
This, however, has the down side that the ID of
the camera changes when the USB port location
changes. Unfortunately, there isn't much to
do about this.
if a device with the given index does not exist,
NULL is returned.- Parameters:
ctx- The ID of the context.index- The device index of the capture device.- Returns:
- a pointer to an UTF-8 string containting the unique ID of the capture device.
Original signature :char* Cap_getDeviceUniqueID(CapContext, CapDeviceID)
native declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h:127
-
Cap_getNumFormats
int Cap_getNumFormats(com.sun.jna.Pointer ctx, int index) Returns the number of formats supported by a certain device.
returns -1 if device does not exist.- Parameters:
ctx- The ID of the context.index- The device index of the capture device.- Returns:
- The number of formats supported or -1 if the device does not exist.
Original signature :int32_t Cap_getNumFormats(CapContext, CapDeviceID)
native declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h:137
-
Cap_getFormatInfo
Get the format information from a device.- Parameters:
ctx- The ID of the context.index- The device index of the capture device.id- The index/ID of the frame buffer format (0 .. number returned by Cap_getNumFormats() minus 1 ).info- pointer to a CapFormatInfo structure to be filled with data.- Returns:
- The CapResult.
Original signature :CapResult Cap_getFormatInfo(CapContext, CapDeviceID, CapFormatID, CapFormatInfo*)
native declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h:146
-
Cap_openStream
int Cap_openStream(com.sun.jna.Pointer ctx, int index, int formatID) Open a capture stream to a device with specific format requirements
Although the (internal) frame buffer format is set via the fourCC ID,
the frames returned by Cap_captureFrame are always 24-bit RGB.- Parameters:
ctx- The ID of the context.index- The device index of the capture device.formatID- The index/ID of the frame buffer format (0 .. number returned by Cap_getNumFormats() minus 1 ).- Returns:
- The stream ID or -1 if the device does not exist or the stream format ID is incorrect.
Original signature :CapStream Cap_openStream(CapContext, CapDeviceID, CapFormatID)
native declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h:163
-
Cap_closeStream
int Cap_closeStream(com.sun.jna.Pointer ctx, int stream) Close a capture stream- Parameters:
ctx- The ID of the context.stream- The stream ID.- Returns:
- CapResult
Original signature :CapResult Cap_closeStream(CapContext, CapStream)
native declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h:170
-
Cap_isOpenStream
int Cap_isOpenStream(com.sun.jna.Pointer ctx, int stream) Check if a stream is open, i.e. is capturing data.- Parameters:
ctx- The ID of the context.stream- The stream ID.- Returns:
- 1 if the stream is open and capturing, else 0.
Original signature :uint32_t Cap_isOpenStream(CapContext, CapStream)
native declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h:177
-
Cap_captureFrame
int Cap_captureFrame(com.sun.jna.Pointer ctx, int stream, com.sun.jna.Pointer RGBbufferPtr, int RGBbufferBytes) this function copies the most recent RGB frame data
to the given buffer.
Original signature :CapResult Cap_captureFrame(CapContext, CapStream, void*, uint32_t)
native declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h:186 -
Cap_hasNewFrame
int Cap_hasNewFrame(com.sun.jna.Pointer ctx, int stream) returns 1 if a new frame has been captured, 0 otherwise
Original signature :uint32_t Cap_hasNewFrame(CapContext, CapStream)
native declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h:189 -
Cap_getStreamFrameCount
int Cap_getStreamFrameCount(com.sun.jna.Pointer ctx, int stream) returns the number of frames captured during the lifetime of the stream.
For debugging purposes
Original signature :uint32_t Cap_getStreamFrameCount(CapContext, CapStream)
native declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h:193 -
Cap_getPropertyLimits
@Deprecated int Cap_getPropertyLimits(com.sun.jna.Pointer ctx, int stream, int propID, com.sun.jna.ptr.IntByReference min, com.sun.jna.ptr.IntByReference max, com.sun.jna.ptr.IntByReference dValue) Deprecated.get the min/max limits and default value of a camera/stream property (e.g. zoom, exposure etc)
returns: CAPRESULT_OK if all is well.
CAPRESULT_PROPERTYNOTSUPPORTED if property not available.
CAPRESULT_ERR if context, stream are invalid.
Original signature :CapResult Cap_getPropertyLimits(CapContext, CapStream, CapPropertyID, int32_t*, int32_t*, int*)
native declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h:206 -
Cap_getPropertyLimits
int Cap_getPropertyLimits(com.sun.jna.Pointer ctx, int stream, int propID, IntBuffer min, IntBuffer max, IntBuffer dValue) get the min/max limits and default value of a camera/stream property (e.g. zoom, exposure etc)
returns: CAPRESULT_OK if all is well.
CAPRESULT_PROPERTYNOTSUPPORTED if property not available.
CAPRESULT_ERR if context, stream are invalid.
Original signature :CapResult Cap_getPropertyLimits(CapContext, CapStream, CapPropertyID, int32_t*, int32_t*, int*)
native declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h:206 -
Cap_setProperty
int Cap_setProperty(com.sun.jna.Pointer ctx, int stream, int propID, int value) set the value of a camera/stream property (e.g. zoom, exposure etc)
returns: CAPRESULT_OK if all is well.
CAPRESULT_PROPERTYNOTSUPPORTED if property not available.
CAPRESULT_ERR if context, stream are invalid.
Original signature :CapResult Cap_setProperty(CapContext, CapStream, CapPropertyID, int32_t)
native declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h:215 -
Cap_setAutoProperty
int Cap_setAutoProperty(com.sun.jna.Pointer ctx, int stream, int propID, int bOnOff) set the automatic flag of a camera/stream property (e.g. zoom, focus etc)
returns: CAPRESULT_OK if all is well.
CAPRESULT_PROPERTYNOTSUPPORTED if property not available.
CAPRESULT_ERR if context, stream are invalid.
Original signature :CapResult Cap_setAutoProperty(CapContext, CapStream, CapPropertyID, uint32_t)
native declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h:223 -
Cap_getProperty
@Deprecated int Cap_getProperty(com.sun.jna.Pointer ctx, int stream, int propID, com.sun.jna.ptr.IntByReference outValue) Deprecated.get the value of a camera/stream property (e.g. zoom, exposure etc)
returns: CAPRESULT_OK if all is well.
CAPRESULT_PROPERTYNOTSUPPORTED if property not available.
CAPRESULT_ERR if context, stream are invalid or outValue == NULL.
Original signature :CapResult Cap_getProperty(CapContext, CapStream, CapPropertyID, int32_t*)
native declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h:231 -
Cap_getProperty
get the value of a camera/stream property (e.g. zoom, exposure etc)
returns: CAPRESULT_OK if all is well.
CAPRESULT_PROPERTYNOTSUPPORTED if property not available.
CAPRESULT_ERR if context, stream are invalid or outValue == NULL.
Original signature :CapResult Cap_getProperty(CapContext, CapStream, CapPropertyID, int32_t*)
native declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h:231 -
Cap_getAutoProperty
@Deprecated int Cap_getAutoProperty(com.sun.jna.Pointer ctx, int stream, int propID, com.sun.jna.ptr.IntByReference outValue) Deprecated.get the automatic flag of a camera/stream property (e.g. zoom, focus etc)
returns: CAPRESULT_OK if all is well.
CAPRESULT_PROPERTYNOTSUPPORTED if property not available.
CAPRESULT_ERR if context, stream are invalid.
Original signature :CapResult Cap_getAutoProperty(CapContext, CapStream, CapPropertyID, uint32_t*)
native declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h:239 -
Cap_getAutoProperty
get the automatic flag of a camera/stream property (e.g. zoom, focus etc)
returns: CAPRESULT_OK if all is well.
CAPRESULT_PROPERTYNOTSUPPORTED if property not available.
CAPRESULT_ERR if context, stream are invalid.
Original signature :CapResult Cap_getAutoProperty(CapContext, CapStream, CapPropertyID, uint32_t*)
native declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h:239 -
Cap_setLogLevel
void Cap_setLogLevel(int level) Set the logging level.
LOG LEVEL ID | LEVEL
------------- | -------------
LOG_EMERG | 0
LOG_ALERT | 1
LOG_CRIT | 2
LOG_ERR | 3
LOG_WARNING | 4
LOG_NOTICE | 5
LOG_INFO | 6
LOG_DEBUG | 7
LOG_VERBOSE | 8
Original signature :void Cap_setLogLevel(uint32_t)
native declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h:261 -
Cap_installCustomLogFunction
install a custom callback for a logging function.
the callback function must have the following
structure:
void func(uint32_t level, const char *string);
Original signature :void Cap_installCustomLogFunction(CapCustomLogFunc)
native declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h:273 -
Cap_getLibraryVersion
com.sun.jna.Pointer Cap_getLibraryVersion()Return the version of the library as a string.
In addition to a version number, this should
contain information on the platform,
e.g. Win32/Win64/Linux32/Linux64/OSX etc,
wether or not it is a release or debug
build and the build date.
When building the library, please set the
following defines in the build environment:
__LIBVER__
__PLATFORM__
__BUILDTYPE__
Original signature :char* Cap_getLibraryVersion()
native declaration : /Users/romanvg/dev/openpnp-capture/include/openpnp-capture.h:291
-
Cap_getAutoProperty(com.sun.jna.Pointer, int, int, java.nio.IntBuffer)andCap_getAutoProperty(com.sun.jna.Pointer, int, int, com.sun.jna.ptr.IntByReference)instead