Skip to content

Commit

Permalink
* Upgrade presets for FlyCapture 2.6.3.4 (pull #6, issue #8)
Browse files Browse the repository at this point in the history
  • Loading branch information
saudet committed Jul 21, 2014
1 parent e4e17a3 commit dfcbedd
Show file tree
Hide file tree
Showing 9 changed files with 98 additions and 74 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

* Upgrade presets for FFmpeg 2.3
* Upgrade presets for FFmpeg 2.3, FlyCapture 2.6.3.4 ([pull #6](https://github.com/bytedeco/javacpp-presets/pull/6), [issue #8](https://github.com/bytedeco/javacpp-presets/issues/8))
* Make the `cppbuild.sh` scripts install native libraries inside the `cppbuild` subdirectories, instead of on the system
* Include new `platform.dependency` and `platform.dependencies` properties to let users depend easily on the artifacts that contain native libraries
* Add presets for FFTW 3.3.4, GSL 1.16, LLVM 3.4.2, Leptonica 1.71, Tesseract 3.03-rc1
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Each child module in turn relies on its corresponding native libraries being alr

* OpenCV 2.4.9 http://opencv.org/downloads.html
* FFmpeg 2.3.x http://ffmpeg.org/download.html
* FlyCapture 1.7 or newer (Windows only) http://ww2.ptgrey.com/sdk/flycap
* FlyCapture 2.6.x http://ww2.ptgrey.com/sdk/flycap
* libdc1394 2.1.x or 2.2.x http://sourceforge.net/projects/libdc1394/files/
* OpenKinect libfreenect 0.4 https://github.com/OpenKinect/libfreenect
* videoInput 0.200 https://github.com/ofTheo/videoInput/tree/update2013
Expand Down
7 changes: 6 additions & 1 deletion flycapture/cppbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@ if [[ -z "$PLATFORM" ]]; then
fi

case $PLATFORM in
linux-*)
if [[ ! -d "/usr/include/flycapture/" ]]; then
echo "Please install FlyCapture under the default installation directory"
fi
;;
windows-*)
if [[ ! -d "/C/Program Files/Point Grey Research/" ]]; then
echo "Please install PGR FlyCapture under the default installation directory"
echo "Please install FlyCapture under the default installation directory"
fi
;;
*)
Expand Down
21 changes: 1 addition & 20 deletions flycapture/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,7 @@
<artifactId>flycapture</artifactId>
<version>2.6.3.4-${project.parent.version}</version>
<packaging>jar</packaging>
<name>JavaCPP Presets for Point Grey's FlyCapture</name>

<properties>
<!-- Skip on non-Windows system (see profile below) -->
<generate-sources.skip>true</generate-sources.skip>
<process-classes.skip>true</process-classes.skip>
</properties>
<name>JavaCPP Presets for FlyCapture</name>

<dependencies>
<dependency>
Expand Down Expand Up @@ -73,17 +67,4 @@
</plugins>
</build>

<profiles>
<profile>
<id>windows</id>
<activation>
<os><family>windows</family></os>
</activation>
<properties>
<generate-sources.skip>false</generate-sources.skip>
<process-classes.skip>false</process-classes.skip>
</properties>
</profile>
</profiles>

</project>
10 changes: 5 additions & 5 deletions flycapture/src/main/java/org/bytedeco/javacpp/FlyCapture2.java
Original file line number Diff line number Diff line change
Expand Up @@ -2200,7 +2200,7 @@ public static class BusEventCallback extends FunctionPointer {
* Handle that is returned when registering a callback. It is required
* when unregistering the callback.
*/
@Opaque @Namespace("FlyCapture2") public static class CallbackHandle extends Pointer {
@Namespace("FlyCapture2") @Opaque public static class CallbackHandle extends Pointer {
public CallbackHandle() { }
public CallbackHandle(Pointer p) { super(p); }
}
Expand Down Expand Up @@ -3804,15 +3804,15 @@ public CameraBase() { }
public static native @ByVal Error StartSyncCapture(
@Cast("unsigned int") int numCameras,
@Cast("const FlyCapture2::Camera**") PointerPointer ppCameras,
@Const @Cast("FlyCapture2::ImageEventCallback*") @ByPtrPtr ImageEventCallback pCallbackFns/*=NULL*/,
@Cast("FlyCapture2::ImageEventCallback*") @ByPtrPtr ImageEventCallback pCallbackFns/*=NULL*/,
@Cast("const void**") PointerPointer pCallbackDataArray/*=NULL*/ );
public static native @ByVal Error StartSyncCapture(
@Cast("unsigned int") int numCameras,
@Const @ByPtrPtr Camera ppCameras );
public static native @ByVal Error StartSyncCapture(
@Cast("unsigned int") int numCameras,
@Const @ByPtrPtr Camera ppCameras,
@Const @Cast("FlyCapture2::ImageEventCallback*") @ByPtrPtr ImageEventCallback pCallbackFns/*=NULL*/,
@Cast("FlyCapture2::ImageEventCallback*") @ByPtrPtr ImageEventCallback pCallbackFns/*=NULL*/,
@Cast("const void**") @ByPtrPtr Pointer pCallbackDataArray/*=NULL*/ );
public native @ByVal Error RetrieveBuffer( Image pImage );
public native @ByVal Error StopCapture();
Expand Down Expand Up @@ -4394,15 +4394,15 @@ public CameraBase() { }
public static native @ByVal Error StartSyncCapture(
@Cast("unsigned int") int numCameras,
@Cast("const FlyCapture2::GigECamera**") PointerPointer ppCameras,
@Const @Cast("FlyCapture2::ImageEventCallback*") @ByPtrPtr ImageEventCallback pCallbackFns/*=NULL*/,
@Cast("FlyCapture2::ImageEventCallback*") @ByPtrPtr ImageEventCallback pCallbackFns/*=NULL*/,
@Cast("const void**") PointerPointer pCallbackDataArray/*=NULL*/ );
public static native @ByVal Error StartSyncCapture(
@Cast("unsigned int") int numCameras,
@Const @ByPtrPtr GigECamera ppCameras );
public static native @ByVal Error StartSyncCapture(
@Cast("unsigned int") int numCameras,
@Const @ByPtrPtr GigECamera ppCameras,
@Const @Cast("FlyCapture2::ImageEventCallback*") @ByPtrPtr ImageEventCallback pCallbackFns/*=NULL*/,
@Cast("FlyCapture2::ImageEventCallback*") @ByPtrPtr ImageEventCallback pCallbackFns/*=NULL*/,
@Cast("const void**") @ByPtrPtr Pointer pCallbackDataArray/*=NULL*/ );
public native @ByVal Error RetrieveBuffer( Image pImage );
public native @ByVal Error StopCapture();
Expand Down
48 changes: 44 additions & 4 deletions flycapture/src/main/java/org/bytedeco/javacpp/PGRFlyCapture.java
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ public static class FlyCaptureInfoEx extends Pointer {
// Camera max bus speed
public native @Cast("FlyCaptureBusSpeed") int CameraMaxBusSpeed(); public native FlyCaptureInfoEx CameraMaxBusSpeed(int CameraMaxBusSpeed);
// Flag indicating that the camera is already initialized

public native int iInitialized(); public native FlyCaptureInfoEx iInitialized(int iInitialized);

// Reserved for future data.
public native @Cast("unsigned long") int ulReserved(int i); public native FlyCaptureInfoEx ulReserved(int i, int ulReserved);
Expand All @@ -457,6 +457,25 @@ public static class FlyCaptureInfoEx extends Pointer {
// Description:
// This structure stores some extra driver info not stored on FlyCaptureInfoEx
//
public static class FlyCaptureDriverInfo extends Pointer {
static { Loader.load(); }
public FlyCaptureDriverInfo() { allocate(); }
public FlyCaptureDriverInfo(int size) { allocateArray(size); }
public FlyCaptureDriverInfo(Pointer p) { super(p); }
private native void allocate();
private native void allocateArray(int size);
@Override public FlyCaptureDriverInfo position(int position) {
return (FlyCaptureDriverInfo)super.position(position);
}

// Null-terminated driver name for attached camera.
public native @Cast("char") byte pszDriverName(int i); public native FlyCaptureDriverInfo pszDriverName(int i, byte pszDriverName);
@MemberGetter public native @Cast("char*") BytePointer pszDriverName();
// Null-terminated driver Driver version
public native @Cast("char") byte pszVersion(int i); public native FlyCaptureDriverInfo pszVersion(int i, byte pszVersion);
@MemberGetter public native @Cast("char*") BytePointer pszVersion();

}

//
// Description:
Expand Down Expand Up @@ -754,7 +773,7 @@ public static class FlyCaptureImage extends AbstractFlyCaptureImage {
//
public static native @Cast("FlyCaptureError") int flycaptureModifyCallback(
FlyCaptureContext context,
FlyCaptureCallback pfnCallback,
@Cast("FlyCaptureCallback*") @ByPtrPtr FlyCaptureCallback pfnCallback,
Pointer pParam,
@Cast("bool") boolean bAdd );

Expand Down Expand Up @@ -894,7 +913,9 @@ public static class FlyCaptureImage extends AbstractFlyCaptureImage {
// Returns:
// A FlyCaptureError indicating the success or failure of the function.
//

public static native @Cast("FlyCaptureError") int flycaptureGetDriverInfo(
FlyCaptureContext context,
FlyCaptureDriverInfo pInfo );


//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -3351,7 +3372,26 @@ public static class FlyCapturePacketInfo extends Pointer {
// See Also:
// flycaptureInitialize(), flycaptureInitializeFromSerialNumber(), flycaptureInitializePlus()
//

public static native @Cast("FlyCaptureError") int flycaptureInitializeFromSerialNumberPlus(
FlyCaptureContext context,
@Cast("FlyCaptureCameraSerialNumber") int serialNumber,
@Cast("unsigned long") int ulNumBuffers,
@Cast("unsigned char**") PointerPointer arpBuffers );
public static native @Cast("FlyCaptureError") int flycaptureInitializeFromSerialNumberPlus(
FlyCaptureContext context,
@Cast("FlyCaptureCameraSerialNumber") int serialNumber,
@Cast("unsigned long") int ulNumBuffers,
@Cast("unsigned char**") @ByPtrPtr BytePointer arpBuffers );
public static native @Cast("FlyCaptureError") int flycaptureInitializeFromSerialNumberPlus(
FlyCaptureContext context,
@Cast("FlyCaptureCameraSerialNumber") int serialNumber,
@Cast("unsigned long") int ulNumBuffers,
@Cast("unsigned char**") @ByPtrPtr ByteBuffer arpBuffers );
public static native @Cast("FlyCaptureError") int flycaptureInitializeFromSerialNumberPlus(
FlyCaptureContext context,
@Cast("FlyCaptureCameraSerialNumber") int serialNumber,
@Cast("unsigned long") int ulNumBuffers,
@Cast("unsigned char**") @ByPtrPtr byte[] arpBuffers );

//=============================================================================
// Control Functions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,32 +34,29 @@
import org.bytedeco.javacpp.tools.InfoMapper;

/**
* Wrapper for Point Grey FlyCapture2_C library (the C API v.2).
* Wrapper for Point Grey FlyCapture2 library (the C++ API v.2).
*
* @author Jarek Sacha
*/
@Properties(target = "org.bytedeco.javacpp.FlyCapture2", value = {
@Platform(value = {"linux", "windows"}, include = {"<FlyCapture2Platform.h>", "<FlyCapture2Defs.h>",
"<Error.h>", "<BusManager.h>", "<CameraBase.h>", "<Camera.h>", "<GigECamera.h>", "<Image.h>",
"<Utilities.h>", "<AVIRecorder.h>", "<TopologyNode.h>", "<ImageStatistics.h>"}),
@Platform(value = "linux", link = "flycapture@.2", includepath = "/usr/include/flycapture/"),
@Platform(value = "windows", link = "FlyCapture2",
include = {"<FlyCapture2Platform.h>", "<FlyCapture2Defs.h>", "<Error.h>", "<BusManager.h>",
"<CameraBase.h>", "<Camera.h>", "<GigECamera.h>", "<Image.h>", "<Utilities.h>",
"<AVIRecorder.h>", "<TopologyNode.h>", "<ImageStatistics.h>"},
includepath = {"C:/Program Files/Point Grey Research/FlyCapture2/include/"}),
@Platform(value = "windows-x86",
linkpath = {"C:/Program Files/Point Grey Research/FlyCapture2/lib/"},
define = {"WIN32"},
preloadpath = {"C:/Program Files/Point Grey Research/FlyCapture2/bin/"}),
@Platform(value = "windows-x86_64",
linkpath = {"C:/Program Files/Point Grey Research/FlyCapture2/lib64/"},
define = {"WIN64"},
preloadpath = {"C:/Program Files/Point Grey Research/FlyCapture2/bin64/"})})
includepath = "C:/Program Files/Point Grey Research/FlyCapture2/include/"),
@Platform(value = "windows-x86", define = "WIN32",
linkpath = "C:/Program Files/Point Grey Research/FlyCapture2/lib/",
preloadpath = "C:/Program Files/Point Grey Research/FlyCapture2/bin/"),
@Platform(value = "windows-x86_64", define = "WIN64",
linkpath = "C:/Program Files/Point Grey Research/FlyCapture2/lib64/",
preloadpath = "C:/Program Files/Point Grey Research/FlyCapture2/bin64/") })
public class FlyCapture2 implements InfoMapper {
public void map(InfoMap infoMap) {
infoMap.put(new Info("FLYCAPTURE2_API", "FLYCAPTURE2_LOCAL").cppTypes().annotations().cppText(""))
.put(new Info("defined(WIN32) || defined(WIN64)").define(true))
.put(new Info("ErrorType").cast().valueTypes("int"))
.put(new Info("FlyCapture2::ImageEventCallback").valueTypes("ImageEventCallback")
.pointerTypes("@Cast(\"FlyCapture2::ImageEventCallback*\") @ByPtrPtr ImageEventCallback"))
.put(new Info("FlyCapture2::CameraBase::GetRegisterString", "FlyCapture2::CameraBase::StartSyncCapture").skip());

.put(new Info("defined(WIN32) || defined(WIN64)").define())
.put(new Info("FlyCapture2::ImageEventCallback").valueTypes("ImageEventCallback")
.pointerTypes("@Cast(\"FlyCapture2::ImageEventCallback*\") @ByPtrPtr ImageEventCallback"))
.put(new Info("FlyCapture2::CameraBase::GetRegisterString", "FlyCapture2::CameraBase::StartSyncCapture").skip());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,26 @@
* @author Jarek Sacha
*/
@Properties(target = "org.bytedeco.javacpp.FlyCapture2_C", value = {
@Platform(value = {"linux", "windows"}, include = {"<FlyCapture2Defs_C.h>", "<FlyCapture2_C.h>"}),
@Platform(value = "linux", link = "flycapture-c@.2", includepath = "/usr/include/flycapture/C/"),
@Platform(value = "windows", link = "FlyCapture2_C", preload = {"libiomp5md", "FlyCapture2"},
include = {"<FlyCapture2Defs_C.h>", "<FlyCapture2_C.h>"},
includepath = {"C:/Program Files/Point Grey Research/FlyCapture2/include/C/"}),
includepath = "C:/Program Files/Point Grey Research/FlyCapture2/include/C/"),
@Platform(value = "windows-x86",
linkpath = {"C:/Program Files/Point Grey Research/FlyCapture2/lib/C/"},
linkpath = "C:/Program Files/Point Grey Research/FlyCapture2/lib/C/",
preloadpath = {"C:/Program Files/Point Grey Research/FlyCapture2/bin/",
"C:/Program Files/Point Grey Research/FlyCapture2/bin/C/"}),
"C:/Program Files/Point Grey Research/FlyCapture2/bin/C/"}),
@Platform(value = "windows-x86_64",
linkpath = {"C:/Program Files/Point Grey Research/FlyCapture2/lib64/C/"},
linkpath = "C:/Program Files/Point Grey Research/FlyCapture2/lib64/C/",
preloadpath = {"C:/Program Files/Point Grey Research/FlyCapture2/bin64/",
"C:/Program Files/Point Grey Research/FlyCapture2/bin64/C/"})})
"C:/Program Files/Point Grey Research/FlyCapture2/bin64/C/"}) })
public class FlyCapture2_C implements InfoMapper {
public void map(InfoMap infoMap) {
infoMap.put(new Info("FLYCAPTURE2_C_API", "FLYCAPTURE2_C_CALL_CONVEN").cppTypes().annotations().cppText(""))
.put(new Info("fc2TriggerDelayInfo").cast().pointerTypes("fc2PropertyInfo"))
.put(new Info("fc2TriggerDelay").cast().pointerTypes("fc2Property"))
.put(new Info("fc2ImageEventCallback").valueTypes("fc2ImageEventCallback")
.pointerTypes("@Cast(\"fc2ImageEventCallback*\") @ByPtrPtr fc2ImageEventCallback"))
.put(new Info("fc2Context").valueTypes("fc2Context")
.pointerTypes("@Cast(\"fc2Context*\") @ByPtrPtr fc2Context"));
.put(new Info("fc2TriggerDelayInfo").cast().pointerTypes("fc2PropertyInfo"))
.put(new Info("fc2TriggerDelay").cast().pointerTypes("fc2Property"))
.put(new Info("fc2ImageEventCallback").valueTypes("fc2ImageEventCallback")
.pointerTypes("@Cast(\"fc2ImageEventCallback*\") @ByPtrPtr fc2ImageEventCallback"))
.put(new Info("fc2Context").valueTypes("fc2Context")
.pointerTypes("@Cast(\"fc2Context*\") @ByPtrPtr fc2Context"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
* as long as it is distributed as part of a substantially larger package,
* and not as a standalone wrapper to the FlyCapture library.
*
* ****** IMPORTANT: Some functions are commented out to cover the
* ****** common API from the FlyCapture SDK version 1.7 to 2.x.
*/

package org.bytedeco.javacpp.presets;
Expand Down Expand Up @@ -61,15 +59,17 @@
"C:/Program Files/Point Grey Research/FlyCapture2/bin64/FC1/"}) })
public class PGRFlyCapture implements InfoMapper {
public void map(InfoMap infoMap) {
infoMap.put(new Info("windows.h").skip())
.put(new Info("PGRFLYCAPTURE_API", "PGRFLYCAPTURE_CALL_CONVEN").cppTypes().annotations().cppText(""))
.put(new Info("FlyCaptureContext").valueTypes("FlyCaptureContext").pointerTypes("@Cast(\"FlyCaptureContext*\") @ByPtrPtr FlyCaptureContext"))
.put(new Info("FlyCaptureImage").base("AbstractFlyCaptureImage"))
.put(new Info("FlyCaptureInfoEx::iInitialized", "FlyCaptureDriverInfo",
"flycaptureGetDriverInfo", "flycaptureInitializeFromSerialNumberPlus",
"flycaptureInitializeNotify", "flycaptureLockNextEvent", "flycaptureUnlockEvent").skip())
.put(new Info("OVERLAPPED").cast().pointerTypes("Pointer"))
.put(new Info("long", "unsigned long", "ULONG").cast().valueTypes("int").pointerTypes("IntPointer", "IntBuffer", "int[]"));
infoMap.put(new Info("windows.h").skip())
.put(new Info("PGRFLYCAPTURE_API", "PGRFLYCAPTURE_CALL_CONVEN").cppTypes().annotations().cppText(""))
.put(new Info("FlyCaptureContext").valueTypes("FlyCaptureContext")
.pointerTypes("@Cast(\"FlyCaptureContext*\") @ByPtrPtr FlyCaptureContext"))
.put(new Info("FlyCaptureCallback").valueTypes("FlyCaptureCallback")
.pointerTypes("@Cast(\"FlyCaptureCallback*\") @ByPtrPtr FlyCaptureCallback"))
.put(new Info("FlyCaptureImage").base("AbstractFlyCaptureImage"))
.put(new Info("flycaptureInitializeNotify", "flycaptureLockNextEvent", "flycaptureUnlockEvent").skip())
.put(new Info("OVERLAPPED").cast().pointerTypes("Pointer"))
.put(new Info("long", "unsigned long", "ULONG").cast().valueTypes("int")
.pointerTypes("IntPointer", "IntBuffer", "int[]"));
}

public static abstract class AbstractFlyCaptureImage extends Pointer {
Expand Down

0 comments on commit dfcbedd

Please sign in to comment.