imwrite>validateSizes (3 calls, 0.010 sec)
Generated 14-Nov-2016 07:47:22 using cpu time.
subfunction in file /usr/local/MATLAB/MATLAB_Production_Server/R2015a/toolbox/matlab/imagesci/imwrite.m
Copy to new window for comparing multiple runs
Function Name | Function Type | Calls |
imwrite | function | 3 |
Line Number | Code | Calls | Total Time | % Time | Time Plot |
607 | elementSize = 1; | 3 | 0.010 s | 100.0% | ![]() |
630 | elseif ((numel(data) * element... | 3 | 0 s | 0% | ![]() |
626 | if (any(size(data) > max32)... | 3 | 0 s | 0% | ![]() |
624 | max32 = double(intmax('uint32'... | 3 | 0 s | 0% | ![]() |
605 | case {'uint8', 'int8', 'logica... | 3 | 0 s | 0% | ![]() |
All other lines | 0 s | 0% | ![]() | ||
Totals | 0.010 s | 100% |
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
intmax | function | 3 | 0 s | 0% | ![]() |
Self time (built-ins, overhead, etc.) | 0.010 s | 100.0% | ![]() | ||
Totals | 0.010 s | 100% |
Line number | Message |
Total lines in function | 34 |
Non-code lines (comments, blank lines) | 18 |
Code lines (lines that can run) | 16 |
Code lines that did run | 6 |
Code lines that did not run | 10 |
Coverage (did run/can run) | 37.50 % |
time | calls | line | |
---|---|---|---|
601 | function validateSizes(data) | ||
602 | |||
603 | % How many bytes does each element occupy in memory? | ||
3 | 604 | switch (class(data)) | |
3 | 605 | case {'uint8', 'int8', 'logical'} | |
606 | |||
0.01 | 3 | 607 | elementSize = 1; |
608 | |||
609 | case {'uint16', 'int16'} | ||
610 | |||
611 | elementSize = 2; | ||
612 | |||
613 | case {'uint32', 'int32', 'single'} | ||
614 | |||
615 | elementSize = 4; | ||
616 | |||
617 | case {'uint64', 'int64', 'double'} | ||
618 | |||
619 | elementSize = 8; | ||
620 | |||
621 | end | ||
622 | |||
623 | % Validate that the dataset/image will fit within 32-bit offsets. | ||
3 | 624 | max32 = double(intmax('uint32')); | |
625 | |||
3 | 626 | if (any(size(data) > max32)) | |
627 | |||
628 | error(message('MATLAB:imagesci:imwrite:sideTooLong')) | ||
629 | |||
3 | 630 | elseif ((numel(data) * elementSize) > max32) | |
631 | |||
632 | error(message('MATLAB:imagesci:imwrite:tooMuchData')) | ||
633 | |||
634 | end |
Other subfunctions in this file are not included in this listing.