From: David Gow Date: Wed, 21 May 2014 04:59:31 +0000 (+0800) Subject: Merging to make sure I have the latest papers.bib X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fdocuments.git;a=commitdiff_plain;h=23f34189ab55d3d0e5dc725a573164da3592afa6 Merging to make sure I have the latest papers.bib --- diff --git a/LitReviewDavid.pdf b/LitReviewDavid.pdf index 1e0bb5e..85a6698 100644 Binary files a/LitReviewDavid.pdf and b/LitReviewDavid.pdf differ diff --git a/LitReviewDavid.tex b/LitReviewDavid.tex index a8947e8..31f4968 100644 --- a/LitReviewDavid.tex +++ b/LitReviewDavid.tex @@ -34,12 +34,33 @@ the content of the document to be explored in ways that perhaps the author had n 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. +\subsection{A Taxonomy of Document formats} -Different document formats approach these stages in different ways. Some treat the document as a program, written in -a turing complete document language with instructions which emit shapes to be displayed. These shapes are either displayed +The process of creating and displaying a document is a rather universal one (\ref{documenttimeline}), though +different document formats approach it slightly differently. A document often begins as raw content: text and images +(be they raster or vector) and it must end up as a set of photons flying towards the reader's eyes. + +\begin{figure} + \label{documenttimeline} + \centering \includegraphics[width=0.8\linewidth]{figures/documenttimeline} + \caption{The lifecycle of a document} +\end{figure} + +There are two fundamental stages by which all documents --- digital or otherwise --- are produced and displayed: +\emph{layout} and \emph{rendering}. The \emph{layout} stage is where the positions and sizes of text and other graphics are +determined. The text will be \emph{flowed} around graphics, the positions of individual glyphs will be placed, ensuring +that there is no undesired overlap and that everything will fit on the page or screen. + +The \emph{display} stage actually produces the final output, whether as ink on paper or pixels on a computer monitor. +Each graphical element is rasterized and composited into a single image of the target resolution. + + +Different document formats cover documents in different stages of this project. Bitmapped images, +for example, would represent the output of the final stage of the process, whereas markup languages typically specify +a document which has not yet been processed, ready for the layout stage. + +Furthermore, some document formats treat the document as a program, written in +a (usually turing complete) document language with instructions which emit shapes to be displayed. These shapes are either displayed immediately, as in PostScript, or stored in another file, such as with \TeX or \LaTeX, which emit a \texttt{DVI} file. Most other forms of document use a \emph{Document Object Model}, being a list or tree of objects to be rendered. \texttt{DVI}, \texttt{PDF}, \texttt{HTML}\footnote{Some of these formats --- most notably \texttt{HTML} --- implement a scripting lanugage such as JavaScript, @@ -47,6 +68,31 @@ which permit the DOM to be modified while the document is being viewed.} and SVG store documents in pre-layout stages, whereas even turing complete document formats such as PostScript typically encode documents which already have their elements placed. +\begin{description} + \item[\TeX \, and \LaTeX] + Donald Knuth's typesetting language \TeX \, is one of the older computer typesetting systems, originally conceived in 1977\cite{texdraft}. + It implements a turing-complete language and is human-readable and writable, and is still popular + due to its excellent support for typesetting mathematics. + \TeX only implements the ``layout'' stage of document display, and produces a typeset file, + traditionally in \texttt{DVI} format, though modern implementations will often target \texttt{PDF} instead. + + This document was prepared in \LaTeXe. + + \item[\texttt{DVI}] + \TeX \, traditionally outputs to the \texttt{DVI} format: a binary format which consists of a + simple stack machine with instructions for drawing glyphs and curves\cite{fuchs1982theformat}. + + A \texttt{DVI} file is a representation of a document which has been typeset, and \texttt{DVI} + viewers will rasterize this for display or printing, or convert it to another similar format like PostScript + to be rasterized. + + \item[\texttt{HTML}] + + +\end{description} + + + 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 @@ -70,7 +116,7 @@ never entirely successful, and sharp edges, such as those found in text and diag 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''. +arcs and ``B\'ezier curves''\cite{catmull1974asubdivision}. 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. @@ -102,9 +148,9 @@ renderer by nVidia\cite{kilgard2012gpu} as an OpenGL extension\cite{kilgard300pr 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, +between $0$ and $2^{64} - 1$, inclusive\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$}. +represent integers in the range $[-(2^{63}), 2^{63} - 1]$}. By introducing a fractional component (analogous to a decimal point), we can convert integers to \emph{fixed-point} numbers, which have a more limited range, but a fixed, greater @@ -153,14 +199,22 @@ These types are typically built from several native data types such as integers paired with custom routines implementing arithmetic primitives.\cite{priest1991algorithms} These, therefore, are likely slower than the native types they are built on. - While traditionally, GPUs have supported some approximation of IEEE 754's 32-bit floats, modern graphics processors also support 16-bit\cite{nv_half_float} and 64-bit\cite{arb_gpu_shader_fp64} -IEEE floats. +IEEE floats. Note, however, that some parts of the GPU are only able to use some formats, +so precision will likely be truncated at some point before display. Higher precision numeric types can be implemented or used on the GPU, but are -slow. -\cite{emmart2010high} +slow.\cite{emmart2010high} +Pairs of integers $(a \in \mathbb{Z},b \in \mathbb{Z}\setminus 0)$ can be used to represent rationals. This allows +values such as $\frac{1}{3}$ to be represented exactly, whereas in fixed or floating-point formats, +this would have a recurring representation: +\begin{equation} + \underbrace{0}_\text{integer part} . \underbrace{01}_\text{recurring part} 01 \; \; 01 \; \; 01 \dots +\end{equation} +Whereas with a rational type, this is simply $\frac{1}{3}$. +Rationals do not have a unique representation for each value, typically the reduced fraction is used +as a characteristic element. \section{Quadtrees} diff --git a/figures/documenttimeline.pdf b/figures/documenttimeline.pdf new file mode 100644 index 0000000..7277997 Binary files /dev/null and b/figures/documenttimeline.pdf differ diff --git a/papers.bib b/papers.bib index 06b6f48..d7a96a7 100644 --- a/papers.bib +++ b/papers.bib @@ -16,6 +16,23 @@ year={2006} } +@misc{texdraft, + title={Preliminary preliminary description of {\TeX}}, + author={Knuth, Donald}, + year={1977}, + howpublished={\url{http://www.saildart.org/TEXDR.AFT[1,DEK]1}} +} + +@article{fuchs1982theformat, + title={The Format of {\TeX}'s {DVI} files}, + author={Fuchs, David}, + year={1982}, + journal={TUGBoat}, + volume={3}, + number={2}, + howpublished={\url{http://www.tug.org/TUGboat/Articles/tb03-2/tb06software.pdf}} +} + %%%%%%%%%%%%%%%%%%%%%%%% % Basic Rendering Theory %%%%%%%%%%%%%%%%%%%%%%%% @@ -72,6 +89,16 @@ publisher={ACM} } +% Bézier curves and friends. +@phdthesis{catmull1974asubdivision, + author = {Catmull, Edwin Earl}, + title = {A Subdivision Algorithm for Computer Display of Curved Surfaces.}, + year = {1974}, + note = {AAI7504786}, + publisher = {The University of Utah}, +} + + %%%%%%%%%%%%%%%%%%%%%%% % Floating-pt Precision %%%%%%%%%%%%%%%%%%%%%%% diff --git a/references/fuchs1982theformat.pdf b/references/fuchs1982theformat.pdf new file mode 100644 index 0000000..f635937 Binary files /dev/null and b/references/fuchs1982theformat.pdf differ