This is a static copy of a profile report

Home

printing/private/checkImageSizeForPrint (Calls: 10, Time: 0.001 s)
Generated 16-Jul-2020 17:09:36 using performance time.
function in file /Applications/MATLAB_R2020a.app/toolbox/matlab/graphics/printing/private/checkImageSizeForPrint.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
printing/private/printingGenerateOutputfunction10
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
20
maxInt32 = double(intmax('int3...
100.000 s49.3%
36
end
100.000 s0.9%
33
elseif ((expectedWidth * expec...
100.000 s0.3%
31
if expectedWidth > maxInt32...
100.000 s0.2%
15
tooBig = false;
100.000 s0.2%
All other lines  0.000 s49.0%
Totals  0.001 s100% 
Children (called functions)
No children
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function36
Non-code lines (comments, blank lines)26
Code lines (lines that can run)10
Code lines that did run8
Code lines that did not run2
Coverage (did run/can run)80.00 %
Function listing
time 
Calls 
 line
   1 
function tooBig = checkImageSizeForPrint(dpi, ~, width, height)
   2 
    % CHECKIMAGESIZEFORPRINT Checks to see if the image that will be
   3 
    % produced in the print path is within certain bounds. This
   4 
    % undocumented helper function is for internal use.
   5 

   6 
    % This function is called during the print path.  See usage in
   7 
    % alternatePrintPath.m
   8 
    
   9 
    % Predict how big the image data will be based on the requested
  10 
    % resolution and image size.  Returns true if the image size is greater
  11 
    % than the limit in imwrite.
  12 
    
  13 
    % Copyright 2013-2017 The MathWorks, Inc.
  14 

< 0.001 
     10 
  15
    tooBig = false; 
  16 
        
< 0.001 
     10 
  17
    expectedWidth = width*dpi; 
< 0.001 
     10 
  18
    expectedHeight = height*dpi; 
  19 

< 0.001 
     10 
  20
    maxInt32 = double(intmax('int32')); 
  21 
    
  22 
    % If one of the dimensions is larger than maxInt32, or if the number of
  23 
    % elements in the data (width*height*4 for RGBA data) is larger than
  24 
    % maxInt32, then we won't be able to write outvfput through
  25 
    % HGRasterOutputHelper->generateOutput (NIO buffer size limitation)
  26 
    % It's better to exit early g1363602
  27 
    %
  28 
    % This case also cover imwrite() limitation as it allowed maximum
  29 
    % buffer size of unsigned int 32-bit RGB data.
  30 
    
< 0.001 
     10 
  31
    if expectedWidth > maxInt32 || expectedHeight > maxInt32 
  32 
         tooBig = true;
< 0.001 
     10 
  33
    elseif ((expectedWidth * expectedHeight * 4) > maxInt32) 
  34 
         tooBig = true;
< 0.001 
     10 
  35
    end 
< 0.001 
     10 
  36
end 

Other subfunctions in this file are not included in this listing.