Permalink
Browse files

Merge pull request #90 from Psychtoolbox-3/master

PTB BETA RELEASE "The fun in dysfunction"

    Support for GStreamer camerabin2 video capture & recording.
    Support for builtin imaging pipeline panel fitter.
    Improved Linux support for timestamping, graphics problem detection and desktop compositor handling.
    Improved support for handling of MS-Windows-8 dektop compositor handling.
    Bugfixes / Workarounds for various Windows and OSX operating system bugs.
    Fixes to PsychKinectCore and PsychHID.
    Various other fixes for small documentation and PTB bugs.
    Potential multi-threaded decoding improvements for GStreamer movie playback.
    More fixes and workarounds for handling of slightly broken Intel-DDX graphics drivers on Linux (pre 2.20.16 series).
    HDMI side-by-side horizontally compressed frame packing format support for stereo displays.
    Datapixx and Eyelink improvements.
    CRS OptiCal support.
    Other stuff i can't remember.
  • Loading branch information...
kleinerm committed Jan 4, 2013
2 parents 9b5c690 + 2db4992 commit 89ac3a065cf2d29f6bdc9ee8e90f81e022c710b7
Showing with 3,807 additions and 2,061 deletions.
  1. +1 −1 PsychSourceGL/Source/Common/Base/PsychError.c
  2. +8 −23 PsychSourceGL/Source/Common/PsychHID/PsychHIDGetDevices.c
  3. +40 −3 PsychSourceGL/Source/Common/PsychHID/PsychHIDHelpers.c
  4. +7 −7 PsychSourceGL/Source/Common/PsychHID/PsychHIDReceiveReports.c
  5. +29 −13 PsychSourceGL/Source/Common/PsychKinect/PsychKinect.c
  6. +1 −1 PsychSourceGL/Source/Common/Screen/PsychAlphaBlending.c
  7. +1 −1 PsychSourceGL/Source/Common/Screen/PsychGLGlue.c
  8. +198 −88 PsychSourceGL/Source/Common/Screen/PsychImagingPipelineSupport.c
  9. +17 −0 PsychSourceGL/Source/Common/Screen/PsychMovieSupportGStreamer.c
  10. +744 −327 PsychSourceGL/Source/Common/Screen/PsychVideoCaptureSupportGStreamer.c
  11. +283 −243 PsychSourceGL/Source/Common/Screen/PsychWindowSupport.c
  12. +2 −1 PsychSourceGL/Source/Common/Screen/RegisterProject.c
  13. +2 −3 PsychSourceGL/Source/Common/Screen/SCREENColorRange.c
  14. +39 −7 PsychSourceGL/Source/Common/Screen/SCREENDrawText.c
  15. +2 −2 PsychSourceGL/Source/Common/Screen/SCREENMakeTexture.c
  16. +200 −57 PsychSourceGL/Source/Common/Screen/SCREENOpenWindow.c
  17. +14 −18 PsychSourceGL/Source/Common/Screen/SCREENPixelSize.c
  18. +21 −91 PsychSourceGL/Source/Common/Screen/SCREENPixelSizes.c
  19. +13 −6 PsychSourceGL/Source/Common/Screen/SCREENRect.c
  20. +35 −30 PsychSourceGL/Source/Common/Screen/SCREENStartVideoCapture.c
  21. +21 −19 PsychSourceGL/Source/Common/Screen/SCREENWindowSize.c
  22. +1 −1 PsychSourceGL/Source/Common/Screen/Screen.h
  23. +15 −27 PsychSourceGL/Source/Common/Screen/ScreenExit.c
  24. +3 −15 PsychSourceGL/Source/Common/Screen/ScreenPreferenceState.c
  25. +6 −5 PsychSourceGL/Source/Common/Screen/ScreenSynopsis.c
  26. +3 −0 PsychSourceGL/Source/Common/Screen/ScreenTypes.h
  27. +8 −1 PsychSourceGL/Source/Common/Screen/WindowBank.h
  28. +37 −4 PsychSourceGL/Source/Linux/Screen/PsychScreenGlue.c
  29. +4 −3 PsychSourceGL/Source/Linux/Screen/PsychScreenGlue.h
  30. +246 −96 PsychSourceGL/Source/Linux/Screen/PsychWindowGlue.c
  31. +0 −1 PsychSourceGL/Source/Linux/Screen/PsychWindowGlue.h
  32. +32 −7 PsychSourceGL/Source/OSX/Screen/PsychScreenGlue.c
  33. +2 −0 PsychSourceGL/Source/OSX/Screen/PsychScreenGlue.h
  34. +0 −1 PsychSourceGL/Source/OSX/Screen/PsychWindowGlue.h
  35. +36 −7 PsychSourceGL/Source/Windows/PsychHID/PsychHIDStandardInterfaces.cpp
  36. +39 −0 PsychSourceGL/Source/Windows/Screen/PsychScreenGlue.c
  37. +1 −0 PsychSourceGL/Source/Windows/Screen/PsychScreenGlue.h
  38. +213 −82 PsychSourceGL/Source/Windows/Screen/PsychWindowGlue.c
  39. +1 −1 PsychSourceGL/Source/Windows/Screen/PsychWindowGlue.h
  40. +18 −1 PsychSourceGL/Source/linuxmakeitoctave3_ubuntugutsy.m
  41. +1 −0 PsychSourceGL/Source/osxmakeit.m
  42. +1 −0 PsychSourceGL/Source/osxmakeit32.m
  43. +1 −0 PsychSourceGL/Source/osxmakeitoctave3.m
  44. +1 −1 PsychSourceGL/Source/windowsmakeit64_twisty.m
  45. +2 −2 Psychtoolbox/PsychAlpha/KinectRawRecordingDemo.m
  46. BIN Psychtoolbox/PsychBasic/MatlabWindowsFilesR2007a/Datapixx.mexw64
  47. BIN Psychtoolbox/PsychBasic/MatlabWindowsFilesR2007a/PsychHID.mexw32
  48. BIN Psychtoolbox/PsychBasic/MatlabWindowsFilesR2007a/PsychHID.mexw64
  49. BIN Psychtoolbox/PsychBasic/MatlabWindowsFilesR2007a/PsychKinectCore.mexw32
  50. BIN Psychtoolbox/PsychBasic/MatlabWindowsFilesR2007a/PsychKinectCore.mexw64
  51. BIN Psychtoolbox/PsychBasic/MatlabWindowsFilesR2007a/Screen.mexw32
  52. BIN Psychtoolbox/PsychBasic/MatlabWindowsFilesR2007a/Screen.mexw64
  53. BIN Psychtoolbox/PsychBasic/Octave3LinuxFiles/PsychHID.mex
  54. BIN Psychtoolbox/PsychBasic/Octave3LinuxFiles/PsychKinectCore.mex
  55. BIN Psychtoolbox/PsychBasic/Octave3LinuxFiles/Screen.mex
  56. BIN Psychtoolbox/PsychBasic/Octave3LinuxFiles64/PsychHID.mex
  57. BIN Psychtoolbox/PsychBasic/Octave3LinuxFiles64/PsychKinectCore.mex
  58. BIN Psychtoolbox/PsychBasic/Octave3LinuxFiles64/Screen.mex
  59. BIN Psychtoolbox/PsychBasic/Octave3OSXFiles64/PsychHID.mex
  60. BIN Psychtoolbox/PsychBasic/Octave3OSXFiles64/PsychKinectCore.mex
  61. BIN Psychtoolbox/PsychBasic/Octave3OSXFiles64/Screen.mex
  62. BIN Psychtoolbox/PsychBasic/PsychHID.mexa64
  63. BIN Psychtoolbox/PsychBasic/PsychHID.mexglx
  64. BIN Psychtoolbox/PsychBasic/PsychHID.mexmaci64
  65. BIN Psychtoolbox/PsychBasic/PsychKinectCore.mexa64
  66. BIN Psychtoolbox/PsychBasic/PsychKinectCore.mexglx
  67. BIN Psychtoolbox/PsychBasic/PsychKinectCore.mexmaci64
  68. BIN Psychtoolbox/PsychBasic/Screen.mexa64
  69. BIN Psychtoolbox/PsychBasic/Screen.mexglx
  70. BIN Psychtoolbox/PsychBasic/Screen.mexmaci
  71. BIN Psychtoolbox/PsychBasic/Screen.mexmaci64
  72. +37 −4 Psychtoolbox/PsychColorimetricData/ComputeCIEConeFundamentals.m
  73. +8 −1 Psychtoolbox/PsychColorimetricData/ComputeRawConeFundamentals.m
  74. +18 −1 Psychtoolbox/PsychColorimetricData/PhotopigmentAxialDensity.m
  75. +1 −1 Psychtoolbox/PsychDemos/BlurredMipmapDemo.m
  76. +10 −2 Psychtoolbox/PsychDemos/DrawManuallyAntiAliasedTextDemo.m
  77. +87 −52 Psychtoolbox/PsychDemos/ImagingStereoDemo.m
  78. +32 −32 Psychtoolbox/PsychDemos/KinectDemo.m
  79. +38 −12 Psychtoolbox/PsychDemos/MouseTraceDemo3.m
  80. +10 −1 Psychtoolbox/PsychDemos/MovieDemos/PlayMoviesDemo.m
  81. +75 −63 Psychtoolbox/PsychDocumentation/BeampositionQueries.m
  82. +7 −0 Psychtoolbox/PsychDocumentation/ConserveVRAMSettings.m
  83. +22 −17 Psychtoolbox/PsychDocumentation/SyncTrouble.m
  84. +3 −0 Psychtoolbox/PsychGLImageProcessing/Contents.m
  85. +44 −0 Psychtoolbox/PsychGLImageProcessing/PsychImaging.m
  86. +161 −0 Psychtoolbox/PsychGLImageProcessing/SetCompressedStereoSideBySideParameters.m
  87. +107 −0 Psychtoolbox/PsychGLImageProcessing/SetStereoSideBySideParameters.m
  88. +1 −1 Psychtoolbox/PsychHardware/BitsPlusToolbox/BitsPlusPackColorImage.m
  89. +5 −1 Psychtoolbox/PsychHardware/Daq/DaqAIn.m
  90. +519 −512 Psychtoolbox/PsychHardware/Daq/DaqAInScan.m
  91. +5 −4 Psychtoolbox/PsychHardware/DatapixxToolbox/DatapixxBasic/PsychDataPixx.m
  92. +58 −8 Psychtoolbox/PsychHardware/DatapixxToolbox/DatapixxBasic/ResponsePixx.m
  93. +7 −15 Psychtoolbox/PsychHardware/EyelinkToolbox/EyelinkBasic/EyelinkUpdateDefaults.m
  94. +0 −1 Psychtoolbox/PsychHardware/EyelinkToolbox/EyelinkOneLiners/EyelinkInit.m
  95. +13 −13 Psychtoolbox/PsychOneliners/LoadIdentityClut.m
  96. +6 −5 Psychtoolbox/PsychOneliners/NearestResolution.m
  97. +3 −8 Psychtoolbox/PsychOneliners/PsychDebugWindowConfiguration.m
  98. +39 −39 Psychtoolbox/PsychOpenGL/LoadOBJFile.m
  99. +25 −0 Psychtoolbox/PsychTests/CIEConeFundamentalsTest.m
  100. +6 −6 Psychtoolbox/PsychTests/PerceptualVBLSyncTest.m
  101. +76 −39 Psychtoolbox/PsychTests/VBLSyncTest.m
  102. +35 −27 managementtools/parseptbdownloadlog.m
@@ -126,7 +126,7 @@ static void InitErrorStrings(void)
errorStringsERROR[PsychError_invalidScumber]= "Invalid Screen Number";
errorStringsERROR[PsychError_invalidNumdex]= "Invalid or missing Screen Number or Window Index";
errorStringsERROR[PsychError_invalidColorArg]= "Invalid Color Argument";
- errorStringsERROR[PsychError_invalidDepthArg]= "Invalide pixel size argument";
+ errorStringsERROR[PsychError_invalidDepthArg]= "Invalid pixel size argument";
errorStringsERROR[PsychError_invalidRectArg]= "Invalid Rect Argument";
errorStringsERROR[PsychError_invalidNumberBuffersArg]= "Invalid number of buffers specified";
errorStringsERROR[PsychError_nullWinRecPntr]= "Window Record Pointer is NULL";
@@ -98,28 +98,6 @@ PsychError PSYCHHIDGetDevices(void)
#endif
}
-#if (PSYCH_SYSTEM == PSYCH_OSX) && defined(__LP64__)
- // Try to load all bundles from Psychtoolbox/PsychHardware/
- // This loads the HID_Utilities.framework bundle if it is present. The whole point of it is
- // to allow our statically compiled-in version of the library to find the location of
- // the XML file with the database of (vendorId, productId) -> (VendorName, ProductName) and
- // (usagePage, usage) -> (usageName) mappings.
- //
- // In practice, the XML file only serves as a fallback, and one that doesn't contain much
- // useful info for mainstream products, only for a few niche products. Given its limited
- // value, i think we can refrain from shipping the framework as part of Psychtoolbox and
- // just provide the option to use it (== its XML file) if users decide to install it themselves.
- char tmpString[1024];
-
- sprintf(tmpString, "%sPsychHardware/", PsychRuntimeGetPsychtoolboxRoot(FALSE));
- CFStringRef urlString = CFStringCreateWithCString(kCFAllocatorDefault, tmpString, kCFStringEncodingASCII);
- CFURLRef directoryURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, urlString, kCFURLPOSIXPathStyle, false);
- CFRelease(urlString);
- CFArrayRef bundleArray = CFBundleCreateBundlesFromDirectory(kCFAllocatorDefault, directoryURL, NULL);
- CFRelease(directoryURL);
- CFRelease(bundleArray);
-#endif
-
PsychHIDVerifyInit();
numDeviceStructElements=(int)HIDCountDevices();
PsychAllocOutStructArray(1, FALSE, numDeviceStructElements, numDeviceStructFieldNames, deviceFieldNames, &deviceStruct);
@@ -157,11 +135,18 @@ PsychError PSYCHHIDGetDevices(void)
#if PSYCH_SYSTEM == PSYCH_OSX
// OSX 64-Bit specific: OSX 10.5 and later:
#ifdef __LP64__
+ char tmpString[1024];
+ CFStringRef cfusageName = NULL;
+
PsychSetStructArrayDoubleElement("usagePageValue", deviceIndex, (double) IOHIDDevice_GetPrimaryUsagePage(currentDevice), deviceStruct);
PsychSetStructArrayDoubleElement("usageValue", deviceIndex, (double) IOHIDDevice_GetPrimaryUsage(currentDevice), deviceStruct);
sprintf(usageName, "");
- CFStringRef cfusageName = HIDCopyUsageName(IOHIDDevice_GetPrimaryUsagePage(currentDevice), IOHIDDevice_GetPrimaryUsage(currentDevice));
+ // HIDCopyUsageName() is slow: It takes about 22 msecs to map one HID device on a modern machine!
+ // However, the functions below are also rather slow, taking another ~ 8 msecs for a total of ~30 msecs
+ // on a mid-2010 MacBookPro with quad-core cpu.
+ cfusageName = HIDCopyUsageName(IOHIDDevice_GetPrimaryUsagePage(currentDevice), IOHIDDevice_GetPrimaryUsage(currentDevice));
+
if (cfusageName && (CFStringGetLength(cfusageName) > 0)) {
CFStringGetCString(cfusageName, usageName, sizeof(usageName), kCFStringEncodingASCII);
CFRelease(cfusageName);
@@ -458,6 +458,28 @@ void PsychHIDVerifyInit(void)
// Verify no security sensitive application is blocking our low-level access to HID devices:
PsychHIDWarnInputDisabled(NULL);
+
+ #if defined(__LP64__)
+ // Try to load all bundles from Psychtoolbox/PsychHardware/
+ // This loads the HID_Utilities.framework bundle if it is present. The whole point of it is
+ // to allow our statically compiled-in version of the library to find the location of
+ // the XML file with the database of (vendorId, productId) -> (VendorName, ProductName) and
+ // (usagePage, usage) -> (usageName) mappings.
+ //
+ // In practice, the XML file only serves as a fallback, and one that doesn't contain much
+ // useful info for mainstream products, only for a few niche products. Given its limited
+ // value, i think we can refrain from shipping the framework as part of Psychtoolbox and
+ // just provide the option to use it (== its XML file) if users decide to install it themselves.
+ char tmpString[1024];
+
+ sprintf(tmpString, "%sPsychHardware/", PsychRuntimeGetPsychtoolboxRoot(FALSE));
+ CFStringRef urlString = CFStringCreateWithCString(kCFAllocatorDefault, tmpString, kCFStringEncodingASCII);
+ CFURLRef directoryURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, urlString, kCFURLPOSIXPathStyle, false);
+ CFRelease(urlString);
+ CFArrayRef bundleArray = CFBundleCreateBundlesFromDirectory(kCFAllocatorDefault, directoryURL, NULL);
+ CFRelease(directoryURL);
+ CFRelease(bundleArray);
+ #endif
}
/*
@@ -849,7 +871,7 @@ int PsychHIDFindCollectionElements(pRecElement collectionRecord, HIDElementTypeM
*/
void PsychHIDVerifyInit(void)
{
- int busId, devId, intId;
+ int busId, devId;
pRecDevice currentDevice = NULL;
struct hid_device_info* hid_dev = NULL;
@@ -878,8 +900,23 @@ void PsychHIDVerifyInit(void)
if (hid_dev->serial_number) wcstombs(&currentDevice->serial[0], hid_dev->serial_number, 256);
// Convert unique device path into unique numeric location id:
- sscanf(hid_dev->path, "%x:%x:%x", &busId, &devId, &intId);
- currentDevice->locID = (double) ((busId << 24) + (devId << 8) + intId);
+ if (PSYCH_SYSTEM == PSYCH_LINUX) {
+ // Use USB bus-id and device-id as unique location identifier:
+ sscanf(hid_dev->path, "%x:%x", &busId, &devId);
+ currentDevice->locID = (double) ((busId << 16) + (devId << 0));
+ }
+
+ if (PSYCH_SYSTEM == PSYCH_WINDOWS) {
+ // Use device container id as unique location identifier.
+ // This may only work on Windows-7+ and is a bit of a hack here,
+ // the id is a GUID, nothing related to busId or devId. We init
+ // devId with the hid_dev pointer value, to get a devId and thereby
+ // location id in case proper parsing of a container id doesn't work:
+ busId = 0;
+ devId = (int) hid_dev;
+ if (strstr(hid_dev->path, "{")) sscanf(strstr(hid_dev->path, "{"), "{%x-%x", &busId, &devId);
+ currentDevice->locID = (double) (((psych_uint64) busId << 32) + devId);
+ }
// Interface number is great for identifying DAQ devices, but not available
// on OS/X, so this will be a Linux/Windows only thing.
@@ -429,7 +429,7 @@ PsychError ReceiveReports(int deviceIndex)
if(freeReportsPtr[deviceIndex] == NULL) {
// Darn. We're full. It might be elegant to discard oldest report, but for now, we'll just ignore the new one.
if (!rateLimit[deviceIndex]) printf("PsychHID: WARNING! ReportCallback warning. No more free reports for deviceIndex %i. Discarding new report.\n", deviceIndex);
- rateLimit[deviceIndex] = 1;
+ rateLimit[deviceIndex] = 1;
continue;
}
@@ -439,18 +439,18 @@ PsychError ReceiveReports(int deviceIndex)
device = PsychHIDGetDeviceRecordPtrFromIndex(deviceIndex);
last_hid_device = (hid_device*) device->interface;
- // Get a report struct to fill in:
+ // Get a report struct to fill in:
r = freeReportsPtr[deviceIndex];
// Fetch the actual data: Bytes fetched, or zero for no reports available, or
// -1 for error condition.
r->error = hid_read((hid_device*) device->interface, &(r->report[0]), MaxDeviceReportSize[deviceIndex]);
- // Skip remainder if no data received:
- if (r->error == 0) continue;
+ // Skip remainder if no data received:
+ if (r->error == 0) continue;
- // Ok, we got something, even if it is only an error code. Need
- // to move the (r)eport from the free list to the received list:
+ // Ok, we got something, even if it is only an error code. Need
+ // to move the (r)eport from the free list to the received list:
freeReportsPtr[deviceIndex] = r->next;
r->next=NULL;
@@ -464,7 +464,7 @@ PsychError ReceiveReports(int deviceIndex)
// Timestamp processing:
PsychGetPrecisionTimerSeconds(&r->time);
- // Success or error?
+ // Success or error?
if (r->error > 0) {
// Success: Reset error, assign size of retrieved report:
r->bytes = r->error;
@@ -119,12 +119,13 @@ void InitializeSynopsis(void)
int i=0;
const char **synopsis = synopsisSYNOPSIS; //abbreviate the long name
- synopsis[i++] = "PsychKinectCore - A Psychtoolbox driver for the Microsoft Kinect box.\n";
+ synopsis[i++] = "PsychKinectCore - A Psychtoolbox driver for the Microsoft XBOX-360 Kinect.\n";
+ synopsis[i++] = "The driver currently only supports the 'XBOX-360 Kinect', *not* 'Kinect for Windows'!\n";
synopsis[i++] = "This driver allows to control the box and grab color images and depth";
synopsis[i++] = "images from the Kinect depth camera.\n";
synopsis[i++] = "It uses and requires the free software drivers and libraries from the OpenKinect";
synopsis[i++] = "project (Thanks!): http://openkinect.org\n";
- synopsis[i++] = "Libfreenect is Copyright (C) 2010 - 2012 individual OpenKinect contributors.";
+ synopsis[i++] = "Libfreenect is Copyright (C) 2010 - 2013 individual OpenKinect contributors.";
synopsis[i++] = "Libfreenect requires libusb-1.0, which is licensed under LGPL v2 or later.";
synopsis[i++] = "See 'help InstallKinect' for more detailed license information.\n";
synopsis[i++] = "The PsychKinectCore driver is licensed to you under the terms of the MIT license,";
@@ -410,7 +411,8 @@ PsychError PSYCHKINECTOpen(void)
static char useString[] = "kinectPtr = PsychKinect('Open' [, deviceIndex=0][, numbuffers=2][, bayerFilterMode=1]);";
//
static char synopsisString[] =
- "Open connection to Kinect box, return a 'kinectPtr' handle to it.\n\n"
+ "Open connection to Microsoft XBOX-360 Kinect box, return a 'kinectPtr' handle to it.\n\n"
+ "The driver currently only supports the 'XBOX-360 Kinect', *not* 'Kinect for Windows'!\n"
"The call tries to open the Kinect box with index 'deviceIndex', or the "
"first detected box, if 'deviceIndex' is omitted. It configures the box "
"for video and depth capture, using a n-buffered pool for internal storage "
@@ -987,14 +989,28 @@ PsychError PSYCHKINECTGetImage(void)
static char useString[] = "[imageOrPtr, width, height, channels, extType, extFormat] = PsychKinect('GetImage', kinectPtr [, imtype=0][, returnTexturePtr=0]);";
// 1 2 3 4 5 6 1 2 3
static char synopsisString[] =
- "Return the color image data for the frame fetched via 'GrabFrame'.\n\n"
- "If 'returnTexturePtr' is zero (default), a uint8 3D image matrix is returned, which could "
- "be directly fed to image processing toolbox, imwrite() or Screen('MakeTexture').\n"
- "'imtype' if set to 1 returns a color-coded depth image instead of the RGB camera image.\n"
- "If 'returnTexturePtr' is one, a double-encoded memory pointer to a RGBA8 rectangle texture buffer "
- "is returned, for use with Screen('SetOpenGLTextureFromMemPointer') for injection into "
- "PTB's texturing system.\n";
-
+ "Return the color image data for the frame fetched via 'GrabFrame'.\n\n"
+ "If 'returnTexturePtr' is zero (default), a uint8 3D image matrix is returned. "
+ "The matrix is usually in RGB pixel interleaved row-major format for efficiency reasons, "
+ "ie. to improve processing speed for realtime applications.\n"
+ "If the optional 'bayerFilterMode' flag in PsychKinect('Open') was set to 0, then the "
+ "image is returned as a row-major 2D matrix with the raw color sensor data instead of "
+ "post-processed RGB bayer filtered data, again for efficiency reasons. A 'bayerfilter' "
+ "setting of 2 would return a row-major 2D matrix with infrared depth sensor raw data.\n"
+ "If you want to use the image matrix with standard Matlab/Octave or PTB functions, e.g., "
+ "feed it to the image processing toolbox, imwrite(), imshow(), or Screen('MakeTexture'), "
+ "you need to convert it into the expected Matlab/Octave planar column-major format:\n\n"
+ "for i = 1:channels\n"
+ " retpixels(:,:,i) = transpose(squeeze(imageOrPtr(i, :, :)));\n"
+ "end\n"
+ "imshow(retpixels);\n\n"
+ "'imtype' if set to 1, returns a color-coded depth image instead of the RGB camera image.\n"
+ "If 'returnTexturePtr' is one, a double-encoded memory pointer to a LUMINANCE8 or RGB8 "
+ "rectangle texture buffer is returned, for use with Screen('SetOpenGLTextureFromMemPointer') "
+ "for injection into PTB's texturing system. 'extType' and 'extFormat' encode the proper "
+ "parameters to pass for external format and type to Screen('SetOpenGLTextureFromMemPointer').\n"
+ "See for example KinectDemo.m for how this is used for fast video display.\n";
+
static char seeAlsoString[] = "";
int handle;
@@ -1077,7 +1093,7 @@ PsychError PSYCHKINECTGetImage(void)
// Just return a memory pointer to the colorbuffer:
PsychCopyOutDoubleArg(1, FALSE, PsychPtrToDouble((void*) gl_depth_back));
} else {
- PsychAllocOutUnsignedByteMatArg(1, FALSE, 3, buffer->dheight, buffer->dwidth, &outimg);
+ PsychAllocOutUnsignedByteMatArg(1, FALSE, 3, buffer->dwidth, buffer->dheight, &outimg);
memcpy(outimg, gl_depth_back, buffer->dheight * buffer->dwidth * 3);
}
@@ -1096,7 +1112,7 @@ PsychError PSYCHKINECTGetImage(void)
// Just return a memory pointer to the colorbuffer:
PsychCopyOutDoubleArg(1, FALSE, PsychPtrToDouble((void*) buffer->color));
} else {
- PsychAllocOutUnsignedByteMatArg(1, FALSE, channels, buffer->cheight, buffer->cwidth, &outimg);
+ PsychAllocOutUnsignedByteMatArg(1, FALSE, channels, buffer->cwidth, buffer->cheight, &outimg);
memcpy(outimg, buffer->color, buffer->cheight * buffer->cwidth * channels);
}
@@ -162,7 +162,7 @@ int PsychGetAlphaBlendingFactorStringFromConstant(GLenum blendConstant, char *bl
if(blendConstant==blendingModeConstants[i]){
if(blendString!=NULL)
strcpy(blendString, blendingModeStrings[i]);
- return(strlen(blendingModeStrings[i]) + 1);
+ return((int) strlen(blendingModeStrings[i]) + 1);
}
}
return(0);
@@ -313,7 +313,7 @@ psych_bool PsychGetGLErrorListString(const char **errorListStr)
currentIndex=0;
for(glError=glGetError(); glError!=GL_NO_ERROR; glError=glGetError()){
errorNameStr=PsychGetGLErrorNameString(glError);
- deltaStrLen=strlen(errorNameStr)+2; //2 chars: comma and space
+ deltaStrLen = (int) strlen(errorNameStr)+2; //2 chars: comma and space
nextCurrentIndex=currentIndex+deltaStrLen;
if(nextCurrentIndex >= MAX_GL_ERROR_LIST_LEN)
PsychErrorExitMsg(PsychError_internal,"string memory overflow");
Oops, something went wrong.

0 comments on commit 89ac3a0

Please sign in to comment.