\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\usepackage{graphicx}

%opening
\title{Literature Review}
\author{David Gow}

\begin{document}

\maketitle

\section{Introduction}

Since mankind first climbed down from the trees, it is our ability to communicate that has made us unique.
Once ideas could be passed from person to person, it made sense to have a permanent record of them; one which
could be passed on from person to person without them ever meeting.

And thus the document was born.

Traditionally, documents have been static: just marks on paper, but with the advent of computers many more possibilities open up.

\section{Document Formats}

Most existing document formats --- such as the venerable PostScript and PDF --- are, however, designed to imitate
existing paper documents, largely to allow for easy printing. In order to truly take advantage of the possibilities operating in the digital
domain opens up to us, we must look to new formats.

Formats such as \texttt{HTML} allow for a greater scope of interactivity and for a more data-driven model, allowing
the content of the document to be explored in ways that perhaps the author had not anticipated.\cite{hayes2012pixels}
However, these data-driven formats typically do not support fixed layouts, and the display differs from renderer to
renderer.

Ultimately, there are two fundamental stages by which all documents --- digital or otherwise --- are produced and displayed:
\emph{layout} and \emph{display}. The \emph{layout} stage is where the positions and sizes of text and other graphics are
determined, while the \emph{display} stage actually produces the final output, whether as ink on paper or pixels on a computer monitor.

Existing document formats, due to being designed to model paper,
have limited precision (8 decimal digits for PostScript\cite{plrm}, 5 decimal digits for PDF\cite{pdfref17}).
This matches the limited resolution of printers and ink, but is limited when compared to what aught to be possible
with ``zoom'' functionality, which is prevent from working beyond a limited scale factor, lest artefacts appear due
to issues with numeric precision.

\section{Rendering}

Computer graphics comes in two forms: bit-mapped (or raster) graphics, which is defined by an array of pixel colours, 
and \emph{vector} graphics, defined by mathematical descriptions of objects. Bit-mapped graphics are well suited to photographs
and are match how cameras, printers and monitors work. However, bitmap devices do not handle zooming beyond their
``native'' resolution --- the resolution where one document pixel maps to one display pixel ---, exhibiting an artefact
called pixelation where the pixel structure becomes evident. Attempts to use interpolation to hide this effect are
never entirely successful, and sharp edges, such as those found in text and diagrams, are particularly effected.

Vector graphics lack many of these problems: the representation is independent of the output resolution, and rather
an abstract description of what it is being rendered, typically as a combination of simple geometric shapes like lines,
arcs and ``B\'ezier curves''. 
As existing displays (and printers) are bit-mapped devices, vector documents must be \emph{rasterized} into a bitmap at
a given resolution. This bitmap is then displayed or printed. The resulting bitmap is then an approximation of the vector image
at that resolution.

This project will be based around vector graphics, as these properties make it more suited to experimenting with zoom
quality.


The rasterization process typically operates on an individual ``object'' or ``shape'' at a time: there are special algorithms
for rendering lines\cite{bresenham1965algorithm}, triangles\cite{giesen2013triangle}, polygons\cite{pineda1988parallel} and B\'ezier
Curves\cite{goldman_thefractal}. Typically, these are rasterized independently and composited in the bitmap domain using Porter-Duff
compositing\cite{porter1984compositing} into a single image. This allows complex images to be formed from many simple pieces, as well
as allowing for layered translucent objects, which would otherwise require the solution of some very complex constructive geometry problems.

While traditionally, rasterization was done entirely in software, modern computers and mobile devices have hardware support for rasterizing
some basic primitives --- typically lines and triangles ---, designed for use rendering 3D scenes. This hardware is usually programmed with an
API like \texttt{OpenGL}\cite{openglspec}.

More complex shapes like B\'ezier curves can be rendered by combining the use of bitmapped textures (possibly using signed-distance
fields\cite{leymarie1992fast}\cite{frisken2000adaptively}\cite{green2007improved}) with polygons approximating the curve's shape\cite{loop2005resolution}\cite{loop2007rendering}.

Indeed, there are several implementations of entire vector graphics systems using OpenGL: OpenVG\cite{robart2009openvg} on top of OpenGL ES\cite{oh2007implementation};
the Cairo\cite{worth2003xr} library, based around the PostScript/PDF rendering model, has the ``Glitz'' OpenGL backend\cite{nilsson2004glitz} and the SVG/PostScript GPU
renderer by nVidia\cite{kilgard2012gpu} as an OpenGL extension\cite{kilgard300programming}.


\section{Floating-Point Precision}

On modern computer architectures, there are two basic number formats supported:
fixed-width integers and \emph{floating-point} numbers. Typically, computers
natively support integers of up to 64 bits, capable of representing all integers
between $0$ and $2^{64} - 1$\footnote{Most machines also support \emph{signed} integers,
which have the same cardinality as their \emph{unsigned} counterparts, but which
represent integers between $-(2^{63})$ and $2^{63} - 1$}.

Floating-point numbers\cite{goldberg1991whatevery} are the binary equivalent of scientific notation:
each number consisting of an exponent ($e$) and a mantissa ($m$) such that a number is given by
\begin{equation}
	n = 2^{e} \times m
\end{equation}

The IEEE 754 standard\cite{ieee754std1985} defines several floating-point data types
which are used\footnote{Many systems' implement the IEEE 754 standard's storage formats,
but do not implement arithmetic operations in accordance with this standard.} by most
computer systems. The standard defines 32-bit (8-bit exponent, 23-bit mantissa) and 
64-bit (11-bit exponent, 53-bit mantissa) formats\footnote{The 2008
revision to this standard\cite{ieee754std2008} adds some additional formats, but is
less widely supported in hardware.} 

How floating-point works and what its behaviour is w/r/t range and precision
\cite{goldberg1991whatevery}
\cite{goldberg1992thedesign}

Arb. precision exists

Higher precision numeric types can be implemented or used on the GPU, but are
slow.
\cite{emmart2010high}



\section{Quadtrees}
When viewing or processing a small part of a large document, it may be helpful to
only processs --- or \emph{cull} --- parts of the document which are not on-screen.

\begin{figure}[h]
	\centering \includegraphics[width=0.4\linewidth]{figures/quadtree_example}
	\caption{A simple quadtree.}
\end{figure}
The quadtree\cite{finkel1974quad}is a data structure --- one of a family of \emph{spatial}
data structures --- which recursively breaks down space into smaller subregions
which can be processed independently. Points (or other objects) are added to a single
node, which if certain criteria are met --- typically the number of points in a node
exceeding a maximum, though in our case likely the level of precision required exceeding
that supported by the data type in use --- is split into four equal-sized subregions, and
points attached to the region which contains them.

In this project, we will be experimenting with a form of quadtree in which each
node has its own independent coordinate system, allowing us to store some spatial
information\footnote{One bit per-coordinate, per-level of the quadtree} within the
quadtree structure, eliminating redundancy in the coordinates of nearby objects.

Other spatial data structures exist, such as the KD-tree\cite{bentley1975multidimensional},
which partitions the space on any axis-aligned line; or the BSP tree\cite{fuchs1980onvisible},
which splits along an arbitrary line which need not be axis aligned. We believe, however,
that the simpler conversion from binary coordinates to the quadtree's binary split make
it a better avenue for initial research to explore.

\bibliographystyle{unsrt}
\bibliography{papers}

\end{document}
