summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkshay <[email protected]>2022-08-20 17:38:50 +0100
committerAkshay <[email protected]>2022-08-20 17:38:50 +0100
commit62550a9dc5ec519553f58440c272690201440f48 (patch)
tree644f6aff744b82b181aec2035d40267fbcc40c11
parent8cfa801eb41861f36308a572a2e14053c00c73ea (diff)
add allHEADmaster
-rw-r--r--flake.nix4
-rw-r--r--meta.sty20
-rw-r--r--presentation.tex467
3 files changed, 440 insertions, 51 deletions
diff --git a/flake.nix b/flake.nix
index 74ca45f..b9a0f9e 100644
--- a/flake.nix
+++ b/flake.nix
@@ -9,7 +9,7 @@
9 let 9 let
10 supportedSystems = [ "x86_64-linux" "x86_64-darwin" ]; 10 supportedSystems = [ "x86_64-linux" "x86_64-darwin" ];
11 forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system); 11 forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
12 pname = "report"; 12 pname = "presentation";
13 version = "0.1.0"; 13 version = "0.1.0";
14 14
15 nixpkgsFor = forAllSystems (system: 15 nixpkgsFor = forAllSystems (system:
@@ -31,7 +31,7 @@
31 -pvc \ 31 -pvc \
32 -outdir="$out" \ 32 -outdir="$out" \
33 -pdf \ 33 -pdf \
34 -pdflatex="pdflatex -interaction=nonstopmode" \ 34 -pdflatex="xelatex -interaction=nonstopmode" \
35 -use-make ${pname}.tex 35 -use-make ${pname}.tex
36 rm -r "$out" 36 rm -r "$out"
37 ''; 37 '';
diff --git a/meta.sty b/meta.sty
deleted file mode 100644
index 961eb5f..0000000
--- a/meta.sty
+++ /dev/null
@@ -1,20 +0,0 @@
1\newcommand{\doctitle}{Presentation Title}
2\newcommand{\ponename}{Akshay Oppiliappan}
3\newcommand{\poneusn}{1RV18CS016}
4\newcommand{\ptwoname}{Akshay Oppiliappan}
5\newcommand{\ptwousn}{1RV18CS016}
6
7\newcommand{\semester}{X\textsuperscript{th}}
8
9\newcommand{\shortdept}{CSE}
10\newcommand{\dept}{Computer Science}
11\newcommand{\longdept}{Computer Science and Engineering}
12
13\newcommand{\faculty}{Faculty Name}
14\newcommand{\facultypost}{Faculty Post}
15\newcommand{\facultydept}{Computer Science and Engineering}
16\newcommand{\hod}{Dr.Ramakanth Kumar P}
17\newcommand{\principal}{Dr. Subramanya. K. N}
18\newcommand{\coursecode}{18XXXX}
19\newcommand{\csubject}{Subject Name}
20\newcommand{\acyear}{20XX -- XX}
diff --git a/presentation.tex b/presentation.tex
index 328a2dd..f9b7dbd 100644
--- a/presentation.tex
+++ b/presentation.tex
@@ -1,47 +1,456 @@
1\documentclass{beamer} 1\documentclass{beamer}
2 2
3\usepackage[utf8]{inputenc} 3\usepackage[utf8]{inputenc}
4\usepackage{meta} 4\usepackage{graphicx}
5\usepackage{hyperref}
6\usepackage{multirow}
7\usepackage{amssymb}
8\usepackage{amsmath}
9\usepackage{fontspec}
5 10
11\renewcommand{\thefootnote}{\fnsymbol{footnote}}
12
13\usefonttheme{professionalfonts}
6\usefonttheme{serif} 14\usefonttheme{serif}
7\title{\doctitle} 15\setmainfont{garamond-regular.ttf}[
8\author{\ponename{} (\poneusn)} 16 BoldFont = garamond-bold.ttf,
9\institute[R V College of Engineering] 17 ItalicFont = garamond-italic.ttf,
10{ 18]
11 Submitted To: \faculty{}\\ 19
12 \facultypost{} 20\setbeamertemplate{caption}{\insertcaption}
13 \facultydept{}
14 \and
15 Self Study Assignment
16}
17 21
18\setbeamerfont{author}{size=\fontsize{10}{10}\normalfont} 22\title{Rust in Arts}
23\author{Akshay Oppiliappan}
24\date{}
25
26\setbeamerfont{author}{size=\fontsize{10}{10}\rmfamily}
19\setbeamerfont{institute}{size=\fontsize{10}{10}\itshape} 27\setbeamerfont{institute}{size=\fontsize{10}{10}\itshape}
20\setbeamerfont{title}{size=\fontsize{25}{25}\bfseries} 28\setbeamerfont{title}{size=\fontsize{25}{25}\bfseries}
21\setbeamerfont{subtitle}{size=\Large\normalfont\slshape} 29\setbeamerfont{subtitle}{size=\Large\normalfont\slshape}
22\setbeamerfont{minititle}{size=\fontsize{7}{7}\normalfont\bfseries} 30\setbeamerfont{minititle}{size=\fontsize{7}{7}\normalfont\bfseries}
31\setbeamerfont{caption}{size=\scriptsize}
23 32
24\setbeamertemplate{title page}{% 33\definecolor{LionRed}{rgb}{0.565, 0.130, 0.305}
25 \usebeamerfont{title}\usebeamercolor[fg]{title}\inserttitle\\ 34\usecolortheme[named=LionRed]{structure}
26 \usebeamerfont{subtitle}\usebeamercolor[fg]{institute}\csubject{} --- \coursecode{}\\
27 \vspace{2cm}
28 \usebeamerfont{minititle}\usebeamercolor[fg]{normal text}SUBMITTED BY:\\
29 \usebeamerfont{author}\usebeamercolor[fg]{author}\ponename{} (\poneusn{})\\
30 \usebeamerfont{author}\usebeamercolor[fg]{author}\ptwoname{} (\ptwousn{})\\
31
32 \vspace{1cm}
33 \usebeamerfont{minititle}\usebeamercolor[fg]{normal text}SUBMITTED TO:\\
34 \usebeamerfont{author}\usebeamercolor[fg]{author}\faculty{}\\
35 \usebeamerfont{author}\usebeamercolor[fg]{author}\facultypost{}\\
36 \usebeamerfont{author}\usebeamercolor[fg]{author}\facultydept{}\\
37}
38 35
39\begin{document} 36\setbeamertemplate{itemize items}[ball]
40 37
41\frame{\titlepage} 38\begin{document}
42 39
43\begin{frame} 40\begin{frame}
44 \frametitle{Outline} 41 \begin{figure}[h]
42 \includegraphics[scale=0.3,trim={0 3cm 0 0},clip]{assets/ferris}
43 \end{figure}
44 \titlepage
45\end{frame}
46
47\begin{frame}{\textbf{Colors and Computers}}
48 \begin{block}{}
49 \begin{columns}
50 \column{0.5\textwidth}
51
52 \begin{itemize}
53 \item Images $\rightarrow$ Pixels
54 \item Pixels $\rightarrow$ Color
55 \item Color $\rightarrow$ RGB (or) CMYK
56 \item R $\rightarrow$ ???, G $\rightarrow$ ???, B $\rightarrow$ ???
57 \end{itemize}
58
59 \column{0.5\textwidth}
60 \begin{figure}[h]
61 \includegraphics[scale=0.30,trim={0 0 0 1cm},clip]{assets/locus}
62 \label{fig:locus}
63 \caption{\textit{``Locus''}, Akshay, 2021}
64 \end{figure}
65
66 \end{columns}
67 \end{block}
68\end{frame}
69
70\begin{frame}{\textbf{Colors and Computers}}
71 \begin{block}{}
72 \begin{columns}
73 \column{0.6\textwidth}
74
75 \begin{itemize}
76 \item R $\rightarrow$ 0--255, G $\rightarrow$ 0--255, B $\rightarrow$ 0--255
77 \item 8-bits/component, 24-bits/pixel
78 \item Bit depth: bits per pixel
79 \end{itemize}
80 \column{0.4\textwidth}
81 \begin{figure}[h]
82 \includegraphics[scale=0.30,trim={0 0 0 1cm},clip]{assets/the_sect}
83 \label{fig:the_sect}
84 \caption{\textit{``The Sect''}, Akshay, 2021}
85 \end{figure}
86
87 \end{columns}
88 \end{block}
89\end{frame}
90
91\begin{frame}{\textbf{Colors and Computers}}
92 \begin{block}{}
93
94 \begin{columns}
95 \column{0.35\textwidth}
96
97 \begin{itemize}
98 \item 1-bit/pixel
99 \item 0, 1
100 \item on, off
101 \item black, white
102 \item ...
103 \end{itemize}
104
105 \column{0.65\textwidth}
106 \begin{figure}[h]
107 \includegraphics[scale=0.40,trim={0 2cm 0 1cm},clip]{assets/self}
108 \label{fig:self}
109 \caption{\textit{``Ceci n'est pas une self-reference''}, Akshay, 2021}
110 \end{figure}
111
112 \end{columns}
113 \end{block}
114\end{frame}
115
116\begin{frame}{\textbf{File Formats}}
117 \begin{block}{}
118
119 \begin{columns}
120 \column{0.65\textwidth}
121 \begin{itemize}
122 \item Byte-arrays
123 \item Structured, for applications to read quickly
124 \item PNG file format: \texttt{IHDR}, \texttt{IDAT}, \texttt{IEND}
125 \end{itemize}
126
127 \column{0.35\textwidth}
128 \begin{figure}[h]
129 \includegraphics[scale=0.25,trim={10cm 9cm 6cm 9cm},clip]{assets/ramen_noodles}
130 \label{fig:ramen}
131 \caption{\textit{``Ramen Noodles''}, Akshay, 2021}
132 \end{figure}
133
134 \end{columns}
135 \end{block}
136 \begin{block}{}
137 \end{block}
138\end{frame}
139
140\begin{frame}{\textbf{File Formats}}
141 \begin{block}{}
142 \begin{center}
143 \begin{figure}[h]
144 \begin{tabular}{ r r r r | c c c c | r }
145 \hline
146 0 & 0 & 0 & 0 & \multicolumn{4}{|c|}{\multirow{2}{*}{Image Header}} & \multirow{2}{*}{\texttt{0x05}} \\
147 0 & 1 & 0 & 1 & & & & & \\ \hline \hline
148 0 & 0 & 0 & 0 & \square & \square & \square & \square & \multirow{5}{*}{\texttt{0x06 0x9F 0x87}} \\
149 0 & 1 & 1 & 0 & \square & \blacksquare & \blacksquare & \square \\
150 1 & 0 & 0 & 1 & \blacksquare & \square & \square & \blacksquare \\
151 1 & 1 & 1 & 1 & \blacksquare & \blacksquare & \blacksquare & \blacksquare \\
152 1 & 0 & 0 & 0 & \blacksquare & \square & \square & \square \\
153 0 & 1 & 1 & 1 & \square & \blacksquare & \blacksquare & \blacksquare \\ \hline \hline
154 0 & 0 & 0 & 0 & \multicolumn{4}{|c|}{\multirow{2}{*}{Image Trailer}} & \multirow{2}{*}{\texttt{0x00}} \\
155 0 & 0 & 0 & 0 & & & & & \\
156 \hline
157 \end{tabular}
158 \caption{The internals of the \textit{One Bit Image (OBI)} format}
159 \end{figure}
160 \end{center}
161 \end{block}
162\end{frame}
163
164\begin{frame}[fragile]{\textbf{File Formats}}
165 \begin{block}{}
166 \begin{columns}
167 \column{0.65\textwidth}
168 \begin{itemize}
169 \item Implementation of the spec: \href{https://git.peppe.rs/graphics/obi/about}{git.peppe.rs/graphics/obi}
170 \item {
171 \begin{verbatim}
172let mut img =
173 Image::new(30, 50);
174img.set(2, 3, true)?;
175img.set(3, 2, true)?;
176 \end{verbatim}
177 }
178 \end{itemize}
179
180 \column{0.35\textwidth}
181 \begin{figure}[h]
182 \includegraphics[scale=0.50]{assets/code}
183 \label{fig:code}
184 \caption{\textit{``Staple''}, Akshay, 2022}
185 \end{figure}
186
187 \end{columns}
188 \end{block}
189\end{frame}
190
191\begin{frame}{\textbf{Making Pixel Art}}
192 \begin{block}{}
193 \begin{itemize}
194 \item SDL: Simple DirectMedia Layer is a cross-platform software development library designed to provide a hardware abstraction layer for computer multimedia hardware components
195 \item SDL: draw stuff to the screen, handle mouse/keyboard events
196 \end{itemize}
197 \end{block}
198\end{frame}
199
200\begin{frame}{\textbf{Making Pixel Art}}
201 \begin{figure}[h]
202 \includegraphics[scale=0.40]{assets/mvc}
203 \end{figure}
204\end{frame}
205
206\begin{frame}{\textbf{Making Pixel Art}}
207 \begin{block}{}
208 \begin{columns}
209 \column{0.6\textwidth}
210 \begin{itemize}
211 \item Model: \\
212 \texttt{zoom: u32}
213 \item View: \\
214 Zoomed image
215 \item Controller: \\
216 \texttt{|zoom| zoom + 1}
217 \end{itemize}
218
219 \column{0.4\textwidth}
220 \begin{figure}[h]
221 \includegraphics[scale=0.30]{assets/ivory_tower}
222 \label{fig:code}
223 \caption{\textit{``Ivory Tower''}, Akshay, 2022}
224 \end{figure}
225
226 \end{columns}
227 \end{block}
228\end{frame}
229
230\begin{frame}{\textbf{Making Pixel Art}}
231 \begin{block}{}
232 \begin{itemize}
233 \item Model: Needs to be mutated, be static
234 \item Possible structure: \texttt{static mut STATE: AppState}
235 \item Possible structure: \texttt{Lazy<RwLock<AppState>>}
236 \end{itemize}
237 \end{block}
238\end{frame}
239
240\begin{frame}[fragile]{\textbf{Making Pixel Art}}
241 \begin{verbatim}
242 fn main() -> Result<()> {
243 let mut app = AppState::new();
244 app.main()?;
245 Ok(())
246 }
247
248 impl AppState {
249 fn undo(&mut self) { ... }
250 fn zoom(&mut self) { ... }
251 fn draw(&mut self) { ... }
252 ...
253 fn main(&mut self) { ... }
254 }
255 \end{verbatim}
256\end{frame}
257
258\begin{frame}{\textbf{Ctrl-Z}}
259 \begin{block}{}
260 \begin{columns}
261 \column{0.65\textwidth}
262 \begin{itemize}
263 \item Mission critical
264 \item Tricky data-structure to get right
265 \item Drawing the process can help!
266 \end{itemize}
267
268 \column{0.35\textwidth}
269 \begin{figure}[h]
270 \includegraphics[scale=0.3,trim={1cm 2cm 0 4cm},clip]{assets/ember}
271 \label{fig:ember}
272 \caption{\textit{``Ember''}, Akshay, 2022}
273 \end{figure}
274
275 \end{columns}
276 \end{block}
277\end{frame}
278
279\begin{frame}{\textbf{Ctrl-Z}}
280 \begin{figure}[h]
281 \includegraphics[scale=0.35]{assets/undo}
282 \end{figure}
283\end{frame}
284
285\begin{frame}[fragile]{\textbf{Ctrl-Z}}
286 \begin{itemize}
287 \item Operations form an undo tree
288 \item Redos are overwritten by new operations
289 \item Simplified to a cursor over a timeline (two stacks!)
290 \item {
291 \begin{verbatim}
292struct UndoStack<T> {
293 sacred_timeline: Vec<T>,
294 now: Option<u32>,
295}
296 \end{verbatim}
297 }
298 \end{itemize}
299\end{frame}
300
301\begin{frame}[fragile]{\textbf{Ctrl-Z}}
302 \begin{block}{}
303 \begin{columns}
304 \begin{column}{0.5\textwidth}{\textbf{Tests}}
305
306 \begin{verbatim}
307let ops: UndoStack<u32> =
308 UndoStack::new();
309ops.push(1u32);
310ops.push(2u32);
311ops.push(3u32);
312
313ops.undo();
314
315assert_eq!(ops, [1, 2]);
316 \end{verbatim}
317 \end{column}
318
319 \vrule{}
320
321 \begin{column}{0.5\textwidth}{\textbf{Binary}}
322 \begin{verbatim}
323
324
325struct AppState {
326 ...
327 ops: UndoStack<PaintRec>,
328 ...
329}
330
331
332 \end{verbatim}
333 \end{column}
334
335 \end{columns}
336 \end{block}
337\end{frame}
338
339\begin{frame}[fragile]{\textbf{Ctrl-Z}}
340 \begin{block}{}
341 \begin{columns}
342 \begin{column}{0.5\textwidth}{\textbf{Tests}}
343 \begin{verbatim}
344struct UndoStackU32 {
345 sacred_timeline:
346 Vec<u32>,
347 now: Option<u32>
348}
349
350let ops: UndoStackU32 =
351 UndoStackU32::new();
352
353...
354
355 \end{verbatim}
356 \end{column}
357
358 \vrule{}
359
360 \begin{column}{0.5\textwidth}{\textbf{Binary}}
361 \begin{verbatim}
362struct UndoStackPaintRec {
363 sacred_timeline:
364 Vec<PaintRec>,
365 now: Option<u32>
366}
367
368struct AppState {
369 ...
370 ops: UndoStackPaintRec,
371 ...
372}
373 \end{verbatim}
374 \end{column}
375
376 \end{columns}
377 \end{block}
378\end{frame}
379
380\begin{frame}{\textbf{Dithering}}
381 \begin{block}{}
382 \begin{columns}
383 \begin{column}{0.5\textwidth}
384 \begin{itemize}
385 \item Stuck with black and white
386 \item Diffuse to produce shades
387 \item Ordered dithering
388 \end{itemize}
389 \end{column}
390
391 \begin{column}{0.5\textwidth}
392 \begin{figure}[h]
393 \includegraphics[scale=0.30]{assets/b8}
394 \label{fig:b8}
395 \caption{\textit{``B8''}, Akshay, 2022}
396 \end{figure}
397 \end{column}
398
399 \end{columns}
400 \end{block}
401\end{frame}
402
403\begin{frame}{\textbf{Dithering}}
404 \begin{block}{}
405 \begin{center}
406 \includegraphics[scale=0.30]{assets/memory}
407 \label{fig:memory}
408 \\
409 \caption{\textit{``Scenes from a Memory''}, Akshay, 2022}
410 \end{center}
411 \end{block}
412\end{frame}
413
414\begin{frame}{\textbf{Dithering}}
415 \begin{block}{}
416 \begin{center}
417 \includegraphics[scale=0.75,trim={11cm 5cm 5cm 9cm},clip]{assets/memory}
418 \label{fig:memory}
419 \\
420 \caption{A closer look at \textit{``Scenes from a Memory''}}
421 \end{center}
422 \end{block}
423\end{frame}
424
425\begin{frame}{\textbf{Sixteen Shades}}
426 \begin{block}{}
427 \begin{center}
428 \includegraphics[scale=0.6]{assets/bayer}
429 \label{fig:bayers}
430 \\
431 \caption{Bayers' matrices}
432 \end{center}
433 \end{block}
434\end{frame}
435
436\begin{frame}{\textbf{Sixteen Shades}}
437 \begin{block}{}
438 \begin{center}
439 \includegraphics[scale=0.6]{assets/rylander}
440 \label{fig:rylander}
441 \\
442 \caption{Rylanders' matrices}
443 \end{center}
444 \end{block}
445\end{frame}
446
447\begin{frame}{\textbf{Warm Regards}}
448 \begin{itemize}
449 \item Akshay Oppiliappan, Language Engineer (Rust), DeepSource
450 \item E-mail: \texttt{[email protected]}
451 \item Made with \LaTeX~and beamer
452 \item Slides: \url{https://u.peppe.rs/ria.pdf}
453 \end{itemize}
45\end{frame} 454\end{frame}
46 455
47\end{document} 456\end{document}