Drafted into submission
[ipdf/sam.git] / chapters / Results.tex
index 1d4d939..1d9df1a 100644 (file)
@@ -1,19 +1,14 @@
-\chapter{Results and Discussion}
-
-{\bf Note: Need to be more consistent, I often refer to B\'{e}ziers and Objects interchangably (since the original design was based around an Object and B\'{e}zier was just one possible Object, but we have moved on to pretty much only caring about B\'{e}ziers now)}
+\chapter{Results and Discussion}\label{Results and Discussion}
 
 \section{Qualitative Rendering Accuracy}
        
 Our ultimate goal is to be able to insert detail at an arbitrary point in the document. Therefore, we are interested in how the same test SVG would appear when scaled to the view coordinates, as the view coordinates are varied. 
 
 
-\subsection{Applying the view transformation directly}
+\subsection{Applying the view transformation directly}\label{direct_transform}
 
 Figure \ref{qualitative-rendering-fox} shows the rendering of a vector image\footnote{Unfortunately, since a rendered vector image is a raster image and this figure must be scaled to fit the PDF, the figure as seen here is not a pixel perfect representation of the actual rendering. Most notably, antialiasing effects will be apparent}. Transformation \eqref{view-transformation} is applied to object coordinates with default IEEE-754 rounding behaviour (to nearest). The loss of precision in the second figure is obvious. This is because division by $10^{-6}$ increases the rounding error in $x - v_x$, by $10^{6}$, so the total error is of the order $10^6$ ulp which is of the order $0.25$
 
-{\bf TODO: Calculate that properly, shouldn't be hard}
-
-
 
 \begin{figure}[H]
        \centering
@@ -22,7 +17,7 @@ Figure \ref{qualitative-rendering-fox} shows the rendering of a vector image\foo
        \caption{The vector image from Figure \ref{vector-vs-raster} under two different scales}\label{qualitative-rendering-fox}
 \end{figure}
 
-\subsection{Applying cumulative transformations to all B\'{e}ziers}
+\subsection{Applying cumulative transformations to all B\'{e}ziers}\label{cumulative_transform}
 
 Rather than applying \eqref{view-transformation} to object coordinates specified relative to the document, we can store the bounds of objects relative to the view and modify these bounds according to transformations \eqref{} and \eqref{} as the view is changed. This is convenient for an interactive document, as detail is typically added by inserting objects into the document within the view rectangle. As a result this approach makes the rendering of detail added to the document independent of the view coordinates --- until the view is moved.
 
@@ -42,11 +37,11 @@ Repeated transformations on the view will cause an accumulated error on the coor
        \caption{The effect of applying cumulative transformations to all B\'{e}ziers}\label{qualitative-rendering-fox-cumulative}
 \end{figure}
 
-\subsection{Applying cumulative transformations to Paths}
+\subsection{Applying cumulative transformations to Paths}\label{path_transform}
 
 In Figure \ref{qualitative-rendering-fox}, transformations are applied to the bounds of each B\'{e}zier. Figure \ref{qualitative-rendering-fox-cumulative-relative} a) shows the effect of introducing an intermediate coordinate system expressing B\'{e}zier coordinates relative to the path which contains them. In this case, the rendering of a single path is accurate, but the overall positions of the paths drift as the view is moved. 
 
-We can correct this drift whilst maintaining performance by using an arbitrary or high precision number representation to express the coordinates of the paths - but maintaining the floating point coordinates for B\'{e}zier curves relative to their path. As we will discuss in Section \ref{}, this offers an acceptable trade off between rendering accuracy and performance.
+We can correct this drift whilst maintaining performance by using an arbitrary or high precision number representation to express the coordinates of the paths - but maintaining the floating point coordinates for B\'{e}zier curves relative to their path. This is shown in Figure \ref{qualitative-rendering-fox-cumulative-relative} b).
 
 \begin{figure}[H]
        \centering
@@ -54,6 +49,10 @@ We can correct this drift whilst maintaining performance by using an arbitrary o
        \includegraphics[width=800px]{figures/fox-vector_cumulative_relative_to_path_GMPrat.png}
        \caption{Effect of cumulative transformations applied to Paths\\a) Path bounds represented using floats b) Path bounds represented using Rationals}\label{qualitative-rendering-fox-cumulative-relative}
 \end{figure}
+
+Videos showing the effects discussed in Section \ref{direct_transform}, \ref{cumulative_transform} and \ref{path_transform} can be found at:
+
+ \url{http://szmoore.net/ipdf/sam/presentation}.
        
 \section{Quantitative Measurements of Rendering Accuracy}
        
@@ -75,25 +74,13 @@ An error of 1 ulp is increased by a factor of $10^6$ to end up comparable to the
 \end{figure}
 
 
-\subsection{Names of programs in figures}
-\begin{itemize}
-       \item single - Single precision IEEE-754 with \eqref{view-transformation} applied directly
-       \item double - Double precision IEEE-754 with \eqref{view-transformation} applied directly
-       \item cumul-single - Single precision IEEE-754 with cumulative transforms to B\'{e}ziers
-       \item cumul-double - Double precision IEEE-754 with cumulative transforms to B\'{e}ziers
-       \item path-single -  Single precision IEEE-754 with cumulative transforms to Paths
-       \item path-double -  Single precision IEEE-754 with cumulative transforms to Paths
-       \item path-rat - GNU MP Rationals with cumulative transforms to Paths
-\end{itemize}
-
 \subsection{Precision for Fixed View}
 
 
 By counting the number of distinctly representable lines within a particular view, we can show the degradation of precision quantitatively. The test grid is added to each view rectangle.
 
 
-Figure \ref{loss_of_precision_grid_0.5.pdf} shows how precision degrades with $(v_x, v_y) = (0.5,0.5)$.
-A constant line at $1401$ grid locations indicates no loss of precision.
+Figure \ref{loss_of_precision_grid_0.5.pdf} shows how precision degrades with $(V_x, V_y) = (0.5,0.5)$ for different precision settings using MPFR floating point values to represent the view coordinates. A constant line at $1401$ grid locations indicates no loss of precision. From this figure it is clear that 
 
 
 \begin{figure}[H]
@@ -116,11 +103,22 @@ Figure \ref{cumulative_error_grid.pdf} shows the total error in the coordinates
 
 By considering Figure \ref{loss_of_precision_grid_0.5.pdf} and \ref{cumulative_error_grid.pdf}, \verb/path-rat/ is the winner.
        
-\section{Performance Measurements whilst Rendering}
+\section{Performance Measurements}
        
 As discussed above, we succeeded in preserving rendering accuracy as defined above for an arbitrary view.
-However this comes at a performance cost, as the size of the number representation must grow accordingly.
+However this comes at a performance cost, as the size of the Rational number representation must grow accordingly. Figures \ref{memory.pdf} and \ref{time.pdf} were obtained by repeatedly clearing the document, scaling, and adding a fixed number of B\'{e}zier curves. The \texttt{mpfr-1024} number representation performs much better in terms of memory usage and performance; however as discussed in Section \ref{}, due to the fixed precision it cannot represent detail seperated by a truly arbitrary distance.
 
-{\bf TODO: Insert performance measurements here}
+\begin{figure}[H]
+       \centering
+       \includegraphics[width=0.7\textwidth]{figures/memory.pdf}
+       \label{memory.pdf}
+       \caption{Memory used per Path coordinate whilst zooming in}
+\end{figure}
+
+\begin{figure}[H]
+       \centering
+       \includegraphics[width=0.7\textwidth]{figures/time.pdf}
+       \label{time.pdf}
+       \caption{Time taken to scale about the fixed point}
+\end{figure}
 
-{\bf TODO: Also, would be nice to show a graph (log scale) where something goes past $10^{\pm320}$ (absolute limit for doubles, previous figures are all within range of representable floats}

UCC git Repository :: git.ucc.asn.au