This is a static copy of a profile report

Home

graphics/private/checkImageSizeForPrint (3 calls, 0.010 sec)
Generated 14-Nov-2016 07:47:22 using cpu time.
function in file /usr/local/MATLAB/MATLAB_Production_Server/R2015a/toolbox/matlab/graphics/private/checkImageSizeForPrint.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
...ePrintPath>LocalGenerateFileOutputsubfunction3
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
22
max32 = double(intmax('uint32'...
30.010 s100.0%
32
end
30 s0%
29
elseif ((expectedWidth * expec...
30 s0%
27
if expectedWidth > max32 ||...
30 s0%
18
expectedHeight = height*scaleF...
30 s0%
All other lines  0 s0%
Totals  0.010 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
intmaxfunction30.010 s100.0%
Self time (built-ins, overhead, etc.)  0 s0%
Totals  0.010 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function32
Non-code lines (comments, blank lines)21
Code lines (lines that can run)11
Code lines that did run8
Code lines that did not run3
Coverage (did run/can run)72.73 %
Function listing
time 
calls 
 line
   1 
function tooBig = checkImageSizeForPrint(dpi, screenDPI, 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 The MathWorks, Inc.
  14 

      3 
  15 
    tooBig = false; 
      3 
  16 
    scaleFactor = dpi/screenDPI; 
      3 
  17 
    expectedWidth = width*scaleFactor; 
      3 
  18 
    expectedHeight = height*scaleFactor; 
  19 

  20 
    % Like imwrite, validate that the dataset/image will fit within 32-bit
  21 
    % offsets.
  0.01 
      3 
  22 
    max32 = double(intmax('uint32')); 
  23 

  24 
    % If one of the dimensions is larger than max32, or if the number of
  25 
    % elements in the data (width*height*3 for RGB data) is larger than
  26 
    % max32, then we won't be able to write this image out using imwrite.
      3 
  27 
    if expectedWidth > max32 || expectedHeight > max32 
  28 
        tooBig = true;
      3 
  29 
    elseif ((expectedWidth * expectedHeight * 3) > max32) 
  30 
        tooBig = true;
  31 
    end
      3 
  32 
end