Add some NIE examples

This commit is contained in:
Nigel Tao committed 2019-02-09 08:00:05 +11:00
1 parent 536d7f94e1
commit 463079dd50
5 files changed
+48 -1

No files matched your search

+45 -1
View File
@@ -34,6 +34,18 @@ The payload:
bytes are \[B₀, B₁, G₀, G₁, R₀, R₁, A₀, A₁\]. The ₀ and ₁ subscripts denote
the low and high bytes of the `uint16`.
That's it.
### Example NIE File
This still image is 3 pixels wide and 2 pixels high. It is a crude
approximation to the French flag, being three columns: blue, white and red.
00000000: 6ec3 af45 ff62 6e34 0300 0000 0200 0000 n..E.bn4........
00000010: ff00 00ff ffff ffff 0000 ffff ff00 00ff ................
00000020: ffff ffff 0000 ffff ........
## NII: Animated Images, Timing Index Only, Out-of-Band Frames
@@ -129,6 +141,19 @@ CDD value. Animations lasting longer than `((1<<63)-1)` flicks, more than 400
years, are not representable in the NII format.
### Example NII File
This animated image is 3 pixels wide and 2 pixels high. It consists of 20
frames, being 10 loops of 2 frames. The total animation time of a single loop
is 3 seconds, so the 10 loops will take 30 seconds. The first frame is shown
for 1 second. The next frame is shown for (3 - 1) seconds (i.e., 2 seconds).
The actual pixel data per frame is stored elsewhere.
00000000: 6ec3 af49 ffff ffff 0300 0000 0200 0000 n..I............
00000010: 0a00 0000 0200 0000 ff31 d481 ffff ffff .........1......
00000020: 009a 0e2a 0000 0000 ff31 d481 ffff ffff ...*.....1......
## NIA: Animated Images, In-band Frames
NIA is like an NII file where the per-frame still images are NIE files
@@ -153,6 +178,25 @@ The payload is a sequence of 0 or more frames. Each frame is:
- 8 bytes little-endian int64 TValue, the same meaning and constraints as NII.
### Example NIA File
This animated image is 3 pixels wide and 2 pixels high. It consists of 20
frames, being 10 loops of 2 frames. The total animation time of a single loop
is 3 seconds, so the 10 loops will take 30 seconds. The first frame is a crude
approximation to the French flag (blue, white and red) and is shown for 1
second. The next frame is a crude approximation to the Italian flag (green,
white and red) and is shown for (3 - 1) seconds (i.e., 2 seconds).
00000000: 6ec3 af41 ff62 6e34 0300 0000 0200 0000 n..A.bn4........
00000010: 0a00 0000 0200 0000 ff31 d481 ffff ffff .........1......
00000020: 6ec3 af45 ff62 6e34 0300 0000 0200 0000 n..E.bn4........
00000030: ff00 00ff ffff ffff 0000 ffff ff00 00ff ................
00000040: ffff ffff 0000 ffff 009a 0e2a 0000 0000 ...........*....
00000050: 6ec3 af45 ff62 6e34 0300 0000 0200 0000 n..E.bn4........
00000060: 00ff 00ff ffff ffff 0000 ffff 00ff 00ff ................
00000070: ffff ffff 0000 ffff ff31 d481 ffff ffff .........1......
# Commentary
@@ -391,4 +435,4 @@ security vulnerabilities.
---
Updated on December 2018.
Updated on February 2019.
+3
View File
@@ -28,6 +28,9 @@ animated-red-blue.gif is an original animation by Nigel Tao
bricks-\* are various encodings of an original photo by Nigel Tao
<nigeltao@golang.org>.
crude-flag.\* is an original animation by Nigel Tao
<nigeltao@golang.org>. See the `lib/nie` documentation.
gifplayer-muybridge.gif is an original animation by Nigel Tao
<nigeltao@golang.org>.
Binary file not shown.
Binary file not shown.
Binary file not shown.