Line number | Message |
325 | 'addParamValue' is not recommended. Use 'addParameter' instead. |
326 | 'addParamValue' is not recommended. Use 'addParameter' instead. |
327 | 'addParamValue' is not recommended. Use 'addParameter' instead. |
328 | 'addParamValue' is not recommended. Use 'addParameter' instead. |
329 | 'addParamValue' is not recommended. Use 'addParameter' instead. |
330 | 'addParamValue' is not recommended. Use 'addParameter' instead. |
331 | 'addParamValue' is not recommended. Use 'addParameter' instead. |
332 | 'addParamValue' is not recommended. Use 'addParameter' instead. |
333 | 'addParamValue' is not recommended. Use 'addParameter' instead. |
334 | 'addParamValue' is not recommended. Use 'addParameter' instead. |
335 | 'addParamValue' is not recommended. Use 'addParameter' instead. |
336 | 'addParamValue' is not recommended. Use 'addParameter' instead. |
337 | 'addParamValue' is not recommended. Use 'addParameter' instead. |
338 | 'addParamValue' is not recommended. Use 'addParameter' instead. |
339 | 'addParamValue' is not recommended. Use 'addParameter' instead. |
340 | 'addParamValue' is not recommended. Use 'addParameter' instead. |
341 | 'addParamValue' is not recommended. Use 'addParameter' instead. |
342 | 'addParamValue' is not recommended. Use 'addParameter' instead. |
343 | 'addParamValue' is not recommended. Use 'addParameter' instead. |
344 | 'addParamValue' is not recommended. Use 'addParameter' instead. |
345 | 'addParamValue' is not recommended. Use 'addParameter' instead. |
346 | 'addParamValue' is not recommended. Use 'addParameter' instead. |
time | calls | line |
---|
| | 287 | function [results, unmatched] = parseInputs(data,map,filename,varargin)
|
| | 288 |
|
| | 289 | % Validate required arguments
|
| 3 | 290 | validateattributes(data,{'double','single','logical','uint8','uint16'},{'nonempty'});
|
| 3 | 291 | if isempty(map)
|
| 3 | 292 | validateattributes(map,{'double'},{});
|
| | 293 | else
|
| | 294 | validateattributes(map,{'double'},{'2d','ncols',3,'>=',0,'<=',1});
|
| | 295 | end
|
| 3 | 296 | validateattributes(filename,{'char'},{'row','nonempty'});
|
| | 297 |
|
| 3 | 298 | propStrings = {'interlacetype', 'imagemodtime', ...
|
| | 299 | 'transparency', 'bitdepth', 'significantbits', 'alpha', ...
|
| | 300 | 'background', 'gamma', 'xresolution', 'chromaticities', ...
|
| | 301 | 'yresolution', 'title', 'author', 'resolutionunit', ...
|
| | 302 | 'description', 'source', 'software', 'creationtime', ...
|
| | 303 | 'disclaimer', 'warning', 'copyright', 'comment' };
|
| | 304 |
|
| | 305 | % Process varargin into a form that we can use with the input parser.
|
| 3 | 306 | for k = 1:2:length(varargin)
|
| 15 | 307 | prop = lower(varargin{k});
|
| 15 | 308 | if (~ischar(prop))
|
| | 309 | error(message('MATLAB:imagesci:writepng:parameterNotString'));
|
| | 310 | end
|
| | 311 |
|
| 15 | 312 | idx = find(strncmp(prop, propStrings, numel(prop)));
|
| 15 | 313 | if (length(idx) > 1)
|
| | 314 | error(message('MATLAB:imagesci:validate:ambiguousParameterName', prop));
|
| 15 | 315 | elseif isscalar(idx)
|
| 15 | 316 | varargin{k} = propStrings{idx};
|
| 15 | 317 | end
|
| 15 | 318 | end
|
| | 319 |
|
| | 320 | % Define the parser
|
| 3 | 321 | p = inputParser;
|
| 3 | 322 | p.KeepUnmatched = true;
|
| | 323 |
|
| | 324 | % Add PV pairs to the input parser
|
| 3 | 325 | p.addParamValue('bitdepth',[], @(x)validateattributes(x,{'double'},{'scalar'}));
|
| 3 | 326 | p.addParamValue('significantbits',[],@(x)validateattributes(x,{'double'},{'nonempty','>=',1}));
|
| 3 | 327 | p.addParamValue('transparency',[], @(x)validateattributes(x,{'double'},{'>=',0,'<=',1}));
|
| 3 | 328 | p.addParamValue('alpha',[], @(x)validateattributes(x,{'double','uint8','uint16'},{'size',[size(data,1) size(data,2)]}));
|
| 3 | 329 | p.addParamValue('background',[], @(x)validateattributes(x,{'char','double'},{'row','nonempty'}));
|
| 3 | 330 | p.addParamValue('gamma',[], @(x)validateattributes(x,{'double'},{'scalar','>=',0}));
|
| 3 | 331 | p.addParamValue('chromaticities',[], @(x)validateattributes(x,{'double'},{'row','numel',8,'>=',0,'<=',1}));
|
| 3 | 332 | p.addParamValue('xresolution',[], @(x)validateattributes(x,{'double'},{'scalar'}));
|
| 3 | 333 | p.addParamValue('yresolution',[], @(x)validateattributes(x,{'double'},{'scalar'}));
|
| 3 | 334 | p.addParamValue('title',[], @(x)validateattributes(x,{'char'},{'nonempty'}));
|
0.01 | 3 | 335 | p.addParamValue('author',[], @(x)validateattributes(x,{'char'},{'nonempty'}));
|
| 3 | 336 | p.addParamValue('description',[], @(x)validateattributes(x,{'char'},{'nonempty'}));
|
| 3 | 337 | p.addParamValue('copyright',[], @(x)validateattributes(x,{'char'},{'nonempty'}));
|
| 3 | 338 | p.addParamValue('software',[], @(x)validateattributes(x,{'char'},{'nonempty'}));
|
| 3 | 339 | p.addParamValue('disclaimer',[], @(x)validateattributes(x,{'char'},{'nonempty'}));
|
| 3 | 340 | p.addParamValue('warning',[], @(x)validateattributes(x,{'char'},{'nonempty'}));
|
| 3 | 341 | p.addParamValue('source',[], @(x)validateattributes(x,{'char'},{'nonempty'}));
|
| 3 | 342 | p.addParamValue('comment',[], @(x)validateattributes(x,{'char'},{'nonempty'}));
|
| 3 | 343 | p.addParamValue('creationtime',[], @(x)validateattributes(x,{'char','double'},{'nonempty'}));
|
| 3 | 344 | p.addParamValue('imagemodtime',[], @(x)validateattributes(x,{'char','double'},{'nonempty'}));
|
| 3 | 345 | p.addParamValue('interlacetype','none', @(x) validateattributes(x,{'char'},{'row'}));
|
| 3 | 346 | p.addParamValue('resolutionunit',[], @(x)validateattributes(x,{'char'},{'nonempty'}));
|
| | 347 |
|
| | 348 | % Parse remaining arguments and return results and unmatched
|
0.01 | 3 | 349 | p.parse(varargin{:});
|
| 3 | 350 | results = p.Results;
|
| 3 | 351 | unmatched = p.Unmatched;
|
Other subfunctions in this file are not included in this listing.