This is a static copy of a profile reportHome
intline (404 calls, 0.080 sec)
Generated 05-Nov-2014 07:53:20 using cpu time.
function in file /usr1/opt/matlab/7.13/toolbox/images/imuitools/+iptui/intline.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
47 | x = flipud(x); | 202 | 0.020 s | 25.0% |  |
46 | if (flip) | 404 | 0.010 s | 12.5% |  |
38 | t = y1; y1 = y2; y2 = t; | 202 | 0.010 s | 12.5% |  |
32 | x = (x1:x2).'; | 202 | 0.010 s | 12.5% |  |
17 | if ((dx == 0) && (dy =... | 404 | 0.010 s | 12.5% |  |
All other lines | | | 0.020 s | 25.0% |  |
Totals | | | 0.080 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
flipud | function | 404 | 0 s | 0% |  |
Self time (built-ins, overhead, etc.) | | | 0.080 s | 100.0% |  |
Totals | | | 0.080 s | 100% | |
Code Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 49 |
Non-code lines (comments, blank lines) | 18 |
Code lines (lines that can run) | 31 |
Code lines that did run | 23 |
Code lines that did not run | 8 |
Coverage (did run/can run) | 74.19 % |
Function listing
time calls line
1 function [x,y] = intline(x1, x2, y1, y2)
2 %INTLINE Integer-coordinate line drawing algorithm.
3 % [X, Y] = INTLINE(X1, X2, Y1, Y2) computes an
4 % approximation to the line segment joining (X1, Y1) and
5 % (X2, Y2) with integer coordinates. X1, X2, Y1, and Y2
6 % should be integers. INTLINE is reversible; that is,
7 % INTLINE(X1, X2, Y1, Y2) produces the same results as
8 % FLIPUD(INTLINE(X2, X1, Y2, Y1)).
9
10 % Copyright 1993-2008 The MathWorks, Inc.
11 % $Revision: 1.1.6.1 $ $Date: 2008/05/12 21:27:23 $
12
404 13 dx = abs(x2 - x1);
404 14 dy = abs(y2 - y1);
15
16 % Check for degenerate case.
0.01 404 17 if ((dx == 0) && (dy == 0))
18 x = x1;
19 y = y1;
20 return;
21 end
22
404 23 flip = 0;
404 24 if (dx >= dy)
202 25 if (x1 > x2)
26 % Always "draw" from left to right.
27 t = x1; x1 = x2; x2 = t;
28 t = y1; y1 = y2; y2 = t;
29 flip = 1;
30 end
202 31 m = (y2 - y1)/(x2 - x1);
0.01 202 32 x = (x1:x2).';
202 33 y = round(y1 + m*(x - x1));
202 34 else
202 35 if (y1 > y2)
36 % Always "draw" from bottom to top.
202 37 t = x1; x1 = x2; x2 = t;
0.01 202 38 t = y1; y1 = y2; y2 = t;
202 39 flip = 1;
202 40 end
202 41 m = (x2 - x1)/(y2 - y1);
202 42 y = (y1:y2).';
202 43 x = round(x1 + m*(y - y1));
202 44 end
45
0.01 404 46 if (flip)
0.02 202 47 x = flipud(x);
202 48 y = flipud(y);
202 49 end