File: SettingsToSensorAcc.m

package info (click to toggle)
psychtoolbox-3 3.0.19.14.dfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 86,796 kB
  • sloc: ansic: 176,245; cpp: 20,103; objc: 5,393; sh: 2,753; python: 1,397; php: 384; makefile: 193; java: 113
file content (32 lines) | stat: -rw-r--r-- 1,209 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
function [sensor,primaryE] = SettingsToSensorAcc(cal,settings)
% [sensor,primaryE] = SettingsToSensorAcc(cal,settings)
%
% Convert from device setting coordinates to
% sensor color space coordinates.  Uses full
% basis function measurements in doing
% conversions so that it can compensate for
% device primary spectral shifts.

% 11/12/93  dhb   Wrote it.
% 11/15/93  dhb   Added deviceE output.
% 8/4/96    dhb   Update for stuff bag routines.
% 8/21/97	dhb	  Update for structures.
% 3/10/98   dhb	  Change nBasesOut to nPrimaryBases.
% 4/5/02    dhb, ly  Update for new calling interface.
% 11/22/09  dhb   Check basis dimension and do the simple fast thing if it is 1.
%                 This will speed things up when there is no point in trying the
%                 fancier algorithm.

nPrimaryBases = cal.nPrimaryBases;
if (isempty(nPrimaryBases))
    error('No nPrimaryBases field present in calibration structure');
end

if (nPrimaryBases == 1)
    sensor = SettingsToSensor(cal,settings);
    primaryE = [];
else
    settingsE = ExpandSettings(settings,nPrimaryBases);
    primaryE = SettingsToPrimary(cal,settingsE);
    sensor = PrimaryToSensor(cal,primaryE);
end