Merge pull request #196 from kleinerm/master

Pull current state into public master.

Disables 32-Bit Matlab support in downloader/updater/etc.
Resyncs with bugfixes for 3.0.11.
Add routines for converting between wavelength of light and frequency of light.

Signed-off-by: David Brainard <brainard@psych.upenn.edu>
Code to handle pigment bleaching in FillInPhotoreceptors, plus added routine to compute fraction pigment bleached.

Signed-off-by: David Brainard <brainard@psych.upenn.edu>
Modifications to allow computation of effects of pigment bleaching on cone spectral sensitivities.

I think this all works OK, but will take a pass over next few days to clean up the design a little, as well as better comments etc.

Signed-off-by: David Brainard <brainard@psych.upenn.edu>
Cleaned up photopigment bleaching calcs.   Nothing momentous.

Signed-off-by: David Brainard <brainard@psych.upenn.edu>
Dusted these off to work with recent changes for pigment bleaching.  Mostly printout fixes.

Signed-off-by: David Brainard <brainard@psych.upenn.edu>
Change constants to represent 2:1 assumed L:M ratio.

Signed-off-by: David Brainard <brainard@psych.upenn.edu>
AdditiveBlendingForLinearSuperpositionTutorial: Fix cursor handling.

Use Show/HideCursor(screenNumber) instead of Show/HideCursor,
so it can address multiple screen's on Linux individually
to take advantage of its higher flexibility.
Screen for 32-Bit Octave on Linux rebuilt for testing.
PsychImaging: Simplify setup of Native10Bit mode.

Screen('GetWindowInfo')'s winfo.SpecialFlags setting
1024 clearly signals if our 10 bpc framebuffer hack
is in use (1024 present) or if the OS did the 10 bpc
setup (absent). Check for this value to find out if
we need to load and attach our custom GLSL ARGB2101010
formatting shader, or if we can skip this step.

-> Get rid of the tons of driver checks.
Add experimental code for testing RGB11-11-10 "11 bpc" framebuffers.

New function PsychHelperCreateRGB111110RemapCLUT.m creates the multi-LUT
for output formatting, some quick and dirty hacks in PsychImaging allow
testing on one display head of a DCE-4+ class gpu.

This hack is temporary.
11 bpc testcode v2 - Seems to work somewhat ok.

-> Baseline for real implementation.
New MATLAB class, @CalStruct, for unified access of different cal files, and updates in PsychCal and PsychDemos functions.

This is a major update to the underlying routines that handle and compute on the PTB calibration structure.  The purpose of this was to allow us to work with a more rational underlying organization of the fields of the structure, some of which dated back to Matlab 4 which did not support multidimensional arrays (and hence packed in multidimensional data into 2D matrices in a manner that was hard to read).

To accomplish this change, we added a new MATLAB class named @CalStruct for unified data access across old- and new-style cal structures. @CalStruct objects offer two benefits: (1) they enable PsychCal functions to operate seamlessly across both old-style and new-style cal files, and (2) they reduce communication overhead by passing a reference to the cal struct data, as opposed to passing the cal struct data itself, which is what the PsychCal functions used to do.

Old-style cal files are still generated by existing calibration code such as the CalibrateMonSpd.m script provided in the PTB as well as perhaps in custom code written in individual labs.  These should continue to work as before, as we have updated all of the routines in the PTB that access calibration structures to do so transparently (see list below).  Compared to old-style cal files, new-style cal structs offer a more streamlined and cleaner data layout.

Nothing in the PTB currently generates a new-style calibration file.  The Brainard Lab  is developing object oriented calibration code (which will allow the calibration engine to work more flexibly with different measurement instruments and display code.  This newer code does generate new-style cal structures.  The changes to the PTB we're making here are to support this effort.  If you want to look at, use, or contribute to the development of the new calibration code, it is available (in a semi-stable state) from the BrainardLabToolbox repository on gitHub (https://github.com/DavidBrainard/BrainardLabToolbox/OOCalibrationToolbox).  As with the PTB, the BrainardLabToolbox is freely available under an open source license. As this new code becomes more stable, we may move it into the PTB.

We have updated the following PsychCal functions to seamlessly access (new- and old-style) calibration data via @CalStruct objects:
PrimaryToSettings.m
CalibrateFitGamma.m
RefitCalGamma.m
CalibrateFitLinMod.m
RefitCalLinMod.m
CalibrateFitYoked.m
RefitCalYoked.m
CalibratePlotAmbient.m
SensorToPrimary.m
CalibratePlotGamma.m
SensorToSettings.m
CalibratePlotSpectra.m
SensorToSettingsAcc.m
CompareMonCal.m
SetGammaMethod.m
DescribeMonCal.m
SetSensorColorSpace.m
DropCalBits.m
SettingsToPrimary.m
GamutToSettings.m
SettingsToSensor.m
ObjectToHandleCalOrCalStruct.m
SettingsToSensorAcc.m
PrimaryToGamut.m
UpdateAmbient.m
PrimaryToSensor.m
UpdateAmbientSensor.m

We have also updated the following PsychDemos functions to seamlessly access (new- and old-style) calibration data via @CalStruct objects:
CalDemo
IsomerizationsInEyeDemo.m

We tested these routines locally quite intensively to do our best to ensure that they operate the same as previously when provided with old calibration structures and that they produce the same results when provided with new calibration structures.  If, however, you discover a problem or find some routine lurking in the PTB that we failed to update, please let us know and we will try to fix rapidly.

David Brainard (brainard@psych.upenn.edu)
Nicolas Cottaris (cottaris@sas.uenn.edu)

Signed-off-by: David Brainard <brainard@psych.upenn.edu>
FlipTimingWithRTBoxPhotoDiodeTest: Also report too early flips.

Like VBLSyncTest does.
FlipTimingWithRTBoxPhotoDiodeTest: Improve plotting a tiny bit.

Use a different color for expected vs. real flip time delta.
Merge pull request #44 from Psychtoolbox-3/master

Resync with current master of official Psychtoolbox-3 repo.

Pull in David's new routines and OOP calibration stuff.
Fix IsomerizationsInDishDemo, IsomerizationsInEyeDemo, ValetonVanNorrenDemo.

Use proper short-circuit operators && instead of & to make them
work on Octave again.
PerceptualVBLSyncTestFlipInfo - Abort on non-Linux, as this is Linux only.
GraphicsDisplaySyncAcrossDualHeadsTestLinux: Refine implementation a bit.

-> Use first two assigned display heads of x-screen, not always heads 0 and 1,
   as those might be the wrong ones on a multi x-screen setup.

-> Restore screentohead mapping after testing procedure.

-> Add support for fast AMD multi-display sync before test as syncmethod 1.
-> Move old broken driftsync to syncmethod 2 and warn about its brokeness.
-> Cleanup help texts and plotting code.
Screen/PsychImaging: Add support for ~11 bpc framebuffers.

Add final setup code to Screen and PsychImaging for requesting
11 bpc framebuffers, and to provide 11 bpc framebuffers on AMD
cards under Linux and OSX, if the OS doesn't support these
natively.

Cleanup the 10/11 bpc framebuffer handling code and hopefully
make status messages for user more streamlined.

Cleanup/Update the PsychImaging help texts with what we
learned so far in our HDMI deep color adventures.

Add 11 bpc option to our two standard high bit depth demos
AdditiveBlending... and BitsPlusCSFDemo.

-> Actual mex files will go to separate commits, to keep this
   mergeable to the 3.0.11 release if we should decide to do this.

-> New code not yet tested on actual hardware.