home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / p / ppm2fli < prev    next >
ArcFS Archive  |  1997-06-29  |  64.8 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: ArcFS Archive (archive/arcFS).

You can browse this item here: ppm2fli

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert ArcFS Archive (archive/arcFS) magic Supported
100% file RISC OS archive (ArcFS format) default
99% file data default
100% TrID Acorn ArcFS Archive default
100% gt2 Kopftext: 'Archive' default (weak)
100% detectItEasy Archive: ArcFS default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 41 72 63 68 69 76 65 00 | 44 01 00 00 54 03 00 00 |Archive.|D...T...|
|00000010| 28 00 00 00 64 00 00 00 | 00 00 00 00 00 00 00 00 |(...d...|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000060| 82 21 53 65 74 50 61 74 | 68 73 00 00 82 00 00 00 |.!SetPat|hs......|
|00000070| 46 eb ff ff dd 37 15 fc | 03 00 fc 73 82 00 00 00 |F....7..|...s....|
|00000080| 24 00 00 00 82 44 6f 63 | 73 00 00 00 00 00 00 00 |$....Doc|s.......|
|00000090| ff ff ff ff 47 ff ff ff | 3e a5 c4 a1 03 00 00 00 |....G...|>.......|
|000000a0| ff ff ff ff d8 00 00 80 | 83 70 70 6d 32 66 6c 69 |........|.ppm2fli|
|000000b0| 00 20 61 6c 12 79 00 00 | 46 ff ff ff 89 ed ac fd |. al.y..|F.......|
|000000c0| 03 00 00 00 11 78 00 00 | ca 00 00 00 83 52 49 53 |.....x..|.....RIS|
|000000d0| 43 2d 4f 53 00 20 61 6c | 75 11 00 00 46 ff ff ff |C-OS. al|u...F...|
|000000e0| e0 da 10 ff 03 00 26 25 | 48 11 00 00 ff 78 00 00 |......&%|H....x..|
|000000f0| 83 75 6e 66 6c 69 63 6b | 00 20 61 6c 07 0f 00 00 |.unflick|. al....|
|00000100| 46 ff ff ff 73 e4 be fe | 03 00 32 3d f0 0e 00 00 |F...s...|..2=....|
|00000110| 6b 8a 00 00 00 6d 65 74 | 69 6d 65 73 20 20 61 6c |k....met|imes al|
|00000120| 73 6f 20 63 61 6c 6c 65 | 64 20 27 41 63 72 6f 62 |so calle|d 'Acrob|
|00000130| 61 74 27 20 12 66 6c 65 | 83 70 70 6d 32 66 6c 69 |at' .fle|.ppm2fli|
|00000140| 00 00 00 00 ef 4e 00 00 | 46 f8 ff ff ac 32 b6 fe |.....N..|F....2..|
|00000150| 03 00 00 00 f3 4c 00 00 | 7f 99 00 00 83 75 6e 66 |.....L..|.....unf|
|00000160| 6c 69 63 6b 00 00 00 00 | 4f 1b 00 00 46 f8 ff ff |lick....|O...F...|
|00000170| e5 2d 0d ff 03 00 8c b0 | 62 19 00 00 96 e6 00 00 |.-......|b.......|
|00000180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000200| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000210| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000220| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000230| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000260| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000270| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000280| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000290| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000300| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000310| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000320| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000330| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000340| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000350| 00 00 00 00 46 69 6c 65 | 44 61 74 61 82 21 53 65 |....File|Data.!Se|
|00000360| 74 50 61 74 68 73 00 00 | 82 00 00 00 46 eb ff ff |tPaths..|....F...|
|00000370| dd 37 15 fc 03 00 fc 73 | 7c 20 4f 62 65 79 20 66 |.7.....s|| Obey f|
|00000380| 69 6c 65 20 74 6f 20 73 | 65 74 20 75 70 20 70 61 |ile to s|et up pa|
|00000390| 74 68 73 20 66 6f 72 20 | 70 70 6d 32 66 6c 69 0a |ths for |ppm2fli.|
|000003a0| 0a 69 66 20 22 3c 70 70 | 6d 32 66 6c 69 24 53 65 |.if "<pp|m2fli$Se|
|000003b0| 65 6e 3e 22 20 3d 20 22 | 22 20 74 68 65 6e 20 73 |en>" = "|" then s|
|000003c0| 65 74 20 52 75 6e 24 50 | 61 74 68 20 3c 52 75 6e |et Run$P|ath <Run|
|000003d0| 24 50 61 74 68 3e 2c 3c | 4f 62 65 79 24 44 69 72 |$Path>,<|Obey$Dir|
|000003e0| 3e 2e 0a 73 65 74 20 70 | 70 6d 32 66 6c 69 24 53 |>..set p|pm2fli$S|
|000003f0| 65 65 6e 20 22 59 65 73 | 22 0a 46 69 6c 65 44 61 |een "Yes|".FileDa|
|00000400| 74 61 83 70 70 6d 32 66 | 6c 69 00 20 61 6c 12 79 |ta.ppm2f|li. al.y|
|00000410| 00 00 47 fd ff ff 52 a5 | c4 a1 03 00 00 00 70 70 |..G...R.|......pp|
|00000420| 6d 32 66 6c 69 20 2d 20 | 63 72 65 61 74 65 20 61 |m2fli - |create a|
|00000430| 20 46 4c 49 20 61 6e 69 | 6d 61 74 69 6f 6e 20 66 | FLI ani|mation f|
|00000440| 72 6f 6d 20 61 20 73 65 | 74 20 6f 66 20 73 74 61 |rom a se|t of sta|
|00000450| 74 69 63 20 69 6d 61 67 | 65 73 0a 0a 53 79 6e 6f |tic imag|es..Syno|
|00000460| 70 73 69 73 0a 2d 90 08 | 0a 70 70 6d 32 66 6c 69 |psis.-..|.ppm2fli|
|00000470| 20 3c 6f 70 74 69 6f 6e | 73 3e 20 3c 6c 69 73 74 | <option|s> <list|
|00000480| 2d 66 69 6c 65 3e 20 3c | 61 6e 69 6d 61 74 69 6f |-file> <|animatio|
|00000490| 6e 2d 66 69 6c 65 3e 0a | 0a 20 20 54 68 65 20 70 |n-file>.|. The p|
|000004a0| 72 6f 67 72 61 6d 20 70 | 70 6d 32 66 6c 69 20 67 |rogram p|pm2fli g|
|000004b0| 65 6e 65 72 61 74 65 73 | 20 61 20 46 4c 49 2f 46 |enerates| a FLI/F|
|000004c0| 4c 43 2d 61 6e 69 6d 61 | 74 69 6f 6e 20 66 72 6f |LC-anima|tion fro|
|000004d0| 6d 20 61 20 73 65 72 69 | 65 73 20 6f 66 20 69 6d |m a seri|es of im|
|000004e0| 61 67 65 73 2e 0a 20 20 | 0a 20 20 54 68 65 20 66 |ages.. |. The f|
|000004f0| 69 6c 65 20 3c 6c 69 73 | 74 2d 66 69 6c 65 3e 20 |ile <lis|t-file> |
|00000500| 63 6f 6e 74 61 69 6e 73 | 20 61 20 6c 69 73 74 20 |contains| a list |
|00000510| 6f 66 20 74 68 65 20 6e | 61 6d 65 73 20 6f 66 20 |of the n|ames of |
|00000520| 69 6d 61 67 65 20 66 69 | 6c 65 73 2c 20 6f 6e 65 |image fi|les, one|
|00000530| 20 70 65 72 0a 6c 69 6e | 65 20 73 65 70 61 72 61 | per.lin|e separa|
|00000540| 74 65 64 20 62 79 20 74 | 68 65 20 6e 65 77 2d 6c |ted by t|he new-l|
|00000550| 69 6e 65 20 63 68 61 72 | 61 63 74 65 72 2e 20 54 |ine char|acter. T|
|00000560| 68 65 73 65 20 69 6d 61 | 67 65 73 20 61 72 65 20 |hese ima|ges are |
|00000570| 6d 65 72 67 65 64 20 74 | 6f 67 65 74 68 65 72 20 |merged t|ogether |
|00000580| 69 6e 0a 74 68 65 20 73 | 75 70 70 6c 69 65 64 20 |in.the s|upplied |
|00000590| 6f 72 64 65 72 2e 20 54 | 68 65 20 67 65 6e 65 72 |order. T|he gener|
|000005a0| 61 74 65 64 20 61 6e 69 | 6d 61 74 69 6f 6e 20 69 |ated ani|mation i|
|000005b0| 73 20 77 72 69 74 74 65 | 6e 20 74 6f 20 3c 61 6e |s writte|n to <an|
|000005c0| 69 6d 61 74 69 6f 6e 2d | 66 69 6c 65 3e 2e 0a 0a |imation-|file>...|
|000005d0| 20 20 54 68 65 20 66 69 | 6c 65 20 66 6f 72 6d 61 | The fi|le forma|
|000005e0| 74 73 20 77 68 69 63 68 | 20 63 61 6e 20 62 65 20 |ts which| can be |
|000005f0| 72 65 61 64 20 64 69 72 | 65 63 74 6c 79 20 61 72 |read dir|ectly ar|
|00000600| 65 20 50 50 4d 2c 20 50 | 47 4d 20 61 6e 64 20 50 |e PPM, P|GM and P|
|00000610| 42 4d 20 28 61 73 63 69 | 69 20 61 6e 64 0a 72 61 |BM (asci|i and.ra|
|00000620| 77 3a 20 6d 61 67 69 63 | 20 27 50 31 27 20 74 6f |w: magic| 'P1' to|
|00000630| 20 27 50 36 27 29 20 61 | 73 20 77 65 6c 6c 20 61 | 'P6') a|s well a|
|00000640| 73 20 46 42 4d 20 28 6d | 61 70 70 65 64 20 38 62 |s FBM (m|apped 8b|
|00000650| 70 70 20 61 6e 64 20 72 | 67 62 20 32 34 62 70 70 |pp and r|gb 24bpp|
|00000660| 29 2e 20 50 70 6d 32 66 | 6c 69 0a 63 61 6e 20 69 |). Ppm2f|li.can i|
|00000670| 6e 76 6f 6b 65 20 65 78 | 74 65 72 6e 61 6c 20 66 |nvoke ex|ternal f|
|00000680| 69 6c 74 65 72 73 20 77 | 68 69 63 68 20 63 6f 6e |ilters w|hich con|
|00000690| 76 65 72 74 20 6f 74 68 | 65 72 20 66 69 6c 65 20 |vert oth|er file |
|000006a0| 66 6f 72 6d 61 74 73 20 | 74 6f 20 74 68 65 20 50 |formats |to the P|
|000006b0| 50 4d 20 6f 72 0a 46 42 | 4d 20 73 74 61 6e 64 61 |PM or.FB|M standa|
|000006c0| 72 64 2e 20 46 6f 72 20 | 65 78 61 6d 70 6c 65 20 |rd. For |example |
|000006d0| 73 75 63 68 20 66 69 6c | 74 65 72 73 20 61 72 65 |such fil|ters are|
|000006e0| 20 69 6e 63 6c 75 64 65 | 64 20 69 6e 20 74 68 65 | include|d in the|
|000006f0| 20 50 42 4d 50 4c 55 53 | 20 2c 4e 45 54 50 42 4d | PBMPLUS| ,NETPBM|
|00000700| 0a 61 6e 64 20 46 42 4d | 20 70 61 63 6b 61 67 65 |.and FBM| package|
|00000710| 73 2e 20 54 6f 67 65 74 | 68 65 72 20 77 69 74 68 |s. Toget|her with|
|00000720| 20 74 68 65 73 65 20 70 | 61 63 6b 61 67 65 73 20 | these p|ackages |
|00000730| 61 20 6c 61 72 67 65 20 | 6e 75 6d 62 65 72 20 6f |a large |number o|
|00000740| 66 20 67 72 61 70 68 69 | 63 0a 66 6f 72 6d 61 74 |f graphi|c.format|
|00000750| 73 20 63 61 6e 20 62 65 | 20 68 61 6e 64 6c 65 64 |s can be| handled|
|00000760| 2e 0a 20 20 54 68 65 20 | 67 65 6e 65 72 61 74 69 |.. The |generati|
|00000770| 6f 6e 20 6f 66 20 74 68 | 65 20 61 6e 69 6d 61 74 |on of th|e animat|
|00000780| 69 6f 6e 20 69 73 20 64 | 6f 6e 65 20 69 6e 20 74 |ion is d|one in t|
|00000790| 77 6f 20 73 65 70 61 72 | 61 74 65 20 73 74 65 70 |wo separ|ate step|
|000007a0| 73 3a 0a 0a 8f 20 43 6f | 6d 70 75 74 61 74 69 6f |s:... Co|mputatio|
|000007b0| 6e 20 6f 66 20 61 20 63 | 6f 6d 6d 6f 6e 20 63 6f |n of a c|ommon co|
|000007c0| 6c 6f 72 20 74 61 62 6c | 65 20 66 6f 72 20 61 6c |lor tabl|e for al|
|000007d0| 6c 20 69 6d 61 67 65 73 | 0a 0a 8f 20 51 75 61 6e |l images|... Quan|
|000007e0| 74 69 7a 61 74 69 6f 6e | 20 6f 66 20 74 68 65 20 |tization| of the |
|000007f0| 69 6d 61 67 65 73 20 61 | 6e 64 20 63 6f 6d 70 75 |images a|nd compu|
|00000800| 74 69 6e 67 20 74 68 65 | 20 46 4c 49 2f 46 4c 43 |ting the| FLI/FLC|
|00000810| 20 66 72 61 6d 65 73 0a | 0a 54 68 65 20 66 69 72 | frames.|.The fir|
|00000820| 73 74 20 73 74 65 70 20 | 69 73 20 64 6f 6e 65 20 |st step |is done |
|00000830| 62 79 20 73 63 61 6e 6e | 69 6e 67 20 61 6c 6c 20 |by scann|ing all |
|00000840| 69 6d 61 67 65 73 20 61 | 6e 64 20 75 73 69 6e 67 |images a|nd using|
|00000850| 20 61 20 6d 6f 64 69 66 | 69 65 64 20 76 65 72 73 | a modif|ied vers|
|00000860| 69 6f 6e 20 6f 66 0a 74 | 68 65 20 4f 63 74 72 65 |ion of.t|he Octre|
|00000870| 65 20 61 6c 67 6f 72 69 | 74 68 6d 20 74 6f 20 63 |e algori|thm to c|
|00000880| 6f 6d 70 75 74 65 20 61 | 20 63 6f 6c 6f 72 20 74 |ompute a| color t|
|00000890| 61 62 6c 65 20 66 72 6f | 6d 20 74 68 65 20 73 68 |able fro|m the sh|
|000008a0| 61 64 65 73 20 66 6f 75 | 6e 64 20 69 6e 20 74 68 |ades fou|nd in th|
|000008b0| 65 0a 69 6d 61 67 65 73 | 2e 20 54 68 69 73 20 63 |e.images|. This c|
|000008c0| 6f 6c 6f 72 20 74 61 62 | 6c 65 20 69 73 20 73 75 |olor tab|le is su|
|000008d0| 70 70 6f 73 65 64 20 74 | 6f 20 62 65 20 61 20 2d |pposed t|o be a -|
|000008e0| 2d 20 6d 6f 72 65 20 6f | 72 20 6c 65 73 73 20 2d |- more o|r less -|
|000008f0| 2d 20 62 65 73 74 20 66 | 69 74 20 74 6f 0a 74 68 |- best f|it to.th|
|00000900| 65 20 63 6f 6c 6f 72 20 | 73 68 61 64 65 73 20 77 |e color |shades w|
|00000910| 68 69 63 68 20 77 65 72 | 65 20 66 6f 75 6e 64 20 |hich wer|e found |
|00000920| 69 6e 20 74 68 65 20 69 | 6d 61 67 65 73 2e 0a 0a |in the i|mages...|
|00000930| 20 20 57 68 65 6e 20 74 | 68 65 20 69 6e 70 75 74 | When t|he input|
|00000940| 20 69 6d 61 67 65 73 20 | 61 72 65 20 61 6c 72 65 | images |are alre|
|00000950| 61 64 79 20 71 75 61 6e | 74 69 7a 65 64 20 74 68 |ady quan|tized th|
|00000960| 65 20 72 65 73 75 6c 74 | 20 64 65 70 65 6e 64 73 |e result| depends|
|00000970| 20 6f 6e 20 74 68 65 0a | 6e 75 6d 62 65 72 20 6f | on the.|number o|
|00000980| 66 20 63 6f 6c 6f 72 73 | 20 77 68 69 63 68 20 74 |f colors| which t|
|00000990| 68 65 79 20 75 73 65 20 | 61 6c 74 6f 67 65 74 68 |hey use |altogeth|
|000009a0| 65 72 2e 20 49 66 20 74 | 68 69 73 20 6e 75 6d 62 |er. If t|his numb|
|000009b0| 65 72 20 69 73 20 65 71 | 75 61 6c 20 6f 72 20 6c |er is eq|ual or l|
|000009c0| 65 73 73 0a 74 68 61 6e | 20 74 68 65 20 67 69 76 |ess.than| the giv|
|000009d0| 65 6e 20 6d 61 78 69 6d | 75 6d 20 28 64 65 66 61 |en maxim|um (defa|
|000009e0| 75 6c 74 3a 20 32 35 36 | 29 2c 20 74 68 65 20 73 |ult: 256|), the s|
|000009f0| 63 61 6e 6e 69 6e 67 20 | 73 74 65 70 20 6a 75 73 |canning |step jus|
|00000a00| 74 20 65 76 61 6c 75 61 | 74 65 73 20 74 68 65 73 |t evalua|tes thes|
|00000a10| 65 0a 63 6f 6c 6f 72 73 | 20 61 6e 64 20 61 73 73 |e.colors| and ass|
|00000a20| 65 6d 62 6c 65 73 20 74 | 68 65 20 63 6f 6c 6f 72 |embles t|he color|
|00000a30| 20 74 61 62 6c 65 20 77 | 69 74 68 6f 75 74 20 61 | table w|ithout a|
|00000a40| 6e 79 20 6d 6f 64 69 66 | 69 63 61 74 69 6f 6e 2e |ny modif|ication.|
|00000a50| 20 57 68 65 6e 20 74 68 | 65 20 69 6e 70 75 74 0a | When th|e input.|
|00000a60| 69 6d 61 67 65 73 20 63 | 6f 6e 74 61 69 6e 20 6d |images c|ontain m|
|00000a70| 6f 72 65 20 63 6f 6c 6f | 72 73 2c 20 73 6f 6d 65 |ore colo|rs, some|
|00000a80| 20 63 6f 6c 6f 72 73 20 | 61 72 65 20 70 75 74 20 | colors |are put |
|00000a90| 74 6f 67 65 74 68 65 72 | 20 61 6e 64 20 61 73 73 |together| and ass|
|00000aa0| 69 67 6e 65 64 20 74 6f | 20 61 6e 0a 61 76 65 72 |igned to| an.aver|
|00000ab0| 61 67 65 20 76 61 6c 75 | 65 2c 20 75 6e 74 69 6c |age valu|e, until|
|00000ac0| 20 74 68 65 20 74 6f 74 | 61 6c 20 6e 75 6d 62 65 | the tot|al numbe|
|00000ad0| 72 20 69 73 20 73 75 66 | 66 69 63 69 65 6e 74 6c |r is suf|ficientl|
|00000ae0| 79 20 6c 6f 77 2e 0a 0a | 20 20 41 6c 74 65 72 6e |y low...| Altern|
|00000af0| 61 74 69 76 65 6c 79 20 | 69 74 27 73 20 70 6f 73 |atively |it's pos|
|00000b00| 73 69 62 6c 65 20 74 6f | 20 67 65 6e 65 72 61 74 |sible to| generat|
|00000b10| 65 20 74 68 65 20 63 6f | 6c 6f 72 20 74 61 62 6c |e the co|lor tabl|
|00000b20| 65 20 62 79 20 73 63 61 | 6e 6e 69 6e 67 20 6f 6e |e by sca|nning on|
|00000b30| 6c 79 0a 6f 6e 65 20 69 | 6d 61 67 65 2c 20 61 20 |ly.one i|mage, a |
|00000b40| 73 6f 20 63 61 6c 6c 65 | 64 20 6d 61 70 20 69 6d |so calle|d map im|
|00000b50| 61 67 65 2e 20 49 74 20 | 6d 61 79 20 62 65 20 6f |age. It |may be o|
|00000b60| 6e 65 20 66 72 6f 6d 20 | 74 68 65 20 67 69 76 65 |ne from |the give|
|00000b70| 6e 20 6c 69 73 74 20 6f | 72 20 61 6e 0a 65 78 74 |n list o|r an.ext|
|00000b80| 72 61 20 69 6d 61 67 65 | 2e 20 54 68 69 73 20 70 |ra image|. This p|
|00000b90| 72 6f 63 65 64 75 72 65 | 20 69 73 20 66 61 73 74 |rocedure| is fast|
|00000ba0| 65 72 20 62 75 74 20 74 | 68 65 20 72 65 73 75 6c |er but t|he resul|
|00000bb0| 74 69 6e 67 20 63 6f 6c | 6f 72 20 74 61 62 6c 65 |ting col|or table|
|00000bc0| 20 6d 61 79 20 62 65 0a | 6c 65 73 73 20 73 75 69 | may be.|less sui|
|00000bd0| 74 61 62 6c 65 20 66 6f | 72 20 74 68 65 20 6f 74 |table fo|r the ot|
|00000be0| 68 65 72 20 69 6d 61 67 | 65 73 2e 0a 0a 20 20 54 |her imag|es... T|
|00000bf0| 68 69 72 64 20 70 6f 73 | 73 69 62 69 6c 69 74 79 |hird pos|sibility|
|00000c00| 20 69 73 20 74 6f 20 64 | 6f 20 74 68 65 20 71 75 | is to d|o the qu|
|00000c10| 61 6e 74 69 7a 61 74 69 | 6f 6e 20 73 65 70 61 72 |antizati|on separ|
|00000c20| 61 74 65 6c 79 20 61 6e | 64 20 67 65 6e 65 72 61 |ately an|d genera|
|00000c30| 74 65 20 61 6e 0a 65 78 | 74 72 61 20 63 6f 6c 6f |te an.ex|tra colo|
|00000c40| 72 20 74 61 62 6c 65 20 | 66 6f 72 20 65 61 63 68 |r table |for each|
|00000c50| 20 69 6d 61 67 65 2e 20 | 54 68 69 73 20 6d 61 79 | image. |This may|
|00000c60| 20 72 65 73 75 6c 74 20 | 69 6e 20 61 20 63 68 61 | result |in a cha|
|00000c70| 6e 67 65 20 6f 66 20 74 | 68 65 20 63 6f 6c 6f 72 |nge of t|he color|
|00000c80| 0a 74 61 62 6c 65 20 62 | 65 74 77 65 65 6e 20 74 |.table b|etween t|
|00000c90| 68 65 20 66 72 61 6d 65 | 73 20 6f 66 20 74 68 65 |he frame|s of the|
|00000ca0| 20 46 4c 49 20 61 6e 69 | 6d 61 74 69 6f 6e 2e 20 | FLI ani|mation. |
|00000cb0| 48 6f 77 65 76 65 72 2c | 20 74 68 65 20 70 72 6f |However,| the pro|
|00000cc0| 67 72 61 6d 20 74 72 69 | 65 73 20 74 6f 0a 6b 65 |gram tri|es to.ke|
|00000cd0| 65 70 20 74 68 65 20 63 | 6f 6c 6f 72 20 74 61 62 |ep the c|olor tab|
|00000ce0| 6c 65 20 61 73 20 73 74 | 61 74 69 63 20 61 73 20 |le as st|atic as |
|00000cf0| 70 6f 73 73 69 62 6c 65 | 2e 20 0a 0a 20 20 54 68 |possible|. .. Th|
|00000d00| 65 20 61 72 65 61 20 6f | 66 20 74 68 65 20 69 6d |e area o|f the im|
|00000d10| 61 67 65 20 74 68 61 74 | 20 74 68 65 20 66 69 6e |age that| the fin|
|00000d20| 61 6c 20 61 6e 69 6d 61 | 74 69 6f 6e 20 70 72 6f |al anima|tion pro|
|00000d30| 64 75 63 65 73 20 77 68 | 65 6e 20 70 6c 61 79 65 |duces wh|en playe|
|00000d40| 64 20 69 73 0a 64 65 6e | 6f 74 65 64 20 61 73 20 |d is.den|oted as |
|00000d50| 64 69 73 70 6c 61 79 5f | 61 72 65 61 2e 20 44 65 |display_|area. De|
|00000d60| 66 61 75 6c 74 20 69 73 | 20 61 20 64 69 73 70 6c |fault is| a displ|
|00000d70| 61 79 5f 61 72 65 61 20 | 6f 66 20 36 34 30 78 34 |ay_area |of 640x4|
|00000d80| 38 30 20 70 69 78 65 6c | 73 2e 20 49 74 20 69 73 |80 pixel|s. It is|
|00000d90| 0a 61 6c 6c 6f 77 65 64 | 20 74 68 61 74 20 74 68 |.allowed| that th|
|00000da0| 65 20 73 69 7a 65 20 6f | 66 20 74 68 65 20 69 6e |e size o|f the in|
|00000db0| 70 75 74 20 69 6d 61 67 | 65 73 20 76 61 72 69 65 |put imag|es varie|
|00000dc0| 73 2e 20 49 66 20 74 68 | 65 20 77 69 64 74 68 20 |s. If th|e width |
|00000dd0| 6f 66 20 61 6e 20 69 6e | 70 75 74 0a 69 6d 61 67 |of an in|put.imag|
|00000de0| 65 20 69 73 20 67 72 65 | 61 74 65 72 20 74 68 61 |e is gre|ater tha|
|00000df0| 6e 20 74 68 65 20 77 69 | 64 74 68 20 6f 66 20 74 |n the wi|dth of t|
|00000e00| 68 65 20 64 69 73 70 6c | 61 79 5f 61 72 65 61 20 |he displ|ay_area |
|00000e10| 2c 20 61 6e 20 65 71 75 | 61 6c 20 6e 75 6d 62 65 |, an equ|al numbe|
|00000e20| 72 20 6f 66 0a 70 69 78 | 65 6c 73 20 69 73 20 72 |r of.pix|els is r|
|00000e30| 65 6d 6f 76 65 64 20 66 | 72 6f 6d 20 65 61 63 68 |emoved f|rom each|
|00000e40| 20 73 69 64 65 20 6f 66 | 20 74 68 65 20 69 6e 70 | side of| the inp|
|00000e50| 75 74 20 69 6d 61 67 65 | 2e 20 49 66 20 74 68 65 |ut image|. If the|
|00000e60| 20 77 69 64 74 68 20 6f | 66 20 61 6e 20 69 6e 70 | width o|f an inp|
|00000e70| 75 74 0a 69 6d 61 67 65 | 20 69 73 20 6c 65 73 73 |ut.image| is less|
|00000e80| 20 74 68 61 6e 20 74 68 | 65 20 77 69 64 74 68 20 | than th|e width |
|00000e90| 6f 66 20 74 68 65 20 64 | 69 73 70 6c 61 79 5f 61 |of the d|isplay_a|
|00000ea0| 72 65 61 2c 20 74 68 69 | 73 20 72 65 73 75 6c 74 |rea, thi|s result|
|00000eb0| 73 20 69 6e 20 74 68 65 | 0a 63 72 65 61 74 69 6f |s in the|.creatio|
|00000ec0| 6e 20 6f 66 20 61 20 62 | 6f 72 64 65 72 20 61 72 |n of a b|order ar|
|00000ed0| 6f 75 6e 64 20 74 68 65 | 20 69 6d 61 67 65 20 28 |ound the| image (|
|00000ee0| 64 65 66 61 75 6c 74 3a | 20 63 65 6e 74 65 72 20 |default:| center |
|00000ef0| 74 68 65 20 69 6d 61 67 | 65 20 69 6e 20 74 68 65 |the imag|e in the|
|00000f00| 0a 64 69 73 70 6c 61 79 | 5f 61 72 65 61 20 29 2e |.display|_area ).|
|00000f10| 20 54 68 65 20 73 61 6d | 65 20 69 73 20 64 6f 6e | The sam|e is don|
|00000f20| 65 20 69 6e 20 76 65 72 | 74 69 63 61 6c 20 64 69 |e in ver|tical di|
|00000f30| 72 65 63 74 69 6f 6e 2e | 0a 0a 51 75 61 6e 74 69 |rection.|..Quanti|
|00000f40| 7a 65 20 6f 70 74 69 6f | 6e 73 0a 2d 90 10 0a 0a |ze optio|ns.-....|
|00000f50| 2d 49 0a 20 20 50 65 72 | 66 6f 72 6d 20 61 6e 20 |-I. Per|form an |
|00000f60| 69 6e 64 69 76 69 64 75 | 61 6c 20 71 75 61 6e 74 |individu|al quant|
|00000f70| 69 7a 65 20 6f 66 20 65 | 61 63 68 20 69 6d 61 67 |ize of e|ach imag|
|00000f80| 65 20 69 6e 64 65 70 65 | 6e 64 65 6e 74 6c 79 20 |e indepe|ndently |
|00000f90| 6f 66 20 61 6c 6c 20 6f | 74 68 65 72 0a 69 6d 61 |of all o|ther.ima|
|00000fa0| 67 65 73 2e 20 49 6e 20 | 74 68 69 73 20 63 61 73 |ges. In |this cas|
|00000fb0| 65 20 6e 6f 20 63 6f 6d | 6d 6f 6e 20 74 61 62 6c |e no com|mon tabl|
|00000fc0| 65 20 69 73 20 75 73 65 | 64 20 61 6e 64 20 69 74 |e is use|d and it|
|00000fd0| 20 6d 61 79 20 6f 63 63 | 75 72 20 74 68 61 74 20 | may occ|ur that |
|00000fe0| 6e 65 77 20 63 6f 6c 6f | 72 73 0a 61 72 65 20 6c |new colo|rs.are l|
|00000ff0| 6f 61 64 65 64 20 62 65 | 74 77 65 65 6e 20 74 68 |oaded be|tween th|
|00001000| 65 20 46 4c 49 2f 46 4c | 43 20 66 72 61 6d 65 73 |e FLI/FL|C frames|
|00001010| 2e 20 55 73 75 61 6c 6c | 79 20 61 20 63 6f 6d 6d |. Usuall|y a comm|
|00001020| 6f 6e 20 63 6f 6c 6f 72 | 20 74 61 62 6c 65 20 73 |on color| table s|
|00001030| 68 6f 75 6c 64 20 62 65 | 0a 70 72 65 66 65 72 72 |hould be|.preferr|
|00001040| 65 64 2e 20 4f 6e 6c 79 | 20 77 68 65 6e 20 74 68 |ed. Only| when th|
|00001050| 69 73 20 72 65 73 75 6c | 74 73 20 69 6e 20 76 65 |is resul|ts in ve|
|00001060| 72 79 20 70 6f 6f 72 20 | 71 75 61 6e 74 69 7a 61 |ry poor |quantiza|
|00001070| 74 69 6f 6e 20 6f 66 20 | 74 68 65 20 69 6d 61 67 |tion of |the imag|
|00001080| 65 73 20 61 0a 76 61 72 | 79 69 6e 67 20 63 6f 6c |es a.var|ying col|
|00001090| 6f 72 20 74 61 62 6c 65 | 20 69 73 20 72 65 63 6f |or table| is reco|
|000010a0| 6d 6d 65 6e 64 65 64 2e | 20 0a 0a 2d 51 63 3c 6e |mmended.| ..-Qc<n|
|000010b0| 75 6d 63 6f 6c 6f 72 73 | 3e 0a 20 20 45 6d 70 6c |umcolors|>. Empl|
|000010c0| 6f 79 20 3c 6e 75 6d 63 | 6f 6c 6f 72 73 3e 20 61 |oy <numc|olors> a|
|000010d0| 73 20 74 68 65 20 6d 61 | 78 69 6d 75 6d 20 6e 75 |s the ma|ximum nu|
|000010e0| 6d 62 65 72 20 6f 66 20 | 63 6f 6c 6f 72 73 20 75 |mber of |colors u|
|000010f0| 73 65 64 20 69 6e 20 74 | 68 65 20 71 75 61 6e 74 |sed in t|he quant|
|00001100| 69 7a 65 64 0a 69 6d 61 | 67 65 73 20 28 72 61 6e |ized.ima|ges (ran|
|00001110| 67 65 3a 20 39 2d 32 35 | 36 3b 20 64 65 66 61 75 |ge: 9-25|6; defau|
|00001120| 6c 74 3a 20 32 35 36 29 | 2e 20 41 20 6c 6f 77 20 |lt: 256)|. A low |
|00001130| 76 61 6c 75 65 20 6d 61 | 79 20 72 65 73 75 6c 74 |value ma|y result|
|00001140| 20 69 6e 20 61 20 70 6f | 6f 72 0a 71 75 61 6e 74 | in a po|or.quant|
|00001150| 69 7a 61 74 69 6f 6e 2e | 0a 0a 2d 51 64 3c 62 69 |ization.|..-Qd<bi|
|00001160| 74 73 3e 0a 20 20 45 6d | 70 6c 6f 79 20 3c 62 69 |ts>. Em|ploy <bi|
|00001170| 74 73 3e 20 61 73 20 74 | 68 65 20 63 6f 6c 6f 72 |ts> as t|he color|
|00001180| 20 64 65 70 74 68 20 75 | 73 65 64 20 69 6e 20 74 | depth u|sed in t|
|00001190| 68 65 20 63 6f 6c 6f 72 | 20 6d 61 70 20 6f 66 20 |he color| map of |
|000011a0| 74 68 65 20 71 75 61 6e | 74 69 7a 65 64 0a 69 6d |the quan|tized.im|
|000011b0| 61 67 65 73 20 28 72 61 | 6e 67 65 3a 20 32 2d 38 |ages (ra|nge: 2-8|
|000011c0| 3b 20 64 65 66 61 75 6c | 74 3a 20 38 29 2e 20 4c |; defaul|t: 8). L|
|000011d0| 6f 77 65 72 20 76 61 6c | 75 65 73 20 72 65 64 75 |ower val|ues redu|
|000011e0| 63 65 20 74 68 65 20 62 | 72 69 67 68 74 6e 65 73 |ce the b|rightnes|
|000011f0| 73 20 6f 66 20 74 68 65 | 0a 71 75 61 6e 74 69 7a |s of the|.quantiz|
|00001200| 65 64 20 69 6d 61 67 65 | 73 2e 0a 0a 2d 51 6e 3c |ed image|s...-Qn<|
|00001210| 6e 6f 64 65 6c 69 6d 69 | 74 3e 0a 20 20 53 65 74 |nodelimi|t>. Set|
|00001220| 20 74 68 65 20 6d 61 78 | 69 6d 75 6d 20 6e 75 6d | the max|imum num|
|00001230| 62 65 72 20 6f 66 20 6e | 6f 64 65 73 20 74 68 61 |ber of n|odes tha|
|00001240| 74 20 74 68 65 20 4f 63 | 74 72 65 65 20 69 73 20 |t the Oc|tree is |
|00001250| 61 6c 6c 6f 77 65 64 20 | 74 6f 20 68 61 76 65 20 |allowed |to have |
|00001260| 69 6e 20 74 68 65 0a 73 | 65 63 6f 6e 64 2d 64 65 |in the.s|econd-de|
|00001270| 65 70 65 73 74 20 6c 65 | 76 65 6c 2e 20 41 20 6c |epest le|vel. A l|
|00001280| 61 72 67 65 72 20 76 61 | 6c 75 65 20 6d 61 79 20 |arger va|lue may |
|00001290| 72 65 73 75 6c 74 20 69 | 6e 20 61 20 62 65 74 74 |result i|n a bett|
|000012a0| 65 72 20 71 75 61 6e 74 | 69 7a 61 74 69 6f 6e 20 |er quant|ization |
|000012b0| 62 75 74 0a 73 6c 6f 77 | 73 20 64 6f 77 6e 20 74 |but.slow|s down t|
|000012c0| 68 65 20 73 63 61 6e 6e | 69 6e 67 20 6f 66 20 74 |he scann|ing of t|
|000012d0| 68 65 20 69 6d 61 67 65 | 73 2e 20 52 65 63 6f 6d |he image|s. Recom|
|000012e0| 6d 65 6e 64 65 64 20 76 | 61 6c 75 65 73 3a 20 62 |mended v|alues: b|
|000012f0| 65 74 77 65 65 6e 20 6f | 6e 65 20 74 69 6d 65 0a |etween o|ne time.|
|00001300| 61 6e 64 20 66 6f 75 72 | 20 74 69 6d 65 73 20 74 |and four| times t|
|00001310| 68 65 20 3c 6e 75 6d 63 | 6f 6c 6f 72 73 3e 20 76 |he <numc|olors> v|
|00001320| 61 6c 75 65 20 28 72 61 | 6e 67 65 3a 20 31 36 2d |alue (ra|nge: 16-|
|00001330| 32 30 34 38 3b 20 64 65 | 66 61 75 6c 74 3a 20 35 |2048; de|fault: 5|
|00001340| 31 32 29 2e 20 53 65 65 | 0a 73 65 63 74 69 6f 6e |12). See|.section|
|00001350| 20 22 54 45 43 48 4e 49 | 43 41 4c 20 4e 4f 54 45 | "TECHNI|CAL NOTE|
|00001360| 53 22 20 66 6f 72 20 6d | 6f 72 65 20 64 65 74 61 |S" for m|ore deta|
|00001370| 69 6c 73 2e 0a 0a 2d 51 | 72 3c 72 65 64 75 63 65 |ils...-Q|r<reduce|
|00001380| 6c 65 76 65 6c 73 3e 0a | 20 20 53 65 74 20 74 68 |levels>.| Set th|
|00001390| 65 20 6e 75 6d 62 65 72 | 20 6f 66 20 6c 65 76 65 |e number| of leve|
|000013a0| 6c 73 20 77 68 69 63 68 | 20 61 72 65 20 63 6f 6e |ls which| are con|
|000013b0| 73 69 64 65 72 65 64 20 | 77 68 65 6e 20 72 65 64 |sidered |when red|
|000013c0| 75 63 69 6e 67 20 74 68 | 65 20 4f 63 74 72 65 65 |ucing th|e Octree|
|000013d0| 0a 28 72 61 6e 67 65 3a | 20 30 2d 38 3b 20 64 65 |.(range:| 0-8; de|
|000013e0| 66 61 75 6c 74 3a 20 38 | 29 2e 20 53 65 65 20 73 |fault: 8|). See s|
|000013f0| 65 63 74 69 6f 6e 20 22 | 54 45 43 48 4e 49 43 41 |ection "|TECHNICA|
|00001400| 4c 20 4e 4f 54 45 53 22 | 20 66 6f 72 20 6d 6f 72 |L NOTES"| for mor|
|00001410| 65 20 64 65 74 61 69 6c | 73 2e 0a 0a 2d 6d 3c 66 |e detail|s...-m<f|
|00001420| 69 6c 65 3e 0a 20 20 54 | 68 65 20 63 6f 6d 6d 6f |ile>. T|he commo|
|00001430| 6e 20 63 6f 6c 6f 72 20 | 74 61 62 6c 65 20 69 73 |n color |table is|
|00001440| 20 67 65 6e 65 72 61 74 | 65 64 20 62 79 20 73 63 | generat|ed by sc|
|00001450| 61 6e 6e 69 6e 67 20 6f | 6e 6c 79 20 74 68 65 20 |anning o|nly the |
|00001460| 69 6d 61 67 65 20 69 6e | 20 74 68 65 20 67 69 76 |image in| the giv|
|00001470| 65 6e 0a 66 69 6c 65 2e | 20 55 73 75 61 6c 6c 79 |en.file.| Usually|
|00001480| 20 74 68 69 73 20 69 73 | 20 6d 75 63 68 20 66 61 | this is| much fa|
|00001490| 73 74 65 72 20 74 68 61 | 6e 20 73 63 61 6e 6e 69 |ster tha|n scanni|
|000014a0| 6e 67 20 61 6c 6c 20 69 | 6d 61 67 65 73 2c 20 62 |ng all i|mages, b|
|000014b0| 75 74 20 74 68 65 20 63 | 6f 6c 6f 72 0a 74 61 62 |ut the c|olor.tab|
|000014c0| 6c 65 20 72 65 70 72 65 | 73 65 6e 74 73 20 6f 6e |le repre|sents on|
|000014d0| 6c 79 20 63 6f 6c 6f 72 | 73 20 77 68 69 63 68 20 |ly color|s which |
|000014e0| 6f 63 63 75 72 20 69 6e | 20 74 68 65 20 67 69 76 |occur in| the giv|
|000014f0| 65 6e 20 69 6d 61 67 65 | 2e 20 49 66 20 74 68 69 |en image|. If thi|
|00001500| 73 20 69 6d 61 67 65 20 | 69 73 0a 6e 6f 74 20 72 |s image |is.not r|
|00001510| 65 70 72 65 73 65 6e 74 | 61 74 69 76 65 20 66 6f |epresent|ative fo|
|00001520| 72 20 74 68 65 20 6f 74 | 68 65 72 73 2c 20 74 68 |r the ot|hers, th|
|00001530| 65 69 72 20 71 75 61 6e | 74 69 7a 61 74 69 6f 6e |eir quan|tization|
|00001540| 20 6d 61 79 20 62 65 63 | 6f 6d 65 20 76 65 72 79 | may bec|ome very|
|00001550| 20 70 6f 6f 72 2e 0a 0a | 2d 77 3c 66 69 6c 65 3e | poor...|-w<file>|
|00001560| 0a 20 20 54 68 65 20 67 | 65 6e 65 72 61 74 65 64 |. The g|enerated|
|00001570| 20 63 6f 6c 6f 72 20 74 | 61 62 6c 65 20 69 73 20 | color t|able is |
|00001580| 77 72 69 74 74 65 6e 20 | 74 6f 20 74 68 65 20 67 |written |to the g|
|00001590| 69 76 65 6e 20 66 69 6c | 65 20 61 73 20 61 20 32 |iven fil|e as a 2|
|000015a0| 35 36 78 31 20 50 50 4d | 20 61 73 63 69 69 0a 69 |56x1 PPM| ascii.i|
|000015b0| 6d 61 67 65 2e 20 54 68 | 65 6e 20 74 68 65 20 70 |mage. Th|en the p|
|000015c0| 72 6f 67 72 61 6d 20 74 | 65 72 6d 69 6e 61 74 65 |rogram t|erminate|
|000015d0| 73 20 77 69 74 68 6f 75 | 74 20 61 73 73 65 6d 62 |s withou|t assemb|
|000015e0| 6c 69 6e 67 20 74 68 65 | 20 66 6c 69 20 61 6e 69 |ling the| fli ani|
|000015f0| 6d 61 74 69 6f 6e 2e 0a | 4c 61 74 65 72 20 74 68 |mation..|Later th|
|00001600| 69 73 20 63 6f 6c 6f 72 | 20 74 61 62 6c 65 20 66 |is color| table f|
|00001610| 69 6c 65 20 63 61 6e 20 | 62 65 20 75 73 65 64 20 |ile can |be used |
|00001620| 77 69 74 68 20 74 68 65 | 20 60 2d 6d 27 20 6f 70 |with the| `-m' op|
|00001630| 74 69 6f 6e 20 74 6f 20 | 67 65 6e 65 72 61 74 65 |tion to |generate|
|00001640| 20 74 68 65 0a 66 6c 69 | 20 61 6e 69 6d 61 74 69 | the.fli| animati|
|00001650| 6f 6e 2e 20 57 68 65 6e | 20 74 68 65 20 60 2d 77 |on. When| the `-w|
|00001660| 27 20 6f 70 74 69 6f 6e | 20 69 73 20 67 69 76 65 |' option| is give|
|00001670| 6e 20 74 68 65 20 70 61 | 72 61 6d 65 74 65 72 20 |n the pa|rameter |
|00001680| 3c 61 6e 69 6d 61 74 69 | 6f 6e 2d 66 69 6c 65 3e |<animati|on-file>|
|00001690| 0a 63 61 6e 20 62 65 20 | 6f 6d 69 74 74 65 64 2e |.can be |omitted.|
|000016a0| 20 49 66 20 62 6f 74 68 | 20 60 2d 6d 27 20 61 6e | If both| `-m' an|
|000016b0| 64 20 60 2d 77 27 20 61 | 72 65 20 67 69 76 65 6e |d `-w' a|re given|
|000016c0| 20 61 6c 73 6f 20 74 68 | 65 20 70 61 72 61 6d 65 | also th|e parame|
|000016d0| 74 65 72 0a 3c 6c 69 73 | 74 2d 66 69 6c 65 3e 20 |ter.<lis|t-file> |
|000016e0| 69 73 6e 27 74 20 6e 65 | 63 65 73 73 61 72 79 2e |isn't ne|cessary.|
|000016f0| 0a 0a 46 4c 49 2f 46 4c | 43 20 6f 70 74 69 6f 6e |..FLI/FL|C option|
|00001700| 73 0a 2d 90 0f 0a 2d 44 | 0a 20 20 49 6e 63 6c 75 |s.-...-D|. Inclu|
|00001710| 64 65 20 61 64 64 69 74 | 69 6f 6e 61 6c 6c 79 20 |de addit|ionally |
|00001720| 75 70 64 61 74 65 20 69 | 6e 66 6f 72 6d 61 74 69 |update i|nformati|
|00001730| 6f 6e 20 77 69 74 68 20 | 72 65 73 70 65 63 74 20 |on with |respect |
|00001740| 74 6f 20 74 68 65 20 66 | 72 61 6d 65 20 62 65 66 |to the f|rame bef|
|00001750| 6f 72 65 0a 74 68 65 20 | 6c 61 73 74 2e 20 44 65 |ore.the |last. De|
|00001760| 66 61 75 6c 74 3a 20 67 | 65 6e 65 72 61 74 65 64 |fault: g|enerated|
|00001770| 20 46 4c 49 20 63 68 75 | 6e 6b 73 20 68 6f 6c 64 | FLI chu|nks hold|
|00001780| 20 75 70 64 61 74 65 20 | 69 6e 66 6f 72 6d 61 74 | update |informat|
|00001790| 69 6f 6e 20 6f 6e 6c 79 | 20 66 6f 72 20 74 68 65 |ion only| for the|
|000017a0| 0a 69 6d 6d 65 64 69 61 | 74 65 6c 79 20 70 72 65 |.immedia|tely pre|
|000017b0| 63 65 64 69 6e 67 20 66 | 72 61 6d 65 2e 20 49 6e |ceding f|rame. In|
|000017c0| 20 62 6f 74 68 20 63 61 | 73 65 73 2c 20 74 68 65 | both ca|ses, the|
|000017d0| 20 72 65 73 75 6c 74 69 | 6e 67 20 61 6e 69 6d 61 | resulti|ng anima|
|000017e0| 74 69 6f 6e 73 20 77 6f | 72 6b 0a 77 69 74 68 20 |tions wo|rk.with |
|000017f0| 73 74 61 6e 64 61 72 64 | 20 70 6c 61 79 65 72 73 |standard| players|
|00001800| 2e 20 54 68 65 20 61 64 | 64 69 74 69 6f 6e 61 6c |. The ad|ditional|
|00001810| 20 75 70 64 61 74 65 20 | 69 6e 66 6f 72 6d 61 74 | update |informat|
|00001820| 69 6f 6e 20 69 73 20 75 | 73 65 66 75 6c 20 66 6f |ion is u|seful fo|
|00001830| 72 0a 70 6c 61 79 65 72 | 73 20 74 68 61 74 20 75 |r.player|s that u|
|00001840| 73 65 20 74 68 65 20 64 | 6f 75 62 6c 65 20 62 75 |se the d|ouble bu|
|00001850| 66 66 65 72 69 6e 67 20 | 74 65 63 68 6e 69 71 75 |ffering |techniqu|
|00001860| 65 20 28 73 65 65 20 54 | 45 43 48 4e 49 43 41 4c |e (see T|ECHNICAL|
|00001870| 20 4e 4f 54 45 53 20 73 | 65 63 74 69 6f 6e 0a 62 | NOTES s|ection.b|
|00001880| 65 6c 6f 77 29 2e 0a 0a | 2d 4e 0a 20 20 53 61 6d |elow)...|-N. Sam|
|00001890| 65 20 61 73 20 60 2d 44 | 27 20 62 75 74 20 69 6e |e as `-D|' but in|
|000018a0| 73 74 65 61 64 20 6f 66 | 20 74 68 65 20 66 72 61 |stead of| the fra|
|000018b0| 6d 65 20 62 65 66 6f 72 | 65 20 74 68 65 20 6c 61 |me befor|e the la|
|000018c0| 73 74 20 74 68 65 20 75 | 70 64 61 74 65 0a 69 6e |st the u|pdate.in|
|000018d0| 66 6f 72 6d 61 74 69 6f | 6e 20 77 69 74 68 20 72 |formatio|n with r|
|000018e0| 65 73 70 65 63 74 20 74 | 6f 20 74 68 65 20 66 6f |espect t|o the fo|
|000018f0| 6c 6c 6f 77 69 6e 67 20 | 66 72 61 6d 65 20 69 73 |llowing |frame is|
|00001900| 20 69 6e 63 6c 75 64 65 | 64 2e 20 54 68 69 73 20 | include|d. This |
|00001910| 61 6c 6c 6f 77 73 20 74 | 68 65 0a 70 6c 61 79 20 |allows t|he.play |
|00001920| 69 6e 20 72 65 76 65 72 | 73 65 20 64 69 72 65 63 |in rever|se direc|
|00001930| 74 69 6f 6e 20 77 69 74 | 68 20 74 68 65 20 58 41 |tion wit|h the XA|
|00001940| 6e 69 6d 20 70 6c 61 79 | 65 72 2e 20 4e 6f 74 65 |nim play|er. Note|
|00001950| 20 74 68 61 74 20 60 2d | 44 27 20 61 6e 64 20 60 | that `-|D' and `|
|00001960| 2d 4e 27 0a 65 78 63 6c | 75 64 65 20 65 61 63 68 |-N'.excl|ude each|
|00001970| 20 6f 74 68 65 72 2e 0a | 0a 2d 4f 0a 20 20 47 65 | other..|.-O. Ge|
|00001980| 6e 65 72 61 74 65 20 6f | 75 74 70 75 74 20 75 73 |nerate o|utput us|
|00001990| 69 6e 67 20 74 68 65 20 | 6f 6c 64 65 72 20 46 4c |ing the |older FL|
|000019a0| 49 20 66 6f 72 6d 61 74 | 20 61 73 73 6f 63 69 61 |I format| associa|
|000019b0| 74 65 64 20 77 69 74 68 | 20 6d 61 67 69 63 20 6e |ted with| magic n|
|000019c0| 75 6d 62 65 72 0a 30 78 | 41 46 31 31 2e 53 6f 6d |umber.0x|AF11.Som|
|000019d0| 65 20 6f 6c 64 65 72 20 | 70 6c 61 79 65 72 73 20 |e older |players |
|000019e0| 63 61 6e 6e 6f 74 20 68 | 61 6e 64 6c 65 20 6e 65 |cannot h|andle ne|
|000019f0| 77 65 72 20 46 4c 49 20 | 61 6e 69 6d 61 74 69 6f |wer FLI |animatio|
|00001a00| 6e 73 20 61 73 73 6f 63 | 69 61 74 65 64 20 77 69 |ns assoc|iated wi|
|00001a10| 74 68 0a 74 68 65 20 6d | 61 67 69 63 20 6e 75 6d |th.the m|agic num|
|00001a20| 62 65 72 20 30 78 41 46 | 31 32 20 28 74 68 65 73 |ber 0xAF|12 (thes|
|00001a30| 65 20 61 72 65 20 73 6f | 6d 65 74 69 6d 65 73 20 |e are so|metimes |
|00001a40| 6b 6e 6f 77 6e 20 61 73 | 20 46 4c 43 20 66 69 6c |known as| FLC fil|
|00001a50| 65 73 29 2e 20 55 73 65 | 20 74 68 65 20 6f 6c 64 |es). Use| the old|
|00001a60| 0a 4c 43 5f 43 48 55 4e | 4b 53 20 28 31 32 29 20 |.LC_CHUN|KS (12) |
|00001a70| 69 6e 73 74 65 61 64 20 | 6f 66 20 44 45 4c 54 41 |instead |of DELTA|
|00001a80| 5f 43 48 55 4e 4b 53 20 | 28 37 29 2c 20 61 6e 64 |_CHUNKS |(7), and|
|00001a90| 20 43 4f 4c 4f 52 5f 43 | 48 55 4e 4b 53 20 28 31 | COLOR_C|HUNKS (1|
|00001aa0| 31 29 20 69 6e 73 74 65 | 61 64 20 6f 66 0a 43 4f |1) inste|ad of.CO|
|00001ab0| 4c 4f 52 5f 32 35 36 5f | 43 48 55 4e 4b 53 20 28 |LOR_256_|CHUNKS (|
|00001ac0| 34 29 2c 20 61 6e 64 20 | 73 65 74 20 64 65 66 61 |4), and |set defa|
|00001ad0| 75 6c 74 20 72 65 73 6f | 6c 75 74 69 6f 6e 20 74 |ult reso|lution t|
|00001ae0| 6f 20 33 32 30 78 32 30 | 30 20 69 6e 73 74 65 61 |o 320x20|0 instea|
|00001af0| 64 20 6f 66 20 74 68 65 | 0a 75 73 75 61 6c 20 36 |d of the|.usual 6|
|00001b00| 34 30 78 34 38 30 2e 0a | 0a 2d 62 3c 63 6f 6c 6f |40x480..|.-b<colo|
|00001b10| 72 3e 0a 20 20 49 66 20 | 61 20 70 61 72 74 69 63 |r>. If |a partic|
|00001b20| 75 6c 61 72 20 69 6e 70 | 75 74 20 69 6d 61 67 65 |ular inp|ut image|
|00001b30| 20 64 6f 65 73 20 6e 6f | 74 20 63 6f 76 65 72 20 | does no|t cover |
|00001b40| 74 68 65 20 65 6e 74 69 | 72 65 20 64 69 73 70 6c |the enti|re displ|
|00001b50| 61 79 5f 61 72 65 61 2c | 20 65 6d 70 6c 6f 79 0a |ay_area,| employ.|
|00001b60| 74 68 65 20 73 70 65 63 | 69 66 69 65 64 20 63 6f |the spec|ified co|
|00001b70| 6c 6f 72 20 66 6f 72 20 | 61 6c 6c 20 70 69 78 65 |lor for |all pixe|
|00001b80| 6c 73 20 69 6e 20 74 68 | 65 20 62 6f 72 64 65 72 |ls in th|e border|
|00001b90| 20 61 72 65 61 2e 20 44 | 65 66 61 75 6c 74 3a 20 | area. D|efault: |
|00001ba0| 7a 65 72 6f 20 28 53 65 | 65 0a 61 6c 73 6f 20 60 |zero (Se|e.also `|
|00001bb0| 2b 2f 2d 6f 78 27 29 2e | 20 54 6f 20 65 76 61 6c |+/-ox').| To eval|
|00001bc0| 75 61 74 65 20 77 68 69 | 63 68 20 6e 75 6d 62 65 |uate whi|ch numbe|
|00001bd0| 72 20 61 20 63 65 72 74 | 61 69 6e 20 63 6f 6c 6f |r a cert|ain colo|
|00001be0| 72 20 68 61 73 20 74 68 | 65 20 60 2d 77 27 20 6f |r has th|e `-w' o|
|00001bf0| 70 74 69 6f 6e 0a 63 61 | 6e 20 62 65 20 75 73 65 |ption.ca|n be use|
|00001c00| 64 2e 42 79 20 74 68 61 | 74 20 74 68 65 20 63 6f |d.By tha|t the co|
|00001c10| 6c 6f 72 20 74 61 62 6c | 65 20 69 73 20 77 72 69 |lor tabl|e is wri|
|00001c20| 74 74 65 6e 20 74 6f 20 | 61 20 66 69 6c 65 20 28 |tten to |a file (|
|00001c30| 61 73 63 69 69 29 20 61 | 6e 64 20 74 68 65 6e 20 |ascii) a|nd then |
|00001c40| 74 68 65 0a 64 65 73 69 | 72 65 64 20 63 6f 6c 6f |the.desi|red colo|
|00001c50| 72 20 63 61 6e 20 62 65 | 20 6c 6f 6f 6b 65 64 20 |r can be| looked |
|00001c60| 75 70 20 69 6e 20 74 68 | 65 20 74 61 62 6c 65 2e |up in th|e table.|
|00001c70| 0a 0a 2d 67 3c 77 69 64 | 74 68 3e 78 3c 68 65 69 |..-g<wid|th>x<hei|
|00001c80| 67 68 74 3e 0a 20 20 54 | 68 69 73 20 64 65 66 69 |ght>. T|his defi|
|00001c90| 6e 65 73 20 74 68 65 20 | 77 69 64 74 68 20 61 6e |nes the |width an|
|00001ca0| 64 20 68 65 69 67 68 74 | 20 6f 66 20 74 68 65 20 |d height| of the |
|00001cb0| 64 69 73 70 6c 61 79 5f | 61 72 65 61 20 28 61 6c |display_|area (al|
|00001cc0| 6c 6f 77 65 64 20 72 61 | 6e 67 65 3a 20 66 72 6f |lowed ra|nge: fro|
|00001cd0| 6d 0a 31 30 78 31 30 20 | 74 6f 20 31 32 38 30 78 |m.10x10 |to 1280x|
|00001ce0| 31 30 32 34 29 2e 20 49 | 66 20 61 6e 20 6f 64 64 |1024). I|f an odd|
|00001cf0| 20 76 61 6c 75 65 20 6f | 66 20 77 69 64 74 68 20 | value o|f width |
|00001d00| 69 73 20 73 70 65 63 69 | 66 69 65 64 2c 20 69 74 |is speci|fied, it|
|00001d10| 20 69 73 0a 61 75 74 6f | 6d 61 74 69 63 61 6c 6c | is.auto|maticall|
|00001d20| 79 20 69 6e 63 72 65 6d | 65 6e 74 65 64 20 62 79 |y increm|ented by|
|00001d30| 20 6f 6e 65 2e 20 41 20 | 70 61 72 74 69 63 75 6c | one. A |particul|
|00001d40| 61 72 20 46 4c 49 20 70 | 6c 61 79 65 72 20 6d 61 |ar FLI p|layer ma|
|00001d50| 79 20 6f 6e 6c 79 20 73 | 75 70 70 6f 72 74 20 61 |y only s|upport a|
|00001d60| 0a 6c 69 6d 69 74 65 64 | 20 73 65 74 20 6f 66 20 |.limited| set of |
|00001d70| 72 65 73 6f 6c 75 74 69 | 6f 6e 73 2e 20 49 6e 20 |resoluti|ons. In |
|00001d80| 70 72 69 6e 63 69 70 6c | 65 2c 20 56 47 41 20 72 |principl|e, VGA r|
|00001d90| 65 73 6f 6c 75 74 69 6f | 6e 20 28 33 32 30 78 32 |esolutio|n (320x2|
|00001da0| 30 30 29 20 73 68 6f 75 | 6c 64 0a 61 6c 77 61 79 |00) shou|ld.alway|
|00001db0| 73 20 77 6f 72 6b 2e 20 | 46 6f 72 20 70 6c 61 79 |s work. |For play|
|00001dc0| 65 72 73 20 73 75 70 70 | 6f 72 74 69 6e 67 20 74 |ers supp|orting t|
|00001dd0| 68 65 20 6e 65 77 65 72 | 20 73 74 79 6c 65 20 6f |he newer| style o|
|00001de0| 66 20 46 4c 49 73 20 28 | 46 4c 43 73 29 20 61 73 |f FLIs (|FLCs) as|
|00001df0| 73 6f 63 69 61 74 65 64 | 0a 77 69 74 68 20 74 68 |sociated|.with th|
|00001e00| 65 20 6d 61 67 69 63 20 | 6e 75 6d 62 65 72 20 30 |e magic |number 0|
|00001e10| 78 41 46 31 32 2c 20 36 | 34 30 78 34 38 30 20 73 |xAF12, 6|40x480 s|
|00001e20| 68 6f 75 6c 64 20 61 6c | 73 6f 20 77 6f 72 6b 2e |hould al|so work.|
|00001e30| 0a 0a 2b 2f 2d 6f 78 3c | 68 6f 72 5f 70 6f 73 69 |..+/-ox<|hor_posi|
|00001e40| 74 69 6f 6e 3e 0a 20 20 | 44 69 73 61 62 6c 65 20 |tion>. |Disable |
|00001e50| 74 68 65 20 61 75 74 6f | 6d 61 74 69 63 20 63 65 |the auto|matic ce|
|00001e60| 6e 74 65 72 69 6e 67 20 | 6f 66 20 69 6e 70 75 74 |ntering |of input|
|00001e70| 20 69 6d 61 67 65 73 20 | 69 6e 20 68 6f 72 69 7a | images |in horiz|
|00001e80| 6f 6e 74 61 6c 20 64 69 | 72 65 63 74 69 6f 6e 2e |ontal di|rection.|
|00001e90| 0a 50 6c 61 63 65 20 74 | 68 65 20 69 6e 70 75 74 |.Place t|he input|
|00001ea0| 20 69 6d 61 67 65 73 20 | 61 74 20 61 20 66 69 78 | images |at a fix|
|00001eb0| 20 70 6f 73 69 74 69 6f | 6e 20 69 6e 20 74 68 65 | positio|n in the|
|00001ec0| 20 64 69 73 70 6c 61 79 | 5f 61 72 65 61 2e 20 57 | display|_area. W|
|00001ed0| 68 65 6e 20 60 2b 6f 78 | 27 20 69 73 0a 75 73 65 |hen `+ox|' is.use|
|00001ee0| 64 20 74 68 65 20 6c 65 | 66 74 20 62 6f 72 64 65 |d the le|ft borde|
|00001ef0| 72 20 6f 66 20 74 68 65 | 20 69 6e 70 75 74 20 69 |r of the| input i|
|00001f00| 6d 61 67 65 73 20 69 73 | 20 6b 65 70 74 20 66 69 |mages is| kept fi|
|00001f10| 78 20 69 6e 64 65 70 65 | 6e 64 65 6e 74 6c 79 20 |x indepe|ndently |
|00001f20| 6f 66 20 74 68 65 0a 77 | 69 64 74 68 20 6f 66 20 |of the.w|idth of |
|00001f30| 74 68 65 20 69 6d 61 67 | 65 73 2e 20 54 68 65 20 |the imag|es. The |
|00001f40| 76 61 6c 75 65 20 67 69 | 76 65 73 20 74 68 65 20 |value gi|ves the |
|00001f50| 64 69 73 74 61 6e 63 65 | 20 62 65 74 77 65 65 6e |distance| between|
|00001f60| 20 74 68 65 20 6c 65 66 | 74 20 62 6f 72 64 65 72 | the lef|t border|
|00001f70| 20 6f 66 0a 74 68 65 20 | 64 69 73 70 6c 61 79 5f | of.the |display_|
|00001f80| 61 72 65 61 20 61 6e 64 | 20 74 68 65 20 6c 65 66 |area and| the lef|
|00001f90| 74 20 62 6f 72 64 65 72 | 20 6f 66 20 74 68 65 20 |t border| of the |
|00001fa0| 69 6e 70 75 74 20 69 6d | 61 67 65 2e 20 57 68 65 |input im|age. Whe|
|00001fb0| 6e 20 60 2d 6f 78 27 20 | 69 73 20 75 73 65 64 0a |n `-ox' |is used.|
|00001fc0| 74 68 65 20 72 69 67 68 | 74 20 62 6f 72 64 65 72 |the righ|t border|
|00001fd0| 20 6f 66 20 74 68 65 20 | 69 6e 70 75 74 20 69 6d | of the |input im|
|00001fe0| 61 67 65 73 20 69 73 20 | 6b 65 70 74 20 66 69 78 |ages is |kept fix|
|00001ff0| 2e 20 54 68 65 20 76 61 | 6c 75 65 20 67 69 76 65 |. The va|lue give|
|00002000| 73 20 74 68 65 0a 64 69 | 73 74 61 6e 63 65 20 62 |s the.di|stance b|
|00002010| 65 74 77 65 65 6e 20 74 | 68 65 20 72 69 67 68 74 |etween t|he right|
|00002020| 20 62 6f 72 64 65 72 20 | 6f 66 20 74 68 65 20 64 | border |of the d|
|00002030| 69 73 70 6c 61 79 5f 61 | 72 65 61 20 61 6e 64 20 |isplay_a|rea and |
|00002040| 74 68 65 20 72 69 67 68 | 74 20 62 6f 72 64 65 72 |the righ|t border|
|00002050| 20 6f 66 0a 74 68 65 20 | 69 6e 70 75 74 20 69 6d | of.the |input im|
|00002060| 61 67 65 2e 20 49 6e 20 | 62 6f 74 68 20 63 61 73 |age. In |both cas|
|00002070| 65 73 20 6e 65 67 61 74 | 69 76 65 20 76 61 6c 75 |es negat|ive valu|
|00002080| 65 73 20 63 61 6e 20 62 | 65 20 73 70 65 63 69 66 |es can b|e specif|
|00002090| 69 65 64 2e 20 54 68 65 | 6e 20 74 68 65 0a 72 65 |ied. The|n the.re|
|000020a0| 73 70 65 63 74 69 76 65 | 20 62 6f 72 64 65 72 20 |spective| border |
|000020b0| 6f 66 20 74 68 65 20 69 | 6e 70 75 74 20 69 6d 61 |of the i|nput ima|
|000020c0| 67 65 73 20 69 73 20 6f | 75 74 73 69 64 65 20 6f |ges is o|utside o|
|000020d0| 66 20 74 68 65 20 64 69 | 73 70 6c 61 79 5f 61 72 |f the di|splay_ar|
|000020e0| 65 61 20 61 6e 64 20 61 | 0a 70 61 72 74 20 6f 66 |ea and a|.part of|
|000020f0| 20 74 68 65 20 69 6d 61 | 67 65 73 20 69 73 20 63 | the ima|ges is c|
|00002100| 75 74 20 6f 66 66 2e 20 | 54 68 65 20 6f 70 74 69 |ut off. |The opti|
|00002110| 6f 6e 20 63 61 6e 20 62 | 65 20 75 73 65 64 20 74 |on can b|e used t|
|00002120| 6f 20 70 6c 61 63 65 20 | 69 6e 70 75 74 20 69 6d |o place |input im|
|00002130| 61 67 65 73 0a 77 69 74 | 68 20 76 61 72 79 69 6e |ages.wit|h varyin|
|00002140| 67 20 77 69 64 74 68 20 | 61 74 20 61 20 63 65 72 |g width |at a cer|
|00002150| 74 61 69 6e 20 70 6f 73 | 69 74 69 6f 6e 20 69 6e |tain pos|ition in|
|00002160| 20 74 68 65 20 64 69 73 | 70 6c 61 79 5f 61 72 65 | the dis|play_are|
|00002170| 61 2c 20 6f 72 20 74 6f | 20 61 6e 69 6d 61 74 65 |a, or to| animate|
|00002180| 20 61 0a 63 65 72 74 61 | 69 6e 20 73 65 63 74 69 | a.certa|in secti|
|00002190| 6f 6e 20 6f 66 20 6c 61 | 72 67 65 72 20 69 6e 70 |on of la|rger inp|
|000021a0| 75 74 20 69 6d 61 67 65 | 73 2e 0a 0a 2b 2f 2d 6f |ut image|s...+/-o|
|000021b0| 79 3c 76 65 72 74 5f 70 | 6f 73 69 74 69 6f 6e 3e |y<vert_p|osition>|
|000021c0| 0a 20 20 49 64 65 6e 74 | 69 63 61 6c 20 74 6f 20 |. Ident|ical to |
|000021d0| 60 2b 2f 2d 6f 78 27 2c | 20 62 75 74 20 63 6f 6e |`+/-ox',| but con|
|000021e0| 74 72 6f 6c 73 20 74 68 | 65 20 76 65 72 74 69 63 |trols th|e vertic|
|000021f0| 61 6c 20 70 6f 73 69 74 | 69 6f 6e 2e 20 57 68 65 |al posit|ion. Whe|
|00002200| 6e 20 60 2b 6f 79 27 20 | 69 73 0a 75 73 65 64 20 |n `+oy' |is.used |
|00002210| 74 68 65 20 6e 75 6d 62 | 65 72 20 6f 66 20 70 69 |the numb|er of pi|
|00002220| 78 65 6c 73 20 66 72 6f | 6d 20 74 68 65 20 75 70 |xels fro|m the up|
|00002230| 70 65 72 20 62 6f 72 64 | 65 72 20 6f 66 20 74 68 |per bord|er of th|
|00002240| 65 20 64 69 73 70 6c 61 | 79 5f 61 72 65 61 20 74 |e displa|y_area t|
|00002250| 6f 20 74 68 65 0a 75 70 | 70 65 72 20 62 6f 72 64 |o the.up|per bord|
|00002260| 65 72 20 6f 66 20 74 68 | 65 20 69 6e 70 75 74 20 |er of th|e input |
|00002270| 69 6d 61 67 65 73 20 69 | 73 20 73 65 74 2e 20 52 |images i|s set. R|
|00002280| 65 73 70 65 63 74 69 76 | 65 6c 79 20 60 2d 6f 79 |espectiv|ely `-oy|
|00002290| 27 20 63 6f 6e 74 72 6f | 6c 73 20 74 68 65 0a 70 |' contro|ls the.p|
|000022a0| 6f 73 69 74 69 6f 6e 20 | 77 69 74 68 20 72 65 73 |osition |with res|
|000022b0| 70 65 63 74 20 74 6f 20 | 74 68 65 20 6c 6f 77 65 |pect to |the lowe|
|000022c0| 72 20 62 6f 72 64 65 72 | 2e 0a 0a 2d 73 3c 73 70 |r border|...-s<sp|
|000022d0| 65 65 64 3e 0a 20 20 55 | 73 65 20 74 68 65 20 73 |eed>. U|se the s|
|000022e0| 70 65 63 69 66 69 65 64 | 20 73 70 65 65 64 20 74 |pecified| speed t|
|000022f0| 6f 20 62 65 20 73 74 6f | 72 65 64 20 69 6e 20 74 |o be sto|red in t|
|00002300| 68 65 20 68 65 61 64 65 | 72 20 6f 66 20 74 68 65 |he heade|r of the|
|00002310| 20 46 4c 49 20 66 69 6c | 65 2e 20 54 68 65 20 46 | FLI fil|e. The F|
|00002320| 4c 49 0a 73 74 61 6e 64 | 61 72 64 20 72 65 71 75 |LI.stand|ard requ|
|00002330| 69 72 65 73 20 61 20 73 | 70 65 65 64 20 76 61 6c |ires a s|peed val|
|00002340| 75 65 20 69 6e 20 74 68 | 65 20 66 69 6c 65 2e 20 |ue in th|e file. |
|00002350| 53 6f 6d 65 20 70 6c 61 | 79 65 72 73 20 75 73 65 |Some pla|yers use|
|00002360| 20 74 68 69 73 20 6e 75 | 6d 62 65 72 20 61 73 0a | this nu|mber as.|
|00002370| 64 65 66 61 75 6c 74 20 | 77 68 65 6e 20 6e 6f 20 |default |when no |
|00002380| 6f 74 68 65 72 20 73 70 | 65 65 64 20 69 73 20 67 |other sp|eed is g|
|00002390| 69 76 65 6e 2e 20 54 68 | 65 20 6d 65 61 6e 69 6e |iven. Th|e meanin|
|000023a0| 67 20 6f 66 20 74 68 65 | 20 73 70 65 65 64 20 61 |g of the| speed a|
|000023b0| 72 67 75 6d 65 6e 74 0a | 64 65 70 65 6e 64 73 20 |rgument.|depends |
|000023c0| 6f 6e 20 74 68 65 20 46 | 4c 49 20 66 6f 72 6d 61 |on the F|LI forma|
|000023d0| 74 20 69 6e 20 75 73 65 | 2e 20 48 69 67 68 65 72 |t in use|. Higher|
|000023e0| 20 76 61 6c 75 65 73 20 | 72 65 64 75 63 65 20 74 | values |reduce t|
|000023f0| 68 65 20 73 70 65 65 64 | 2e 20 46 6f 72 20 6f 6c |he speed|. For ol|
|00002400| 64 0a 66 6f 72 6d 61 74 | 20 46 4c 49 73 2c 20 74 |d.format| FLIs, t|
|00002410| 68 65 20 76 61 6c 75 65 | 20 73 70 65 63 69 66 69 |he value| specifi|
|00002420| 65 73 20 74 68 65 20 6e | 75 6d 62 65 72 20 6f 66 |es the n|umber of|
|00002430| 20 76 69 64 65 6f 20 74 | 69 63 6b 73 20 62 65 74 | video t|icks bet|
|00002440| 77 65 65 6e 20 74 77 6f | 20 66 72 61 6d 65 73 0a |ween two| frames.|
|00002450| 28 64 65 66 61 75 6c 74 | 3a 20 35 29 2e 20 46 6f |(default|: 5). Fo|
|00002460| 72 20 6e 65 77 20 66 6f | 72 6d 61 74 20 46 4c 49 |r new fo|rmat FLI|
|00002470| 73 2c 20 74 68 65 20 64 | 65 6c 61 79 20 62 65 74 |s, the d|elay bet|
|00002480| 77 65 65 6e 20 74 77 6f | 20 66 72 61 6d 65 73 20 |ween two| frames |
|00002490| 69 73 20 73 70 65 63 69 | 66 69 65 64 0a 69 6e 20 |is speci|fied.in |
|000024a0| 31 2f 31 30 90 03 20 73 | 65 63 6f 6e 64 73 20 72 |1/10.. s|econds r|
|000024b0| 61 74 68 65 72 20 74 68 | 61 6e 20 76 69 64 65 6f |ather th|an video|
|000024c0| 20 74 69 63 6b 73 20 28 | 64 65 66 61 75 6c 74 3a | ticks (|default:|
|000024d0| 20 37 32 2f 31 30 90 03 | 20 73 65 63 6f 6e 64 73 | 72/10..| seconds|
|000024e0| 2c 0a 72 65 73 75 6c 74 | 69 6e 67 20 69 6e 20 61 |,.result|ing in a|
|000024f0| 70 70 72 6f 78 69 6d 61 | 74 65 6c 79 20 31 35 20 |pproxima|tely 15 |
|00002500| 66 72 61 6d 65 73 20 70 | 65 72 20 73 65 63 6f 6e |frames p|er secon|
|00002510| 64 29 2e 0a 0a 47 65 6e | 65 72 61 6c 20 6f 70 74 |d)...Gen|eral opt|
|00002520| 69 6f 6e 73 0a 2d 90 0f | 0a 2d 76 0a 20 20 50 72 |ions.-..|.-v. Pr|
|00002530| 69 6e 74 20 69 6e 74 65 | 72 6e 61 6c 20 69 6e 66 |int inte|rnal inf|
|00002540| 6f 72 6d 61 74 69 6f 6e | 20 74 6f 20 73 74 64 6f |ormation| to stdo|
|00002550| 75 74 2e 20 60 2d 76 76 | 27 20 63 61 75 73 65 73 |ut. `-vv|' causes|
|00002560| 20 65 76 65 6e 20 6d 6f | 72 65 20 74 68 69 6e 67 | even mo|re thing|
|00002570| 73 20 74 6f 20 62 65 0a | 77 72 69 74 74 65 6e 2e |s to be.|written.|
|00002580| 0a 0a 2b 2f 2d 66 3c 66 | 69 6c 74 65 72 3e 0a 20 |..+/-f<f|ilter>. |
|00002590| 20 55 73 65 20 74 68 65 | 20 73 70 65 63 69 66 69 | Use the| specifi|
|000025a0| 65 64 20 66 69 6c 74 65 | 72 20 77 68 65 6e 20 72 |ed filte|r when r|
|000025b0| 65 61 64 69 6e 67 20 74 | 68 65 20 69 6e 70 75 74 |eading t|he input|
|000025c0| 20 69 6d 61 67 65 73 2e | 20 54 68 69 73 20 69 73 | images.| This is|
|000025d0| 20 6e 65 63 65 73 73 61 | 72 79 0a 77 68 65 6e 20 | necessa|ry.when |
|000025e0| 6f 74 68 65 72 20 74 68 | 61 6e 20 74 68 65 20 64 |other th|an the d|
|000025f0| 65 66 61 75 6c 74 20 66 | 6f 72 6d 61 74 73 20 61 |efault f|ormats a|
|00002600| 72 65 20 75 73 65 64 20 | 6f 72 20 77 68 65 6e 20 |re used |or when |
|00002610| 74 68 65 20 69 6e 70 75 | 74 20 66 69 6c 65 73 20 |the inpu|t files |
|00002620| 61 72 65 0a 63 6f 6d 70 | 72 65 73 73 65 64 20 28 |are.comp|ressed (|
|00002630| 73 65 65 20 74 68 65 20 | 65 78 61 6d 70 6c 65 73 |see the |examples|
|00002640| 20 62 65 6c 6f 77 29 2e | 20 54 68 65 20 72 65 61 | below).| The rea|
|00002650| 64 69 6e 67 20 69 73 20 | 64 6f 6e 65 20 75 73 69 |ding is |done usi|
|00002660| 6e 67 20 74 68 65 20 70 | 6f 70 65 6e 28 29 0a 73 |ng the p|open().s|
|00002670| 75 62 72 6f 75 74 69 6e | 65 2e 20 49 66 20 60 2d |ubroutin|e. If `-|
|00002680| 66 27 20 69 73 20 75 73 | 65 64 20 74 68 65 20 73 |f' is us|ed the s|
|00002690| 70 65 63 69 66 69 65 64 | 20 66 69 6c 74 65 72 20 |pecified| filter |
|000026a0| 69 73 20 73 75 70 70 6f | 73 65 64 20 74 6f 20 72 |is suppo|sed to r|
|000026b0| 65 61 64 20 66 72 6f 6d | 0a 73 74 64 69 6e 2e 20 |ead from|.stdin. |
|000026c0| 54 68 65 20 63 6f 6d 6d | 61 6e 64 20 75 73 65 64 |The comm|and used|
|000026d0| 20 69 6e 20 74 68 65 20 | 70 6f 70 65 6e 28 29 20 | in the |popen() |
|000026e0| 73 74 61 74 65 6d 65 6e | 74 20 68 61 73 20 74 68 |statemen|t has th|
|000026f0| 65 20 66 6f 72 6d 20 60 | 66 69 6c 74 65 72 20 3c |e form `|filter <|
|00002700| 0a 69 6d 61 67 65 27 2e | 20 49 6e 20 74 68 65 20 |.image'.| In the |
|00002710| 63 61 73 65 20 6f 66 20 | 60 2b 66 27 20 74 68 65 |case of |`+f' the|
|00002720| 20 69 6d 61 67 65 20 6e | 61 6d 65 20 69 66 20 70 | image n|ame if p|
|00002730| 61 73 73 65 64 20 61 73 | 20 61 72 67 75 6d 65 6e |assed as| argumen|
|00002740| 74 20 74 6f 20 74 68 65 | 0a 66 69 6c 74 65 72 20 |t to the|.filter |
|00002750| 70 72 6f 67 72 61 6d 2e | 20 49 6e 20 62 6f 74 68 |program.| In both|
|00002760| 20 63 61 73 65 73 20 74 | 68 65 20 66 69 6c 74 65 | cases t|he filte|
|00002770| 72 20 70 72 6f 67 72 61 | 6d 20 68 61 73 20 74 6f |r progra|m has to|
|00002780| 20 77 72 69 74 65 20 74 | 68 65 20 63 6f 6e 76 65 | write t|he conve|
|00002790| 72 74 65 64 0a 69 6d 61 | 67 65 20 74 6f 20 73 74 |rted.ima|ge to st|
|000027a0| 64 6f 75 74 2e 20 54 68 | 65 20 6f 70 74 69 6f 6e |dout. Th|e option|
|000027b0| 20 6f 76 65 72 77 72 69 | 74 65 73 20 74 68 65 20 | overwri|tes the |
|000027c0| 66 69 6c 74 65 72 20 64 | 65 66 69 6e 65 64 20 62 |filter d|efined b|
|000027d0| 79 20 74 68 65 20 65 6e | 76 69 72 6f 6e 6d 65 6e |y the en|vironmen|
|000027e0| 74 0a 76 61 72 69 61 62 | 6c 65 20 50 50 4d 32 46 |t.variab|le PPM2F|
|000027f0| 4c 49 46 49 4c 54 45 52 | 2e 0a 0a 2d 74 0a 20 20 |LIFILTER|...-t. |
|00002800| 54 65 73 74 20 74 68 65 | 20 66 69 6c 65 20 6d 61 |Test the| file ma|
|00002810| 67 69 63 20 6f 66 20 74 | 68 65 20 69 6e 70 75 74 |gic of t|he input|
|00002820| 20 66 69 6c 65 73 20 62 | 65 66 6f 72 65 20 75 73 | files b|efore us|
|00002830| 69 6e 67 20 74 68 65 20 | 72 65 61 64 20 66 69 6c |ing the |read fil|
|00002840| 74 65 72 2e 20 4f 6e 6c | 79 0a 66 69 6c 65 73 20 |ter. Onl|y.files |
|00002850| 77 68 69 63 68 20 68 61 | 76 65 20 6e 6f 20 50 50 |which ha|ve no PP|
|00002860| 4d 2c 20 50 47 4d 2c 20 | 50 42 4d 20 6f 72 20 46 |M, PGM, |PBM or F|
|00002870| 42 4d 20 66 6f 72 6d 61 | 74 20 61 72 65 20 72 65 |BM forma|t are re|
|00002880| 61 64 20 74 68 72 6f 75 | 67 68 20 74 68 65 20 67 |ad throu|gh the g|
|00002890| 69 76 65 6e 0a 66 69 6c | 74 65 72 2e 20 42 79 20 |iven.fil|ter. By |
|000028a0| 64 65 66 61 75 6c 74 20 | 61 6c 6c 20 66 69 6c 65 |default |all file|
|000028b0| 73 20 61 72 65 20 72 65 | 61 64 20 74 68 72 6f 75 |s are re|ad throu|
|000028c0| 67 68 20 61 20 67 69 76 | 65 6e 20 66 69 6c 74 65 |gh a giv|en filte|
|000028d0| 72 2e 20 57 68 65 6e 20 | 6e 6f 20 66 69 6c 74 65 |r. When |no filte|
|000028e0| 72 0a 69 73 20 73 70 65 | 63 69 66 69 65 64 20 74 |r.is spe|cified t|
|000028f0| 68 65 20 60 2d 74 27 20 | 6f 70 74 69 6f 6e 20 68 |he `-t' |option h|
|00002900| 61 73 20 6e 6f 20 65 66 | 66 65 63 74 2e 0a 0a 45 |as no ef|fect...E|
|00002910| 6e 76 69 72 6f 6e 6d 65 | 6e 74 0a 2d 90 0b 0a 20 |nvironme|nt.-... |
|00002920| 20 41 20 66 72 65 71 75 | 65 6e 74 6c 79 20 75 73 | A frequ|ently us|
|00002930| 65 64 20 72 65 61 64 20 | 66 69 6c 74 65 72 20 63 |ed read |filter c|
|00002940| 61 6e 20 62 65 20 64 65 | 66 69 6e 65 64 20 75 73 |an be de|fined us|
|00002950| 69 6e 67 20 74 68 65 20 | 65 6e 76 69 72 6f 6e 6d |ing the |environm|
|00002960| 65 6e 74 20 76 61 72 69 | 61 62 6c 65 0a 50 50 4d |ent vari|able.PPM|
|00002970| 32 46 4c 49 46 49 4c 54 | 45 52 2e 20 54 68 65 20 |2FLIFILT|ER. The |
|00002980| 6e 61 6d 65 20 6f 66 20 | 74 68 65 20 66 69 6c 74 |name of |the filt|
|00002990| 65 72 20 63 61 6e 20 62 | 65 20 70 72 65 63 65 64 |er can b|e preced|
|000029a0| 65 64 20 62 79 20 61 20 | 60 2b 27 20 6f 72 20 60 |ed by a |`+' or `|
|000029b0| 2d 27 20 73 69 67 6e 0a | 28 73 65 65 20 74 68 65 |-' sign.|(see the|
|000029c0| 20 65 78 61 6d 70 6c 65 | 20 62 65 6c 6f 77 29 2e | example| below).|
|000029d0| 20 54 68 65 20 60 2d 27 | 20 73 69 67 6e 20 61 73 | The `-'| sign as|
|000029e0| 20 66 69 72 73 74 20 63 | 68 61 72 61 63 74 65 72 | first c|haracter|
|000029f0| 20 63 6f 72 72 65 73 70 | 6f 6e 64 73 20 74 6f 20 | corresp|onds to |
|00002a00| 74 68 65 0a 75 73 61 67 | 65 20 6f 66 20 60 2d 66 |the.usag|e of `-f|
|00002a10| 27 20 69 6e 20 74 68 65 | 20 63 6f 6d 6d 61 6e 64 |' in the| command|
|00002a20| 20 6c 69 6e 65 20 61 6e | 64 20 61 20 60 2b 27 20 | line an|d a `+' |
|00002a30| 77 6f 72 6b 73 20 6c 69 | 6b 65 20 60 2b 66 27 2e |works li|ke `+f'.|
|00002a40| 20 42 79 20 64 65 66 61 | 75 6c 74 20 60 2d 27 0a | By defa|ult `-'.|
|00002a50| 69 73 20 61 73 73 75 6d | 65 64 20 77 68 69 63 68 |is assum|ed which|
|00002a60| 20 6d 65 61 6e 73 20 74 | 68 61 74 20 74 68 65 20 | means t|hat the |
|00002a70| 66 69 6c 74 65 72 20 72 | 65 61 64 73 20 66 72 6f |filter r|eads fro|
|00002a80| 6d 20 73 74 64 69 6e 2e | 0a 0a 45 78 61 6d 70 6c |m stdin.|..Exampl|
|00002a90| 65 73 0a 2d 90 08 0a 42 | 61 73 69 63 20 55 73 61 |es.-...B|asic Usa|
|00002aa0| 67 65 0a 2d 90 0b 0a 41 | 73 73 75 6d 65 20 74 68 |ge.-...A|ssume th|
|00002ab0| 65 20 65 78 69 73 74 65 | 6e 63 65 20 6f 66 20 61 |e existe|nce of a|
|00002ac0| 20 73 65 72 69 65 73 20 | 6f 66 20 50 50 4d 20 69 | series |of PPM i|
|00002ad0| 6d 61 67 65 73 20 77 68 | 69 63 68 20 68 61 76 65 |mages wh|ich have|
|00002ae0| 20 74 68 65 20 6e 61 6d | 65 73 0a 0a 09 69 6d 61 | the nam|es...ima|
|00002af0| 67 65 30 31 2e 70 70 6d | 2c 0a 09 69 6d 61 67 65 |ge01.ppm|,..image|
|00002b00| 30 32 2e 70 70 6d 2c 0a | 09 69 6d 61 67 65 30 33 |02.ppm,.|.image03|
|00002b10| 2e 70 70 6d 2c 0a 09 65 | 74 63 2e 0a 0a 54 68 65 |.ppm,..e|tc...The|
|00002b20| 20 67 6f 61 6c 20 69 73 | 20 74 6f 20 70 72 6f 64 | goal is| to prod|
|00002b30| 75 63 65 20 61 20 46 4c | 49 20 61 6e 69 6d 61 74 |uce a FL|I animat|
|00002b40| 69 6f 6e 20 66 72 6f 6d | 20 74 68 65 73 65 20 66 |ion from| these f|
|00002b50| 69 6c 65 73 20 69 6e 20 | 74 68 65 20 67 69 76 65 |iles in |the give|
|00002b60| 6e 20 6f 72 64 65 72 2e | 0a 46 69 72 73 74 20 74 |n order.|.First t|
|00002b70| 68 65 20 3c 6c 69 73 74 | 2d 66 69 6c 65 3e 20 69 |he <list|-file> i|
|00002b80| 73 20 70 72 65 70 61 72 | 65 64 2e 20 57 65 20 63 |s prepar|ed. We c|
|00002b90| 68 6f 6f 73 65 20 74 68 | 65 20 6e 61 6d 65 20 60 |hoose th|e name `|
|00002ba0| 70 69 63 73 2e 6c 69 73 | 74 27 20 66 6f 72 20 74 |pics.lis|t' for t|
|00002bb0| 68 69 73 0a 66 69 6c 65 | 2e 20 54 68 65 20 66 69 |his.file|. The fi|
|00002bc0| 6c 65 20 69 73 20 67 65 | 6e 65 72 61 74 65 64 20 |le is ge|nerated |
|00002bd0| 62 79 3a 0a 0a 09 25 20 | 6c 73 20 2d 31 20 69 6d |by:...% |ls -1 im|
|00002be0| 61 67 65 3f 3f 2e 70 70 | 6d 20 3e 20 70 69 63 73 |age??.pp|m > pics|
|00002bf0| 2e 6c 69 73 74 0a 09 0a | 4e 6f 74 65 20 74 68 61 |.list...|Note tha|
|00002c00| 74 20 74 68 69 73 20 6f | 6e 6c 79 20 77 6f 72 6b |t this o|nly work|
|00002c10| 73 20 69 66 20 6e 6f 20 | 6f 74 68 65 72 20 66 69 |s if no |other fi|
|00002c20| 6c 65 73 20 69 6e 20 74 | 68 65 20 64 69 72 65 63 |les in t|he direc|
|00002c30| 74 6f 72 79 20 6d 61 74 | 63 68 20 74 68 65 0a 73 |tory mat|ch the.s|
|00002c40| 70 65 63 69 66 69 65 64 | 20 70 61 74 74 65 72 6e |pecified| pattern|
|00002c50| 20 61 6e 64 20 74 68 65 | 20 64 65 73 69 72 65 64 | and the| desired|
|00002c60| 20 6f 72 64 65 72 20 63 | 6f 72 72 65 73 70 6f 6e | order c|orrespon|
|00002c70| 64 73 20 74 6f 20 74 68 | 65 20 6e 75 6d 62 65 72 |ds to th|e number|
|00002c80| 69 6e 67 20 73 79 73 74 | 65 6d 0a 69 6e 20 74 68 |ing syst|em.in th|
|00002c90| 65 20 66 69 6c 65 20 6e | 61 6d 65 73 2e 20 49 6e |e file n|ames. In|
|00002ca0| 20 74 68 65 20 73 65 63 | 6f 6e 64 20 73 74 65 70 | the sec|ond step|
|00002cb0| 20 61 20 46 4c 49 20 66 | 69 6c 65 20 77 69 74 68 | a FLI f|ile with|
|00002cc0| 20 74 68 65 20 6e 61 6d | 65 20 60 61 6e 69 6d 2e | the nam|e `anim.|
|00002cd0| 66 6c 69 27 20 69 73 0a | 67 65 6e 65 72 61 74 65 |fli' is.|generate|
|00002ce0| 64 20 75 73 69 6e 67 20 | 74 68 65 20 63 6f 6d 6d |d using |the comm|
|00002cf0| 61 6e 64 3a 0a 0a 09 25 | 20 70 70 6d 32 66 6c 69 |and:...%| ppm2fli|
|00002d00| 20 70 69 63 73 2e 6c 69 | 73 74 20 61 6e 69 6d 2e | pics.li|st anim.|
|00002d10| 66 6c 69 0a 0a 54 68 65 | 20 67 65 6e 65 72 61 74 |fli..The| generat|
|00002d20| 65 64 20 61 6e 69 6d 61 | 74 69 6f 6e 20 68 61 73 |ed anima|tion has|
|00002d30| 20 74 68 65 20 72 65 73 | 6f 6c 75 74 69 6f 6e 20 | the res|olution |
|00002d40| 36 34 30 78 34 38 30 2e | 20 41 73 73 75 6d 65 20 |640x480.| Assume |
|00002d50| 74 68 61 74 20 74 68 65 | 20 67 69 76 65 6e 0a 69 |that the| given.i|
|00002d60| 6d 61 67 65 73 20 61 72 | 65 20 6f 6e 6c 79 20 33 |mages ar|e only 3|
|00002d70| 32 30 78 32 34 30 2e 20 | 54 68 65 6e 20 74 68 65 |20x240. |Then the|
|00002d80| 79 20 61 70 70 65 61 72 | 20 69 6e 20 74 68 65 20 |y appear| in the |
|00002d90| 6d 69 64 64 6c 65 20 6f | 66 20 74 68 65 20 36 34 |middle o|f the 64|
|00002da0| 30 78 34 38 30 0a 64 69 | 73 70 6c 61 79 20 61 72 |0x480.di|splay ar|
|00002db0| 65 61 20 61 6e 64 20 61 | 72 65 20 73 75 72 72 6f |ea and a|re surro|
|00002dc0| 75 6e 64 65 64 20 62 79 | 20 61 20 62 6f 72 64 65 |unded by| a borde|
|00002dd0| 72 20 61 72 65 61 2e 20 | 54 6f 20 61 76 6f 69 64 |r area. |To avoid|
|00002de0| 20 74 68 69 73 20 62 6f | 72 64 65 72 20 77 65 20 | this bo|rder we |
|00002df0| 66 69 74 0a 74 68 65 20 | 46 4c 49 20 72 65 73 6f |fit.the |FLI reso|
|00002e00| 6c 75 74 69 6f 6e 20 61 | 74 20 74 68 65 20 70 69 |lution a|t the pi|
|00002e10| 78 65 6c 20 73 69 7a 65 | 20 6f 66 20 74 68 65 20 |xel size| of the |
|00002e20| 69 6e 70 75 74 20 69 6d | 61 67 65 73 2e 20 54 68 |input im|ages. Th|
|00002e30| 69 73 20 63 61 6e 20 62 | 65 20 64 6f 6e 65 0a 62 |is can b|e done.b|
|00002e40| 79 3a 0a 0a 09 25 20 70 | 70 6d 32 66 6c 69 20 2d |y:...% p|pm2fli -|
|00002e50| 67 20 33 32 30 78 32 34 | 30 20 70 69 63 73 2e 6c |g 320x24|0 pics.l|
|00002e60| 69 73 74 20 61 6e 69 6d | 2e 66 6c 69 0a 0a 49 6e |ist anim|.fli..In|
|00002e70| 20 74 68 65 20 6e 65 78 | 74 20 65 78 61 6d 70 6c | the nex|t exampl|
|00002e80| 65 20 77 65 20 62 65 67 | 69 6e 20 77 69 74 68 20 |e we beg|in with |
|00002e90| 61 20 73 65 72 69 65 73 | 20 6f 66 20 37 36 38 78 |a series| of 768x|
|00002ea0| 35 31 32 20 69 6d 61 67 | 65 73 2e 20 54 68 65 20 |512 imag|es. The |
|00002eb0| 67 6f 61 6c 20 69 73 20 | 74 6f 0a 61 6e 69 6d 61 |goal is |to.anima|
|00002ec0| 74 65 20 74 68 65 73 65 | 20 69 6d 61 67 65 73 2c |te these| images,|
|00002ed0| 20 63 75 74 74 69 6e 67 | 20 6f 66 66 20 74 68 65 | cutting| off the|
|00002ee0| 20 74 6f 70 20 32 30 20 | 6c 69 6e 65 73 20 6f 66 | top 20 |lines of|
|00002ef0| 20 65 61 63 68 20 69 6d | 61 67 65 2e 20 41 67 61 | each im|age. Aga|
|00002f00| 69 6e 20 74 68 65 0a 6e | 61 6d 65 20 6f 66 20 74 |in the.n|ame of t|
|00002f10| 68 65 20 3c 6c 69 73 74 | 2d 66 69 6c 65 3e 20 69 |he <list|-file> i|
|00002f20| 73 20 60 70 69 63 73 2e | 6c 69 73 74 27 20 61 6e |s `pics.|list' an|
|00002f30| 64 20 74 68 65 20 6e 61 | 6d 65 20 6f 66 20 74 68 |d the na|me of th|
|00002f40| 65 20 67 65 6e 65 72 61 | 74 65 64 20 46 4c 49 20 |e genera|ted FLI |
|00002f50| 66 69 6c 65 0a 69 73 20 | 60 61 6e 69 6d 2e 66 6c |file.is |`anim.fl|
|00002f60| 69 27 2e 20 54 68 65 20 | 61 70 70 72 6f 70 72 69 |i'. The |appropri|
|00002f70| 61 74 65 20 63 6f 6d 6d | 61 6e 64 20 6c 69 6e 65 |ate comm|and line|
|00002f80| 20 69 73 3a 0a 0a 09 25 | 20 70 70 6d 32 66 6c 69 | is:...%| ppm2fli|
|00002f90| 20 2d 67 20 37 36 38 78 | 34 39 32 20 2b 6f 79 20 | -g 768x|492 +oy |
|00002fa0| 2d 32 30 20 70 69 63 73 | 2e 6c 69 73 74 20 61 6e |-20 pics|.list an|
|00002fb0| 69 6d 2e 66 6c 69 0a 0a | 4e 6f 74 65 20 31 29 3a |im.fli..|Note 1):|
|00002fc0| 20 34 39 32 20 3d 20 35 | 31 32 20 2d 20 32 30 2e | 492 = 5|12 - 20.|
|00002fd0| 0a 0a 4e 6f 74 65 20 32 | 29 3a 20 49 66 20 69 6e |..Note 2|): If in|
|00002fe0| 20 74 68 65 20 67 69 76 | 65 6e 20 65 78 61 6d 70 | the giv|en examp|
|00002ff0| 6c 65 20 74 68 65 20 60 | 2b 6f 79 27 20 6f 70 74 |le the `|+oy' opt|
|00003000| 69 6f 6e 20 77 61 73 20 | 6f 6d 69 74 74 65 64 2c |ion was |omitted,|
|00003010| 20 31 30 20 6c 69 6e 65 | 73 20 61 74 0a 20 90 09 | 10 line|s at. ..|
|00003020| 74 68 65 20 74 6f 70 20 | 61 6e 64 20 62 6f 74 74 |the top |and bott|
|00003030| 6f 6d 20 77 6f 75 6c 64 | 20 62 65 20 63 75 74 20 |om would| be cut |
|00003040| 6f 66 66 2e 0a 0a 52 65 | 61 64 20 46 69 6c 74 65 |off...Re|ad Filte|
|00003050| 72 73 0a 2d 90 0c 0a 20 | 20 57 65 20 61 73 73 75 |rs.-... | We assu|
|00003060| 6d 65 20 74 68 61 74 20 | 61 6c 6c 20 69 6e 70 75 |me that |all inpu|
|00003070| 74 20 69 6d 61 67 65 73 | 20 61 72 65 20 69 6e 20 |t images| are in |
|00003080| 74 68 65 20 47 49 46 20 | 66 6f 72 6d 61 74 20 61 |the GIF |format a|
|00003090| 6e 64 20 74 68 61 74 20 | 77 65 20 68 61 76 65 20 |nd that |we have |
|000030a0| 74 68 65 0a 50 42 4d 50 | 4c 55 53 20 70 61 63 6b |the.PBMP|LUS pack|
|000030b0| 61 67 65 20 77 69 74 68 | 20 74 68 65 20 70 72 6f |age with| the pro|
|000030c0| 67 72 61 6d 20 67 69 66 | 74 6f 70 70 6d 20 69 6e |gram gif|toppm in|
|000030d0| 73 74 61 6c 6c 65 64 2e | 20 4c 69 6b 65 20 69 6e |stalled.| Like in|
|000030e0| 20 74 68 65 20 65 78 61 | 6d 70 6c 65 0a 64 65 73 | the exa|mple.des|
|000030f0| 63 72 69 62 65 64 20 61 | 62 6f 76 65 20 77 65 20 |cribed a|bove we |
|00003100| 63 72 65 61 74 65 20 61 | 20 6c 69 73 74 20 66 69 |create a| list fi|
|00003110| 6c 65 20 77 69 74 68 20 | 74 68 65 20 6e 61 6d 65 |le with |the name|
|00003120| 73 20 6f 66 20 74 68 65 | 20 47 49 46 20 66 69 6c |s of the| GIF fil|
|00003130| 65 73 2e 20 54 68 65 6e | 0a 74 68 65 20 46 4c 49 |es. Then|.the FLI|
|00003140| 20 69 73 20 67 65 6e 65 | 72 61 74 65 64 20 62 79 | is gene|rated by|
|00003150| 20 74 68 65 20 63 6f 6d | 6d 61 6e 64 0a 0a 09 25 | the com|mand...%|
|00003160| 20 70 70 6d 32 66 6c 69 | 20 2d 66 67 69 66 74 6f | ppm2fli| -fgifto|
|00003170| 70 70 6d 20 70 69 63 73 | 2e 6c 69 73 74 20 61 6e |ppm pics|.list an|
|00003180| 69 6d 2e 66 6c 69 0a 0a | 49 6e 20 74 68 69 73 20 |im.fli..|In this |
|00003190| 63 61 73 65 20 61 6c 6c | 20 69 6d 61 67 65 73 20 |case all| images |
|000031a0| 67 69 76 65 6e 20 69 6e | 20 60 70 69 63 73 2e 6c |given in| `pics.l|
|000031b0| 69 73 74 27 20 68 61 76 | 65 20 74 6f 20 62 65 20 |ist' hav|e to be |
|000031c0| 69 6e 20 47 49 46 20 66 | 6f 72 6d 61 74 2e 20 0a |in GIF f|ormat. .|
|000031d0| 20 20 49 66 20 77 65 20 | 75 73 65 20 74 68 65 20 | If we |use the |
|000031e0| 46 42 4d 20 70 61 63 6b | 61 67 65 20 69 6e 73 74 |FBM pack|age inst|
|000031f0| 65 61 64 20 6f 66 20 50 | 42 4d 50 4c 55 53 20 77 |ead of P|BMPLUS w|
|00003200| 65 20 68 61 76 65 20 74 | 6f 20 75 73 65 20 61 6e |e have t|o use an|
|00003210| 6f 74 68 65 72 0a 75 74 | 69 6c 69 74 79 2e 20 4e |other.ut|ility. N|
|00003220| 6f 77 20 74 68 65 20 63 | 6f 6d 6d 61 6e 64 20 6c |ow the c|ommand l|
|00003230| 69 6e 65 20 6c 6f 6f 6b | 73 20 6c 69 6b 65 0a 0a |ine look|s like..|
|00003240| 09 25 20 70 70 6d 32 66 | 6c 69 20 2d 66 66 62 63 |.% ppm2f|li -ffbc|
|00003250| 61 74 20 70 69 63 73 2e | 6c 69 73 74 20 61 6e 69 |at pics.|list ani|
|00003260| 6d 2e 66 6c 69 0a 0a 54 | 68 65 20 75 74 69 6c 69 |m.fli..T|he utili|
|00003270| 74 79 20 66 62 63 61 74 | 20 63 6f 6e 76 65 72 74 |ty fbcat| convert|
|00003280| 73 20 74 68 65 20 47 49 | 46 20 69 6d 61 67 65 73 |s the GI|F images|
|00003290| 20 74 6f 20 46 42 4d 20 | 66 6f 72 6d 61 74 20 77 | to FBM |format w|
|000032a0| 68 69 63 68 20 69 73 20 | 72 65 61 64 20 62 79 0a |hich is |read by.|
|000032b0| 70 70 6d 32 66 6c 69 2e | 20 42 65 63 61 75 73 65 |ppm2fli.| Because|
|000032c0| 20 66 62 63 61 74 20 75 | 6e 64 65 72 73 74 61 6e | fbcat u|nderstan|
|000032d0| 64 73 20 61 6c 73 6f 20 | 6f 74 68 65 72 20 66 6f |ds also |other fo|
|000032e0| 72 6d 61 74 73 2c 20 6c | 69 6b 65 20 53 55 4e 20 |rmats, l|ike SUN |
|000032f0| 72 61 73 74 65 72 20 6f | 72 0a 46 42 4d 2c 20 74 |raster o|r.FBM, t|
|00003300| 68 65 20 69 6e 70 75 74 | 20 66 69 6c 65 73 20 63 |he input| files c|
|00003310| 61 6e 20 68 61 76 65 20 | 64 69 66 66 65 72 65 6e |an have |differen|
|00003320| 74 20 66 6f 72 6d 61 74 | 73 2e 0a 20 20 49 74 20 |t format|s.. It |
|00003330| 69 73 20 61 6c 73 6f 20 | 70 6f 73 73 69 62 6c 65 |is also |possible|
|00003340| 20 74 6f 20 75 73 65 20 | 73 68 65 6c 6c 20 73 63 | to use |shell sc|
|00003350| 72 69 70 74 73 20 61 73 | 20 66 69 6c 74 65 72 73 |ripts as| filters|
|00003360| 2e 20 46 6f 72 20 69 6e | 73 74 61 6e 63 65 20 77 |. For in|stance w|
|00003370| 65 20 77 61 6e 74 0a 74 | 6f 20 61 6e 69 6d 61 74 |e want.t|o animat|
|00003380| 65 20 61 20 72 61 79 2d | 74 72 61 63 65 72 20 73 |e a ray-|tracer s|
|00003390| 63 65 6e 65 2e 20 54 68 | 65 20 69 6d 61 67 65 73 |cene. Th|e images|
|000033a0| 20 77 65 72 65 20 67 65 | 6e 65 72 61 74 65 64 20 | were ge|nerated |
|000033b0| 62 79 20 50 4f 56 2d 52 | 61 79 20 62 75 74 20 77 |by POV-R|ay but w|
|000033c0| 65 0a 6d 61 64 65 20 61 | 20 62 69 67 20 6d 65 73 |e.made a| big mes|
|000033d0| 73 2e 20 53 6f 6d 65 20 | 61 72 65 20 73 74 6f 72 |s. Some |are stor|
|000033e0| 65 64 20 69 6e 20 51 52 | 54 20 66 6f 72 6d 61 74 |ed in QR|T format|
|000033f0| 2c 20 73 6f 6d 65 20 61 | 73 20 54 47 41 20 66 69 |, some a|s TGA fi|
|00003400| 6c 65 73 20 61 6e 64 20 | 6f 74 68 65 72 73 0a 61 |les and |others.a|
|00003410| 72 65 20 61 6c 72 65 61 | 64 79 20 63 6f 6e 76 65 |re alrea|dy conve|
|00003420| 72 74 65 64 20 74 6f 20 | 50 50 4d 2e 20 54 6f 20 |rted to |PPM. To |
|00003430| 73 61 76 65 20 64 69 73 | 6b 20 73 70 61 63 65 20 |save dis|k space |
|00003440| 73 6f 6d 65 20 66 69 6c | 65 73 20 61 72 65 20 63 |some fil|es are c|
|00003450| 6f 6d 70 72 65 73 73 65 | 64 20 62 79 0a 67 7a 69 |ompresse|d by.gzi|
|00003460| 70 2e 20 57 65 20 61 72 | 65 20 69 6e 20 6c 75 63 |p. We ar|e in luc|
|00003470| 6b 20 62 65 63 61 75 73 | 65 20 77 65 20 75 73 65 |k becaus|e we use|
|00003480| 64 20 61 6c 77 61 79 73 | 20 74 68 65 20 63 6f 72 |d always| the cor|
|00003490| 72 65 63 74 20 65 78 74 | 65 6e 73 69 6f 6e 73 20 |rect ext|ensions |
|000034a0| 69 6e 20 74 68 65 0a 66 | 69 6c 65 20 6e 61 6d 65 |in the.f|ile name|
|000034b0| 73 2e 20 57 65 20 68 61 | 76 65 20 67 75 6e 7a 69 |s. We ha|ve gunzi|
|000034c0| 70 20 69 6e 73 74 61 6c | 6c 65 64 20 61 6e 64 20 |p instal|led and |
|000034d0| 74 68 65 20 75 74 69 6c | 69 74 69 65 73 20 71 72 |the util|ities qr|
|000034e0| 74 74 6f 70 70 6d 20 61 | 6e 64 20 74 67 61 74 6f |ttoppm a|nd tgato|
|000034f0| 70 70 6d 0a 61 72 65 20 | 61 76 61 69 6c 61 62 6c |ppm.are |availabl|
|00003500| 65 2e 20 57 65 20 65 64 | 69 74 20 61 20 73 68 65 |e. We ed|it a she|
|00003510| 6c 6c 20 73 63 72 69 70 | 74 20 77 69 74 68 20 74 |ll scrip|t with t|
|00003520| 68 65 20 66 6f 6c 6c 6f | 77 69 6e 67 20 63 6f 6e |he follo|wing con|
|00003530| 74 65 6e 74 3a 0a 0a 09 | 23 21 20 2f 62 69 6e 2f |tent:...|#! /bin/|
|00003540| 6b 73 68 0a 0a 09 6e 61 | 6d 65 3d 24 31 0a 09 63 |ksh...na|me=$1..c|
|00003550| 6d 64 3d 63 61 74 0a 0a | 09 66 75 6e 63 74 69 6f |md=cat..|.functio|
|00003560| 6e 20 69 73 69 74 0a 09 | 7b 0a 09 09 62 61 73 65 |n isit..|{...base|
|00003570| 3d 24 7b 6e 61 6d 65 25 | 2e 24 31 7d 0a 09 09 69 |=${name%|.$1}...i|
|00003580| 66 20 74 65 73 74 20 22 | 24 6e 61 6d 65 22 20 3d |f test "|$name" =|
|00003590| 20 22 24 62 61 73 65 2e | 24 31 22 3b 20 74 68 65 | "$base.|$1"; the|
|000035a0| 6e 20 63 6d 64 3d 24 32 | 3b 20 66 69 3b 0a 09 7d |n cmd=$2|; fi;..}|
|000035b0| 0a 0a 09 69 73 69 74 20 | 22 67 7a 22 09 22 67 75 |...isit |"gz"."gu|
|000035c0| 6e 7a 69 70 22 0a 09 69 | 73 69 74 20 22 71 72 74 |nzip"..i|sit "qrt|
|000035d0| 22 09 22 71 72 74 74 6f | 70 70 6d 22 0a 09 69 73 |"."qrtto|ppm"..is|
|000035e0| 69 74 20 22 71 72 74 2e | 67 7a 22 09 22 28 67 75 |it "qrt.|gz"."(gu|
|000035f0| 6e 7a 69 70 20 7c 20 71 | 72 74 74 6f 70 70 6d 29 |nzip | q|rttoppm)|
|00003600| 22 0a 09 69 73 69 74 20 | 22 74 67 61 22 09 22 74 |"..isit |"tga"."t|
|00003610| 67 61 74 6f 70 70 6d 22 | 0a 09 69 73 69 74 20 22 |gatoppm"|..isit "|
|00003620| 74 67 61 2e 67 7a 22 09 | 22 28 67 75 6e 7a 69 70 |tga.gz".|"(gunzip|
|00003630| 20 7c 20 74 67 61 74 6f | 70 70 6d 29 22 0a 0a 09 | | tgato|ppm)"...|
|00003640| 24 63 6d 64 20 3c 20 24 | 6e 61 6d 65 0a 0a 54 68 |$cmd < $|name..Th|
|00003650| 65 20 73 63 72 69 70 74 | 20 69 73 20 73 74 6f 72 |e script| is stor|
|00003660| 65 64 20 61 73 20 60 6d | 79 66 69 6c 74 65 72 27 |ed as `m|yfilter'|
|00003670| 20 69 6e 20 74 68 65 20 | 63 75 72 72 65 6e 74 20 | in the |current |
|00003680| 64 69 72 65 63 74 6f 72 | 79 20 28 2e 90 03 20 63 |director|y (... c|
|00003690| 68 6d 6f 64 20 61 2b 78 | 0a 6d 79 66 69 6c 74 65 |hmod a+x|.myfilte|
|000036a0| 72 29 2e 20 54 6f 20 75 | 73 65 20 74 68 69 73 20 |r). To u|se this |
|000036b0| 66 69 6c 74 65 72 20 77 | 65 20 74 79 70 65 0a 0a |filter w|e type..|
|000036c0| 09 25 20 70 70 6d 32 66 | 6c 69 20 2b 66 6d 79 66 |.% ppm2f|li +fmyf|
|000036d0| 69 6c 74 65 72 20 70 69 | 63 73 2e 6c 69 73 74 20 |ilter pi|cs.list |
|000036e0| 61 6e 69 6d 2e 66 6c 69 | 0a 0a 4e 6f 74 65 20 74 |anim.fli|..Note t|
|000036f0| 68 61 74 20 6e 6f 77 20 | 60 2b 66 27 20 69 73 20 |hat now |`+f' is |
|00003700| 72 65 71 75 69 72 65 64 | 20 62 65 63 61 75 73 65 |required| because|
|00003710| 20 6f 75 72 20 66 69 6c | 74 65 72 20 64 6f 65 73 | our fil|ter does|
|00003720| 6e 27 74 20 72 65 61 64 | 20 66 72 6f 6d 20 73 74 |n't read| from st|
|00003730| 64 69 6e 2e 20 49 74 0a | 6e 65 65 64 73 20 74 68 |din. It.|needs th|
|00003740| 65 20 66 69 6c 65 20 6e | 61 6d 65 20 61 73 20 70 |e file n|ame as p|
|00003750| 61 72 61 6d 65 74 65 72 | 20 74 6f 20 63 68 6f 6f |arameter| to choo|
|00003760| 73 65 20 74 68 65 20 63 | 6f 72 72 65 73 70 6f 6e |se the c|orrespon|
|00003770| 64 69 6e 67 20 75 74 69 | 6c 69 74 79 2e 20 54 68 |ding uti|lity. Th|
|00003780| 65 0a 67 69 76 65 6e 20 | 73 63 72 69 70 74 20 77 |e.given |script w|
|00003790| 6f 72 6b 73 20 6f 6e 6c | 79 20 66 6f 72 20 74 68 |orks onl|y for th|
|000037a0| 65 20 42 6f 75 72 6e 65 | 2f 4b 6f 72 6e 20 73 68 |e Bourne|/Korn sh|
|000037b0| 65 6c 6c 2e 20 0a 20 20 | 57 68 65 6e 20 74 68 65 |ell. . |When the|
|000037c0| 20 66 69 6c 74 65 72 20 | 72 65 71 75 69 72 65 73 | filter |requires|
|000037d0| 20 61 64 64 69 74 69 6f | 6e 61 6c 20 70 61 72 61 | additio|nal para|
|000037e0| 6d 65 74 65 72 73 20 74 | 68 65 79 20 63 61 6e 20 |meters t|hey can |
|000037f0| 62 65 20 70 61 73 73 65 | 64 20 69 6e 20 61 6e 0a |be passe|d in an.|
|00003800| 65 61 73 79 20 77 61 79 | 2e 20 46 6f 72 20 69 6e |easy way|. For in|
|00003810| 73 74 61 6e 63 65 20 77 | 6f 72 6b 73 0a 0a 09 25 |stance w|orks...%|
|00003820| 20 70 70 6d 32 66 6c 69 | 20 2d 66 20 22 67 7a 69 | ppm2fli| -f "gzi|
|00003830| 70 20 2d 64 22 20 70 69 | 63 73 2e 6c 69 73 74 20 |p -d" pi|cs.list |
|00003840| 61 6e 69 6d 2e 66 6c 69 | 0a 0a 66 6f 72 20 61 20 |anim.fli|..for a |
|00003850| 73 65 72 69 65 73 20 6f | 66 20 22 67 7a 69 70 70 |series o|f "gzipp|
|00003860| 65 64 22 20 69 6e 70 75 | 74 20 66 69 6c 65 73 2e |ed" inpu|t files.|
|00003870| 0a 0a 20 20 45 76 65 6e | 20 6d 6f 72 65 20 63 6f |.. Even| more co|
|00003880| 6d 70 6c 69 63 61 74 65 | 64 20 74 68 69 6e 67 73 |mplicate|d things|
|00003890| 20 61 72 65 20 70 6f 73 | 73 69 62 6c 65 2e 20 46 | are pos|sible. F|
|000038a0| 6f 72 20 65 78 61 6d 70 | 6c 65 20 74 68 65 20 67 |or examp|le the g|
|000038b0| 68 6f 73 74 73 63 72 69 | 70 74 0a 70 72 6f 67 72 |hostscri|pt.progr|
|000038c0| 61 6d 20 63 61 6e 20 62 | 65 20 75 73 65 64 20 61 |am can b|e used a|
|000038d0| 73 20 72 65 61 64 20 66 | 69 6c 74 65 72 20 74 6f |s read f|ilter to|
|000038e0| 20 61 6e 69 6d 61 74 65 | 20 61 20 73 65 72 69 65 | animate| a serie|
|000038f0| 73 20 6f 66 20 50 53 20 | 69 6d 61 67 65 73 2e 20 |s of PS |images. |
|00003900| 54 68 65 0a 6e 65 63 65 | 73 73 61 72 79 20 6f 70 |The.nece|ssary op|
|00003910| 74 69 6f 6e 20 6d 61 79 | 20 6c 6f 6f 6b 20 6c 69 |tion may| look li|
|00003920| 6b 65 0a 0a 20 20 2d 66 | 20 22 67 73 20 2d 67 33 |ke.. -f| "gs -g3|
|00003930| 32 30 78 34 38 30 20 2d | 71 20 2d 72 33 36 20 2d |20x480 -|q -r36 -|
|00003940| 73 44 45 56 49 43 45 3d | 70 70 6d 20 2d 73 4f 75 |sDEVICE=|ppm -sOu|
|00003950| 74 70 75 74 46 69 6c 65 | 3d 2d 20 2d 22 0a 0a 77 |tputFile|=- -"..w|
|00003960| 68 69 63 68 20 77 6f 72 | 6b 73 20 66 6f 72 20 74 |hich wor|ks for t|
|00003970| 68 65 20 60 74 69 67 65 | 72 2e 70 73 27 20 65 78 |he `tige|r.ps' ex|
|00003980| 61 6d 70 6c 65 2e 20 4e | 6f 74 65 20 74 68 61 74 |ample. N|ote that|
|00003990| 20 74 6f 20 72 65 64 75 | 63 65 20 74 68 65 20 64 | to redu|ce the d|
|000039a0| 61 74 61 20 66 6c 6f 77 | 0a 60 70 70 6d 72 61 77 |ata flow|.`ppmraw|
|000039b0| 27 20 73 68 6f 75 6c 64 | 20 62 65 20 70 72 65 66 |' should| be pref|
|000039c0| 65 72 72 65 64 20 74 6f | 20 74 68 65 20 60 70 70 |erred to| the `pp|
|000039d0| 6d 27 20 64 65 76 69 63 | 65 2e 0a 0a 20 20 57 68 |m' devic|e... Wh|
|000039e0| 65 6e 20 61 20 63 65 72 | 74 61 69 6e 20 66 69 6c |en a cer|tain fil|
|000039f0| 74 65 72 20 69 73 20 6f | 66 74 65 6e 20 75 73 65 |ter is o|ften use|
|00003a00| 64 2c 20 74 68 65 20 65 | 6e 76 69 72 6f 6e 6d 65 |d, the e|nvironme|
|00003a10| 6e 74 20 76 61 72 69 61 | 62 6c 65 20 50 50 4d 32 |nt varia|ble PPM2|
|00003a20| 46 4c 49 46 49 4c 54 45 | 52 0a 63 61 6e 20 62 65 |FLIFILTE|R.can be|
|00003a30| 20 73 65 74 20 74 6f 20 | 64 65 66 69 6e 65 20 74 | set to |define t|
|00003a40| 68 65 20 66 69 6c 74 65 | 72 2e 20 49 6e 20 61 20 |he filte|r. In a |
|00003a50| 62 61 73 68 20 65 6e 76 | 69 72 6f 6e 6d 65 6e 74 |bash env|ironment|
|00003a60| 20 74 68 69 73 20 6d 61 | 79 20 6c 6f 6f 6b 20 6c | this ma|y look l|
|00003a70| 69 6b 65 0a 0a 09 25 20 | 65 78 70 6f 72 74 20 50 |ike...% |export P|
|00003a80| 50 4d 32 46 4c 49 46 49 | 4c 54 45 52 3d 2d 66 62 |PM2FLIFI|LTER=-fb|
|00003a90| 63 61 74 0a 0a 54 68 65 | 6e 20 61 6c 77 61 79 73 |cat..The|n always|
|00003aa0| 20 74 68 65 20 66 62 63 | 61 74 20 75 74 69 6c 69 | the fbc|at utili|
|00003ab0| 74 79 20 69 73 20 75 73 | 65 64 20 61 73 20 72 65 |ty is us|ed as re|
|00003ac0| 61 64 20 66 69 6c 74 65 | 72 20 75 6e 6c 65 73 73 |ad filte|r unless|
|00003ad0| 20 73 6f 6d 65 74 68 69 | 6e 67 20 65 6c 73 65 20 | somethi|ng else |
|00003ae0| 69 73 0a 64 65 66 69 6e | 65 64 20 69 6e 20 74 68 |is.defin|ed in th|
|00003af0| 65 20 63 6f 6d 6d 61 6e | 64 20 6c 69 6e 65 2e 0a |e comman|d line..|
|00003b00| 0a 55 73 61 67 65 20 6f | 66 20 61 20 4d 61 70 20 |.Usage o|f a Map |
|00003b10| 46 69 6c 65 0a 2d 90 13 | 0a 20 20 41 67 61 69 6e |File.-..|. Again|
|00003b20| 20 77 65 20 61 73 73 75 | 6d 65 20 61 20 73 65 72 | we assu|me a ser|
|00003b30| 69 65 73 20 6f 66 20 69 | 6d 61 67 65 73 2c 20 62 |ies of i|mages, b|
|00003b40| 75 74 20 6e 6f 77 20 74 | 68 65 20 67 6f 61 6c 20 |ut now t|he goal |
|00003b50| 69 73 20 74 6f 20 70 72 | 6f 64 75 63 65 20 74 77 |is to pr|oduce tw|
|00003b60| 6f 0a 61 6e 69 6d 61 74 | 69 6f 6e 73 20 77 69 74 |o.animat|ions wit|
|00003b70| 68 20 61 20 64 69 66 66 | 65 72 65 6e 74 20 6f 72 |h a diff|erent or|
|00003b80| 64 65 72 20 6f 66 20 74 | 68 65 20 69 6d 61 67 65 |der of t|he image|
|00003b90| 73 2e 20 46 6f 72 20 74 | 68 69 73 20 70 75 72 70 |s. For t|his purp|
|00003ba0| 6f 73 65 20 77 65 20 65 | 64 69 74 20 62 79 0a 68 |ose we e|dit by.h|
|00003bb0| 61 6e 64 20 74 77 6f 20 | 6c 69 73 74 20 66 69 6c |and two |list fil|
|00003bc0| 65 73 20 60 6f 72 64 65 | 72 31 2e 6c 73 74 27 20 |es `orde|r1.lst' |
|00003bd0| 61 6e 64 20 60 6f 72 64 | 65 72 32 2e 6c 73 74 27 |and `ord|er2.lst'|
|00003be0| 2e 20 54 6f 20 73 61 76 | 65 20 74 69 6d 65 20 61 |. To sav|e time a|
|00003bf0| 6e 64 20 74 6f 20 61 76 | 6f 69 64 0a 61 20 72 65 |nd to av|oid.a re|
|00003c00| 70 65 61 74 65 64 20 73 | 63 61 6e 6e 69 6e 67 20 |peated s|canning |
|00003c10| 6f 66 20 74 68 65 20 69 | 6e 70 75 74 20 69 6d 61 |of the i|nput ima|
|00003c20| 67 65 73 20 74 68 65 20 | 73 63 61 6e 6e 69 6e 67 |ges the |scanning|
|00003c30| 20 69 73 20 64 6f 6e 65 | 20 69 6e 20 61 20 73 65 | is done| in a se|
|00003c40| 70 61 72 61 74 65 0a 73 | 74 65 70 2e 20 54 68 65 |parate.s|tep. The|
|00003c50| 20 72 65 73 75 6c 74 20 | 6f 66 20 74 68 65 20 73 | result |of the s|
|00003c60| 63 61 6e 6e 69 6e 67 20 | 69 73 20 74 68 65 20 63 |canning |is the c|
|00003c70| 6f 6d 6d 6f 6e 20 63 6f | 6c 6f 72 20 74 61 62 6c |ommon co|lor tabl|
|00003c80| 65 2e 20 54 68 69 73 20 | 74 61 62 6c 65 20 68 61 |e. This |table ha|
|00003c90| 73 20 74 6f 0a 62 65 20 | 73 74 6f 72 65 64 20 69 |s to.be |stored i|
|00003ca0| 6e 20 61 6e 20 65 78 74 | 72 61 20 66 69 6c 65 2e |n an ext|ra file.|
|00003cb0| 20 57 65 20 63 68 6f 6f | 73 65 20 74 68 65 20 6e | We choo|se the n|
|00003cc0| 61 6d 65 20 60 63 74 2e | 70 70 6d 27 20 66 6f 72 |ame `ct.|ppm' for|
|00003cd0| 20 74 68 69 73 20 66 69 | 6c 65 2e 20 54 68 65 6e | this fi|le. Then|
|00003ce0| 0a 74 68 65 20 66 69 72 | 73 74 20 73 74 65 70 20 |.the fir|st step |
|00003cf0| 6c 6f 6f 6b 73 20 6c 69 | 6b 65 3a 0a 0a 09 25 20 |looks li|ke:...% |
|00003d00| 70 70 6d 32 66 6c 69 20 | 2d 77 20 63 74 2e 70 70 |ppm2fli |-w ct.pp|
|00003d10| 6d 20 6f 72 64 65 72 31 | 2e 6c 73 74 0a 0a 49 6e |m order1|.lst..In|
|00003d20| 20 74 68 65 20 6e 65 78 | 74 20 73 74 65 70 20 74 | the nex|t step t|
|00003d30| 68 65 20 66 69 72 73 74 | 20 61 6e 69 6d 61 74 69 |he first| animati|
|00003d40| 6f 6e 20 69 73 20 67 65 | 6e 65 72 61 74 65 64 3a |on is ge|nerated:|
|00003d50| 0a 0a 09 25 20 70 70 6d | 32 66 6c 69 20 2d 6d 20 |...% ppm|2fli -m |
|00003d60| 63 74 2e 70 70 6d 20 6f | 72 64 65 72 31 2e 6c 73 |ct.ppm o|rder1.ls|
|00003d70| 74 20 6f 72 64 65 72 31 | 2e 66 6c 69 0a 0a 41 6e |t order1|.fli..An|
|00003d80| 64 20 66 69 6e 61 6c 6c | 79 3a 0a 0a 09 25 20 70 |d finall|y:...% p|
|00003d90| 70 6d 32 66 6c 69 20 2d | 6d 20 63 74 2e 70 70 6d |pm2fli -|m ct.ppm|
|00003da0| 20 6f 72 64 65 72 32 2e | 6c 73 74 20 6f 72 64 65 | order2.|lst orde|
|00003db0| 72 32 2e 66 6c 69 0a 0a | 55 73 75 61 6c 6c 79 2c |r2.fli..|Usually,|
|00003dc0| 20 69 66 20 6e 6f 20 69 | 6e 64 69 76 69 64 75 61 | if no i|ndividua|
|00003dd0| 6c 20 71 75 61 6e 74 69 | 7a 61 74 69 6f 6e 20 69 |l quanti|zation i|
|00003de0| 73 20 75 73 65 64 2c 20 | 61 6c 6c 20 69 6d 61 67 |s used, |all imag|
|00003df0| 65 73 20 61 72 65 20 72 | 65 61 64 20 74 77 69 63 |es are r|ead twic|
|00003e00| 65 2e 0a 4f 6e 63 65 20 | 66 6f 72 20 67 65 6e 65 |e..Once |for gene|
|00003e10| 72 61 74 69 6e 67 20 74 | 68 65 20 63 6f 6c 6f 72 |rating t|he color|
|00003e20| 20 74 61 62 6c 65 20 61 | 6e 64 20 74 68 65 20 73 | table a|nd the s|
|00003e30| 65 63 6f 6e 64 20 74 69 | 6d 65 20 77 68 65 6e 20 |econd ti|me when |
|00003e40| 74 68 65 20 71 75 61 6e | 74 69 7a 65 20 26 0a 61 |the quan|tize &.a|
|00003e50| 73 73 65 6d 62 6c 69 6e | 67 20 69 73 20 64 6f 6e |ssemblin|g is don|
|00003e60| 65 2e 20 54 68 75 73 2c | 20 74 68 65 20 6f 70 74 |e. Thus,| the opt|
|00003e70| 69 6f 6e 73 20 60 2d 6d | 27 20 61 6e 64 20 60 2d |ions `-m|' and `-|
|00003e80| 77 27 20 63 61 6e 20 68 | 65 6c 70 20 74 6f 20 73 |w' can h|elp to s|
|00003e90| 61 76 65 20 61 20 6c 6f | 74 20 6f 66 0a 74 69 6d |ave a lo|t of.tim|
|00003ea0| 65 2c 20 65 73 70 65 63 | 69 61 6c 6c 79 20 77 68 |e, espec|ially wh|
|00003eb0| 65 6e 20 74 68 65 20 69 | 6e 70 75 74 20 66 69 6c |en the i|nput fil|
|00003ec0| 65 73 20 61 72 65 20 63 | 6f 6d 70 72 65 73 73 65 |es are c|ompresse|
|00003ed0| 64 20 6f 72 20 68 61 76 | 65 20 61 6e 6f 74 68 65 |d or hav|e anothe|
|00003ee0| 72 20 66 69 6c 65 0a 66 | 6f 72 6d 61 74 20 61 6e |r file.f|ormat an|
|00003ef0| 64 20 65 61 63 68 20 72 | 65 61 64 69 6e 67 20 74 |d each r|eading t|
|00003f00| 68 72 6f 75 67 68 20 61 | 20 66 69 6c 74 65 72 20 |hrough a| filter |
|00003f10| 72 65 71 75 69 72 65 73 | 20 6d 6f 72 65 20 74 69 |requires| more ti|
|00003f20| 6d 65 2e 0a 0a 20 20 4e | 6f 74 65 20 74 68 61 74 |me... N|ote that|
|00003f30| 20 74 68 65 20 6d 61 70 | 20 66 69 6c 65 20 69 73 | the map| file is|
|00003f40| 20 6e 6f 74 20 72 65 61 | 64 20 74 68 72 6f 75 67 | not rea|d throug|
|00003f50| 68 20 61 20 67 69 76 65 | 6e 20 66 69 6c 74 65 72 |h a give|n filter|
|00003f60| 2e 20 54 68 75 73 2c 20 | 74 68 69 73 20 66 69 6c |. Thus, |this fil|
|00003f70| 65 0a 61 6c 77 61 79 73 | 20 68 61 73 20 74 6f 20 |e.always| has to |
|00003f80| 62 65 20 69 6e 20 6f 6e | 65 20 6f 66 20 74 68 65 |be in on|e of the|
|00003f90| 20 66 6f 72 6d 61 74 73 | 20 77 68 69 63 68 20 63 | formats| which c|
|00003fa0| 61 6e 20 62 65 20 72 65 | 61 64 20 64 69 72 65 63 |an be re|ad direc|
|00003fb0| 74 6c 79 2e 20 0a 0a 51 | 75 61 6e 74 69 7a 61 74 |tly. ..Q|uantizat|
|00003fc0| 69 6f 6e 20 75 73 69 6e | 67 20 61 6e 20 65 78 74 |ion usin|g an ext|
|00003fd0| 65 72 6e 61 6c 20 75 74 | 69 6c 69 74 79 0a 2d 90 |ernal ut|ility.-.|
|00003fe0| 26 0a 20 20 41 20 6d 6f | 64 69 66 69 65 64 20 76 |&. A mo|dified v|
|00003ff0| 65 72 73 69 6f 6e 20 6f | 66 20 74 68 65 20 4f 63 |ersion o|f the Oc|
|00004000| 74 72 65 65 20 61 6c 67 | 6f 72 69 74 68 6d 20 69 |tree alg|orithm i|
|00004010| 73 20 69 6d 70 6c 65 6d | 65 6e 74 65 64 20 69 6e |s implem|ented in|
|00004020| 20 70 70 6d 32 66 6c 69 | 2e 20 42 79 0a 64 65 66 | ppm2fli|. By.def|
|00004030| 61 75 6c 74 20 74 68 69 | 73 20 61 6c 67 6f 72 69 |ault thi|s algori|
|00004040| 74 68 6d 20 69 73 20 75 | 73 65 64 20 77 68 65 6e |thm is u|sed when|
|00004050| 20 74 68 65 20 69 6e 70 | 75 74 20 66 69 6c 65 73 | the inp|ut files|
|00004060| 20 63 6f 6e 74 61 69 6e | 20 6d 6f 72 65 20 74 68 | contain| more th|
|00004070| 61 6e 20 32 35 36 0a 63 | 6f 6c 6f 72 73 2e 20 54 |an 256.c|olors. T|
|00004080| 68 69 73 20 6d 61 78 69 | 6d 75 6d 20 6f 66 20 63 |his maxi|mum of c|
|00004090| 6f 6c 6f 72 73 20 63 61 | 6e 20 62 65 20 63 68 61 |olors ca|n be cha|
|000040a0| 6e 67 65 64 20 74 6f 20 | 6c 6f 77 65 72 20 76 61 |nged to |lower va|
|000040b0| 6c 75 65 73 20 75 73 69 | 6e 67 20 74 68 65 0a 6f |lues usi|ng the.o|
|000040c0| 70 74 69 6f 6e 20 60 2d | 51 63 27 2e 20 53 6f 6d |ption `-|Qc'. Som|
|000040d0| 65 74 69 6d 65 73 20 69 | 74 20 6d 61 79 20 62 65 |etimes i|t may be|
|000040e0| 20 64 65 73 69 72 61 62 | 6c 65 20 74 6f 20 75 73 | desirab|le to us|
|000040f0| 65 20 61 20 64 69 66 66 | 65 72 65 6e 74 20 71 75 |e a diff|erent qu|
|00004100| 61 6e 74 69 7a 61 74 69 | 6f 6e 0a 61 6c 67 6f 72 |antizati|on.algor|
|00004110| 69 74 68 6d 2e 20 49 6e | 20 74 68 65 20 66 6f 6c |ithm. In| the fol|
|00004120| 6c 6f 77 69 6e 67 20 65 | 78 61 6d 70 6c 65 20 77 |lowing e|xample w|
|00004130| 65 20 77 61 6e 74 20 74 | 6f 20 61 6e 69 6d 61 74 |e want t|o animat|
|00004140| 65 20 61 20 72 61 79 2d | 74 72 61 63 65 72 20 73 |e a ray-|tracer s|
|00004150| 63 65 6e 65 0a 67 65 6e | 65 72 61 74 65 64 20 62 |cene.gen|erated b|
|00004160| 79 20 74 68 65 20 50 4f | 56 2d 52 61 79 20 70 72 |y the PO|V-Ray pr|
|00004170| 6f 67 72 61 6d 2e 20 54 | 68 65 20 69 6d 61 67 65 |ogram. T|he image|
|00004180| 20 66 69 6c 65 73 20 61 | 72 65 20 69 6e 20 67 7a | files a|re in gz|
|00004190| 69 70 70 65 64 20 51 52 | 54 20 66 6f 72 6d 61 74 |ipped QR|T format|
|000041a0| 0a 61 6e 64 20 77 65 20 | 68 61 76 65 20 74 68 65 |.and we |have the|
|000041b0| 20 50 42 4d 20 70 61 63 | 6b 61 67 65 20 77 69 74 | PBM pac|kage wit|
|000041c0| 68 20 74 68 65 20 75 74 | 69 6c 69 74 79 20 71 72 |h the ut|ility qr|
|000041d0| 74 74 6f 70 70 6d 20 69 | 6e 73 74 61 6c 6c 65 64 |ttoppm i|nstalled|
|000041e0| 2e 20 41 67 61 69 6e 20 | 74 68 65 0a 3c 6c 69 73 |. Again |the.<lis|
|000041f0| 74 2d 66 69 6c 65 3e 20 | 77 69 74 68 20 74 68 65 |t-file> |with the|
|00004200| 20 6e 61 6d 65 73 20 6f | 66 20 74 68 65 20 51 52 | names o|f the QR|
|00004210| 54 20 69 6d 61 67 65 73 | 20 68 61 73 20 74 68 65 |T images| has the|
|00004220| 20 6e 61 6d 65 20 60 70 | 69 63 73 2e 6c 69 73 74 | name `p|ics.list|
|00004230| 27 2e 20 54 68 65 0a 71 | 75 61 6e 74 69 7a 61 74 |'. The.q|uantizat|
|00004240| 69 6f 6e 20 73 68 61 6c | 6c 20 62 65 20 64 6f 6e |ion shal|l be don|
|00004250| 65 20 77 69 74 68 20 74 | 68 65 20 70 70 6d 71 75 |e with t|he ppmqu|
|00004260| 61 6e 74 20 70 72 6f 67 | 72 61 6d 20 6f 66 20 74 |ant prog|ram of t|
|00004270| 68 65 20 50 42 4d 20 70 | 61 63 6b 61 67 65 2c 0a |he PBM p|ackage,.|
|00004280| 62 65 63 61 75 73 65 20 | 69 74 20 6f 66 66 65 72 |because |it offer|
|00004290| 73 20 74 68 65 20 70 6f | 73 73 69 62 69 6c 69 74 |s the po|ssibilit|
|000042a0| 79 20 6f 66 20 46 6c 6f | 79 64 2d 53 74 65 69 6e |y of Flo|yd-Stein|
|000042b0| 62 65 72 67 20 65 72 72 | 6f 72 20 64 69 66 66 75 |berg err|or diffu|
|000042c0| 73 69 6f 6e 2e 0a 4e 65 | 76 65 72 74 68 65 6c 65 |sion..Ne|verthele|
|000042d0| 73 73 20 77 65 20 77 6f | 75 6c 64 20 6c 69 6b 65 |ss we wo|uld like|
|000042e0| 20 74 6f 20 67 65 74 20 | 61 20 46 4c 49 20 61 6e | to get |a FLI an|
|000042f0| 69 6d 61 74 69 6f 6e 20 | 77 68 65 72 65 20 74 68 |imation |where th|
|00004300| 65 20 63 6f 6c 6f 72 20 | 74 61 62 6c 65 20 69 73 |e color |table is|
|00004310| 0a 73 74 61 74 69 63 2e | 20 54 68 65 6e 20 77 65 |.static.| Then we|
|00004320| 20 64 6f 20 69 6e 20 74 | 68 65 20 66 69 72 73 74 | do in t|he first|
|00004330| 20 73 74 65 70 0a 0a 09 | 25 20 70 70 6d 32 66 6c | step...|% ppm2fl|
|00004340| 69 20 70 69 63 73 2e 6c | 69 73 74 20 2d 77 20 63 |i pics.l|ist -w c|
|00004350| 74 2e 70 70 6d 20 2d 66 | 22 28 67 75 6e 7a 69 70 |t.ppm -f|"(gunzip|
|00004360| 20 7c 20 71 72 74 74 6f | 70 70 6d 29 22 0a 0a 42 | | qrtto|ppm)"..B|
|00004370| 79 20 74 68 61 74 20 74 | 68 65 20 63 6f 6c 6f 72 |y that t|he color|
|00004380| 20 74 61 62 6c 65 20 69 | 73 20 65 76 61 6c 75 61 | table i|s evalua|
|00004390| 74 65 64 20 62 79 20 74 | 68 65 20 4f 63 74 72 65 |ted by t|he Octre|
|000043a0| 65 20 61 6c 67 6f 72 69 | 74 68 6d 20 61 6e 64 20 |e algori|thm and |
|000043b0| 73 74 6f 72 65 64 20 69 | 6e 0a 74 68 65 20 66 69 |stored i|n.the fi|
|000043c0| 6c 65 20 60 63 74 2e 70 | 70 6d 27 2e 20 54 6f 20 |le `ct.p|pm'. To |
|000043d0| 61 76 6f 69 64 20 61 20 | 65 78 63 65 65 64 69 6e |avoid a |exceedin|
|000043e0| 67 20 63 6f 6d 6d 61 6e | 64 20 6c 69 6e 65 20 77 |g comman|d line w|
|000043f0| 65 20 65 64 69 74 20 61 | 20 73 68 65 6c 6c 20 73 |e edit a| shell s|
|00004400| 63 72 69 70 74 0a 77 69 | 74 68 20 74 68 65 20 63 |cript.wi|th the c|
|00004410| 6f 6e 74 65 6e 74 0a 0a | 09 23 21 20 2f 62 69 6e |ontent..|.#! /bin|
|00004420| 2f 63 73 68 0a 09 67 75 | 6e 7a 69 70 20 7c 20 71 |/csh..gu|nzip | q|
|00004430| 72 74 74 6f 70 70 6d 20 | 7c 20 70 70 6d 71 75 61 |rttoppm || ppmqua|
|00004440| 6e 74 20 2d 66 73 20 2d | 6d 61 70 20 63 74 2e 70 |nt -fs -|map ct.p|
|00004450| 70 6d 0a 0a 61 6e 64 20 | 73 74 6f 72 65 20 74 68 |pm..and |store th|
|00004460| 69 73 20 66 69 6c 65 20 | 61 73 20 60 6d 79 71 75 |is file |as `myqu|
|00004470| 61 6e 74 27 20 69 6e 20 | 74 68 65 20 63 75 72 72 |ant' in |the curr|
|00004480| 65 6e 74 20 64 69 72 65 | 63 74 6f 72 79 20 28 2e |ent dire|ctory (.|
|00004490| 90 03 20 63 68 6d 6f 64 | 20 61 2b 78 0a 6d 79 71 |.. chmod| a+x.myq|
|000044a0| 75 61 6e 74 29 2e 20 57 | 68 65 6e 20 74 68 69 73 |uant). W|hen this|
|000044b0| 20 69 73 20 64 6f 6e 65 | 20 77 65 20 67 65 6e 65 | is done| we gene|
|000044c0| 72 61 74 65 20 74 68 65 | 20 46 4c 49 20 61 6e 69 |rate the| FLI ani|
|000044d0| 6d 61 74 69 6f 6e 20 60 | 61 6e 69 6d 2e 66 6c 69 |mation `|anim.fli|
|000044e0| 27 20 62 79 20 74 68 65 | 0a 63 6f 6d 6d 61 6e 64 |' by the|.command|
|000044f0| 0a 0a 09 25 20 70 70 6d | 32 66 6c 69 20 70 69 63 |...% ppm|2fli pic|
|00004500| 73 2e 6c 69 73 74 20 61 | 6e 69 6d 2e 66 6c 69 20 |s.list a|nim.fli |
|00004510| 2d 6d 20 63 74 2e 70 70 | 6d 20 2d 66 6d 79 71 75 |-m ct.pp|m -fmyqu|
|00004520| 61 6e 74 0a 0a 4e 6f 74 | 65 20 74 68 61 74 20 75 |ant..Not|e that u|
|00004530| 73 75 61 6c 6c 79 20 74 | 68 65 20 46 6c 6f 79 64 |sually t|he Floyd|
|00004540| 2d 53 74 65 69 6e 62 65 | 72 67 20 65 72 72 6f 72 |-Steinbe|rg error|
|00004550| 20 64 69 66 66 75 73 69 | 6f 6e 20 72 65 73 75 6c | diffusi|on resul|
|00004560| 74 73 20 69 6e 20 61 20 | 6c 61 72 67 65 0a 6e 75 |ts in a |large.nu|
|00004570| 6d 62 65 72 20 6f 66 20 | 69 73 6f 6c 61 74 65 64 |mber of |isolated|
|00004580| 20 70 69 78 65 6c 73 20 | 69 6e 20 74 68 65 20 71 | pixels |in the q|
|00004590| 75 61 6e 74 69 7a 65 64 | 20 69 6d 61 67 65 2e 20 |uantized| image. |
|000045a0| 54 68 69 73 20 69 73 20 | 75 73 65 64 20 74 6f 20 |This is |used to |
|000045b0| 61 76 6f 69 64 20 74 68 | 65 0a 74 79 70 69 63 61 |avoid th|e.typica|
|000045c0| 6c 20 63 6f 6c 6f 72 20 | 73 74 65 70 73 20 77 68 |l color |steps wh|
|000045d0| 69 63 68 20 6f 63 63 75 | 72 20 69 6e 20 72 65 67 |ich occu|r in reg|
|000045e0| 69 6f 6e 73 20 77 69 74 | 68 20 73 6d 6f 6f 74 68 |ions wit|h smooth|
|000045f0| 20 74 72 61 6e 73 69 74 | 69 6f 6e 73 20 62 65 74 | transit|ions bet|
|00004600| 77 65 65 6e 0a 64 69 66 | 66 65 72 65 6e 74 20 63 |ween.dif|ferent c|
|00004610| 6f 6c 6f 72 73 2e 20 42 | 75 74 20 74 68 65 20 63 |olors. B|ut the c|
|00004620| 6f 6d 70 72 65 73 73 69 | 6f 6e 20 6d 65 74 68 6f |ompressi|on metho|
|00004630| 64 20 75 73 65 64 20 69 | 6e 20 74 68 65 20 46 4c |d used i|n the FL|
|00004640| 49 20 66 6f 72 6d 61 74 | 20 69 73 0a 69 6e 65 66 |I format| is.inef|
|00004650| 66 69 63 69 65 6e 74 20 | 77 68 65 6e 20 74 6f 6f |ficient |when too|
|00004660| 20 6d 61 6e 79 20 69 73 | 6f 6c 61 74 65 64 20 70 | many is|olated p|
|00004670| 69 78 65 6c 73 20 6f 63 | 63 75 72 20 77 69 74 68 |ixels oc|cur with|
|00004680| 69 6e 20 61 6e 20 69 6d | 61 67 65 2e 20 54 68 75 |in an im|age. Thu|
|00004690| 73 2c 20 74 68 65 0a 62 | 65 74 74 65 72 20 69 6d |s, the.b|etter im|
|000046a0| 61 67 65 20 71 75 61 6c | 69 74 79 20 69 73 20 70 |age qual|ity is p|
|000046b0| 61 79 65 64 20 62 79 20 | 61 20 6d 75 63 68 20 6c |ayed by |a much l|
|000046c0| 61 72 67 65 72 20 73 69 | 7a 65 20 6f 66 20 74 68 |arger si|ze of th|
|000046d0| 65 20 46 4c 49 20 66 69 | 6c 65 2e 0a 0a 54 65 63 |e FLI fi|le...Tec|
|000046e0| 68 6e 69 63 61 6c 20 6e | 6f 74 65 73 0a 2d 90 0f |hnical n|otes.-..|
|000046f0| 0a 54 68 65 20 4d 6f 64 | 69 66 69 65 64 20 4f 63 |.The Mod|ified Oc|
|00004700| 74 72 65 65 20 41 6c 67 | 6f 72 69 74 68 6d 0a 2d |tree Alg|orithm.-|
|00004710| 90 1d 0a 20 20 54 68 65 | 20 4f 63 74 72 65 65 20 |... The| Octree |
|00004720| 61 6c 67 6f 72 69 74 68 | 6d 20 64 6f 65 73 20 74 |algorith|m does t|
|00004730| 68 65 20 71 75 61 6e 74 | 69 7a 61 74 69 6f 6e 20 |he quant|ization |
|00004740| 69 6e 20 74 68 72 65 65 | 20 70 68 61 73 65 73 3a |in three| phases:|
|00004750| 0a 0a 28 31 29 20 53 63 | 61 6e 6e 69 6e 67 20 6f |..(1) Sc|anning o|
|00004760| 66 20 74 68 65 20 69 6d | 61 67 65 0a 0a 28 32 29 |f the im|age..(2)|
|00004770| 20 52 65 64 75 63 74 69 | 6f 6e 20 6f 66 20 74 68 | Reducti|on of th|
|00004780| 65 20 4f 63 74 72 65 65 | 0a 0a 28 33 29 20 4d 61 |e Octree|..(3) Ma|
|00004790| 70 70 69 6e 67 0a 0a 46 | 69 72 73 74 20 74 68 65 |pping..F|irst the|
|000047a0| 20 69 6d 61 67 65 73 20 | 61 72 65 20 73 63 61 6e | images |are scan|
|000047b0| 6e 65 64 20 74 6f 20 65 | 76 61 6c 75 61 74 65 20 |ned to e|valuate |
|000047c0| 77 68 61 74 20 63 6f 6c | 6f 72 73 20 61 72 65 20 |what col|ors are |
|000047d0| 70 72 65 73 65 6e 74 2e | 20 46 6f 72 20 74 68 69 |present.| For thi|
|000047e0| 73 0a 70 75 72 70 6f 73 | 65 20 69 6e 74 65 72 6e |s.purpos|e intern|
|000047f0| 61 6c 6c 79 20 61 20 6c | 69 73 74 20 6f 66 20 63 |ally a l|ist of c|
|00004800| 6f 6c 6f 72 73 20 69 73 | 20 63 72 65 61 74 65 64 |olors is| created|
|00004810| 2e 20 54 6f 20 73 70 65 | 65 64 20 75 70 20 74 68 |. To spe|ed up th|
|00004820| 65 20 73 6f 72 74 69 6e | 67 20 61 0a 74 72 65 65 |e sortin|g a.tree|
|00004830| 20 73 74 72 75 63 74 75 | 72 65 20 2d 2d 20 74 68 | structu|re -- th|
|00004840| 65 20 73 6f 20 63 61 6c | 6c 65 64 20 4f 63 74 72 |e so cal|led Octr|
|00004850| 65 65 20 2d 2d 20 69 73 | 20 75 73 65 64 20 72 61 |ee -- is| used ra|
|00004860| 74 68 65 72 20 74 68 61 | 6e 20 61 20 6c 69 6e 65 |ther tha|n a line|
|00004870| 61 72 20 6c 69 73 74 2e | 0a 54 68 69 73 20 74 72 |ar list.|.This tr|
|00004880| 65 65 20 73 74 72 75 63 | 74 75 72 65 20 68 61 73 |ee struc|ture has|
|00004890| 20 61 20 6d 61 69 6e 20 | 6e 6f 64 65 20 77 68 69 | a main |node whi|
|000048a0| 63 68 20 63 61 6e 20 68 | 61 76 65 20 75 70 20 74 |ch can h|ave up t|
|000048b0| 6f 20 38 20 73 75 62 2d | 6e 6f 64 65 73 2e 20 45 |o 8 sub-|nodes. E|
|000048c0| 61 63 68 0a 73 75 62 2d | 6e 6f 74 65 20 69 74 73 |ach.sub-|note its|
|000048d0| 65 6c 66 20 63 61 6e 20 | 68 61 76 65 20 61 67 61 |elf can |have aga|
|000048e0| 69 6e 20 38 20 73 75 62 | 2d 73 75 62 2d 6e 6f 64 |in 8 sub|-sub-nod|
|000048f0| 65 73 20 61 6e 64 20 73 | 6f 20 6f 6e 2e 20 53 6f |es and s|o on. So|
|00004900| 20 74 68 65 20 73 75 62 | 2d 6e 6f 64 65 73 0a 63 | the sub|-nodes.c|
|00004910| 61 6e 20 62 65 20 72 65 | 67 61 72 64 65 64 20 61 |an be re|garded a|
|00004920| 73 20 73 75 62 2d 74 72 | 65 65 73 2e 20 0a 0a 20 |s sub-tr|ees. .. |
|00004930| 20 41 20 67 65 6f 6d 65 | 74 72 69 63 20 69 6e 74 | A geome|tric int|
|00004940| 65 72 70 72 65 74 61 74 | 69 6f 6e 20 65 78 69 73 |erpretat|ion exis|
|00004950| 74 73 20 66 6f 72 20 74 | 68 65 20 73 6f 72 74 69 |ts for t|he sorti|
|00004960| 6e 67 20 6f 66 20 52 47 | 42 20 63 6f 6c 6f 72 73 |ng of RG|B colors|
|00004970| 20 62 79 20 74 68 65 0a | 4f 63 74 72 65 65 3a 20 | by the.|Octree: |
|00004980| 41 20 52 47 42 20 63 6f | 6c 6f 72 20 63 61 6e 20 |A RGB co|lor can |
|00004990| 62 65 20 72 65 67 61 72 | 64 65 64 20 61 73 20 61 |be regar|ded as a|
|000049a0| 20 70 6f 69 6e 74 20 77 | 69 74 68 20 63 6f 6f 72 | point w|ith coor|
|000049b0| 64 69 6e 61 74 65 73 0a | 28 72 65 64 2c 67 72 65 |dinates.|(red,gre|
|000049c0| 65 6e 2c 62 6c 75 65 29 | 20 69 6e 20 61 20 33 2d |en,blue)| in a 3-|
|000049d0| 64 69 6d 65 6e 73 69 6f | 6e 61 6c 20 73 70 61 63 |dimensio|nal spac|
|000049e0| 65 2e 20 54 68 65 20 6f | 72 74 68 6f 67 6f 6e 61 |e. The o|rthogona|
|000049f0| 6c 20 63 6f 6f 72 64 69 | 6e 61 74 65 20 73 79 73 |l coordi|nate sys|
|00004a00| 74 65 6d 0a 6f 66 20 74 | 68 69 73 20 73 70 61 63 |tem.of t|his spac|
|00004a10| 65 20 68 61 73 20 61 78 | 69 73 20 69 6e 20 74 68 |e has ax|is in th|
|00004a20| 65 20 64 69 72 65 63 74 | 69 6f 6e 73 20 72 65 64 |e direct|ions red|
|00004a30| 2c 20 67 72 65 65 6e 20 | 61 6e 64 20 62 6c 75 65 |, green |and blue|
|00004a40| 2e 20 54 6f 74 61 6c 20 | 62 6c 61 63 6b 20 69 73 |. Total |black is|
|00004a50| 0a 64 65 66 69 6e 65 64 | 20 61 73 20 74 68 65 20 |.defined| as the |
|00004a60| 6f 72 69 67 69 6e 20 6f | 66 20 74 68 69 73 20 73 |origin o|f this s|
|00004a70| 70 61 63 65 20 28 30 2c | 30 2c 30 29 2e 20 42 65 |pace (0,|0,0). Be|
|00004a80| 63 61 75 73 65 20 6f 66 | 20 74 68 65 20 64 69 73 |cause of| the dis|
|00004a90| 63 72 65 74 65 20 38 62 | 69 74 0a 72 65 70 72 65 |crete 8b|it.repre|
|00004aa0| 73 65 6e 74 61 74 69 6f | 6e 20 6f 66 20 65 61 63 |sentatio|n of eac|
|00004ab0| 68 20 52 47 42 20 63 6f | 6d 70 6f 6e 65 6e 74 20 |h RGB co|mponent |
|00004ac0| 74 68 65 20 70 6f 69 6e | 74 20 28 32 35 35 2c 32 |the poin|t (255,2|
|00004ad0| 35 35 2c 32 35 35 29 20 | 63 6f 72 72 65 73 70 6f |55,255) |correspo|
|00004ae0| 6e 64 73 20 74 6f 0a 6d | 61 78 69 6d 75 6d 20 62 |nds to.m|aximum b|
|00004af0| 72 69 67 68 74 20 77 68 | 69 74 65 2e 20 41 6c 6c |right wh|ite. All|
|00004b00| 20 70 6f 73 73 69 62 6c | 65 0a 0a 32 35 36 2a 32 | possibl|e..256*2|
|00004b10| 35 36 2a 32 35 36 20 3e | 20 31 36 20 4d 69 6c 6c |56*256 >| 16 Mill|
|00004b20| 69 6f 6e 0a 0a 52 47 42 | 20 63 6f 6d 62 69 6e 61 |ion..RGB| combina|
|00004b30| 74 69 6f 6e 73 20 66 6f | 72 6d 20 61 20 72 65 67 |tions fo|rm a reg|
|00004b40| 75 6c 61 72 20 74 68 72 | 65 65 2d 64 69 6d 65 6e |ular thr|ee-dimen|
|00004b50| 73 69 6f 6e 61 6c 20 67 | 72 69 64 20 69 6e 20 74 |sional g|rid in t|
|00004b60| 68 69 73 20 73 70 61 63 | 65 2e 20 54 68 65 0a 67 |his spac|e. The.g|
|00004b70| 72 69 64 20 63 61 6e 20 | 62 65 20 63 6f 76 65 72 |rid can |be cover|
|00004b80| 65 64 20 62 79 20 61 20 | 63 75 62 65 20 77 69 74 |ed by a |cube wit|
|00004b90| 68 20 73 69 64 65 20 6c | 65 6e 67 74 68 20 32 35 |h side l|ength 25|
|00004ba0| 35 2e 20 54 68 69 73 20 | 63 75 62 65 20 63 6f 72 |5. This |cube cor|
|00004bb0| 72 65 73 70 6f 6e 64 73 | 20 74 6f 0a 74 68 65 20 |responds| to.the |
|00004bc0| 6d 61 69 6e 20 6e 6f 64 | 65 20 6f 66 20 74 68 65 |main nod|e of the|
|00004bd0| 20 4f 63 74 72 65 65 2e | 20 54 68 65 20 73 6f 72 | Octree.| The sor|
|00004be0| 74 69 6e 67 20 69 73 20 | 64 6f 6e 65 20 62 79 20 |ting is |done by |
|00004bf0| 73 75 62 64 69 76 69 64 | 69 6e 67 20 74 68 65 20 |subdivid|ing the |
|00004c00| 63 75 62 65 0a 73 79 6d | 6d 65 74 72 69 63 61 6c |cube.sym|metrical|
|00004c10| 6c 79 20 69 6e 20 38 20 | 73 75 62 2d 63 75 62 65 |ly in 8 |sub-cube|
|00004c20| 73 20 6f 66 20 65 71 75 | 61 6c 20 73 69 7a 65 2e |s of equ|al size.|
|00004c30| 20 54 68 65 20 73 75 62 | 2d 63 75 62 65 73 20 63 | The sub|-cubes c|
|00004c40| 6f 6e 74 61 69 6e 20 74 | 68 65 20 70 6f 69 6e 74 |ontain t|he point|
|00004c50| 73 0a 0a 31 2e 20 28 72 | 2c 67 2c 62 29 20 3d 20 |s..1. (r|,g,b) = |
|00004c60| 28 20 20 30 20 2d 20 31 | 32 37 2c 20 90 03 30 20 |( 0 - 1|27, ..0 |
|00004c70| 2d 20 31 32 37 2c 20 90 | 03 30 20 2d 20 31 32 37 |- 127, .|.0 - 127|
|00004c80| 29 0a 32 2e 20 28 72 2c | 67 2c 62 29 20 3d 20 28 |).2. (r,|g,b) = (|
|00004c90| 20 20 30 20 2d 20 31 32 | 37 2c 20 90 03 30 20 2d | 0 - 12|7, ..0 -|
|00004ca0| 20 31 32 37 2c 20 31 32 | 38 20 2d 20 32 35 35 29 | 127, 12|8 - 255)|
|00004cb0| 0a 33 2e 20 28 72 2c 67 | 2c 62 29 20 3d 20 28 20 |.3. (r,g|,b) = ( |
|00004cc0| 20 30 20 2d 20 31 32 37 | 2c 20 31 32 38 20 2d 20 | 0 - 127|, 128 - |
|00004cd0| 32 35 35 2c 20 90 03 30 | 20 2d 20 31 32 37 29 0a |255, ..0| - 127).|
|00004ce0| 34 2e 20 28 72 2c 67 2c | 62 29 20 3d 20 28 20 20 |4. (r,g,|b) = ( |
|00004cf0| 30 20 2d 20 31 32 37 2c | 20 31 32 38 20 2d 20 32 |0 - 127,| 128 - 2|
|00004d00| 35 35 2c 20 31 32 38 20 | 2d 20 32 35 35 29 0a 35 |55, 128 |- 255).5|
|00004d10| 2e 20 28 72 2c 67 2c 62 | 29 20 3d 20 28 31 32 38 |. (r,g,b|) = (128|
|00004d20| 20 2d 20 32 35 35 2c 20 | 90 03 30 20 2d 20 31 32 | - 255, |..0 - 12|
|00004d30| 37 2c 20 90 03 30 20 2d | 20 31 32 37 29 0a 36 2e |7, ..0 -| 127).6.|
|00004d40| 20 28 72 2c 67 2c 62 29 | 20 3d 20 28 31 32 38 20 | (r,g,b)| = (128 |
|00004d50| 2d 20 32 35 35 2c 20 90 | 03 30 20 2d 20 31 32 37 |- 255, .|.0 - 127|
|00004d60| 2c 20 31 32 38 20 2d 20 | 32 35 35 29 0a 37 2e 20 |, 128 - |255).7. |
|00004d70| 28 72 2c 67 2c 62 29 20 | 3d 20 28 31 32 38 20 2d |(r,g,b) |= (128 -|
|00004d80| 20 32 35 35 2c 20 31 32 | 38 20 2d 20 32 35 35 2c | 255, 12|8 - 255,|
|00004d90| 20 90 03 30 20 2d 20 31 | 32 37 29 0a 38 2e 20 28 | ..0 - 1|27).8. (|
|00004da0| 72 2c 67 2c 62 29 20 3d | 20 28 31 32 38 20 2d 20 |r,g,b) =| (128 - |
|00004db0| 32 35 35 2c 20 31 32 38 | 20 2d 20 32 35 35 2c 20 |255, 128| - 255, |
|00004dc0| 31 32 38 20 2d 20 32 35 | 35 29 0a 0a 54 68 65 73 |128 - 25|5)..Thes|
|00004dd0| 65 20 73 75 62 2d 63 75 | 62 65 73 20 63 6f 72 72 |e sub-cu|bes corr|
|00004de0| 65 73 70 6f 6e 64 20 74 | 6f 20 73 75 62 2d 6e 6f |espond t|o sub-no|
|00004df0| 64 65 73 20 6f 66 20 74 | 68 65 20 6d 61 69 6e 20 |des of t|he main |
|00004e00| 6e 6f 64 65 20 69 6e 20 | 74 68 65 20 4f 63 74 72 |node in |the Octr|
|00004e10| 65 65 2e 0a 0a 20 20 41 | 74 20 74 68 65 20 62 65 |ee... A|t the be|
|00004e20| 67 69 6e 6e 69 6e 67 20 | 61 6c 6c 20 38 20 62 69 |ginning |all 8 bi|
|00004e30| 74 73 20 6f 66 20 74 68 | 65 20 52 47 42 20 76 61 |ts of th|e RGB va|
|00004e40| 6c 75 65 73 20 61 72 65 | 20 74 61 6b 65 6e 20 69 |lues are| taken i|
|00004e50| 6e 74 6f 20 61 63 63 6f | 75 6e 74 20 77 68 65 6e |nto acco|unt when|
|00004e60| 0a 73 6f 72 74 69 6e 67 | 20 74 68 65 20 63 6f 6c |.sorting| the col|
|00004e70| 6f 72 73 2e 20 49 74 20 | 69 73 20 63 68 65 63 6b |ors. It |is check|
|00004e80| 65 64 20 66 6f 72 20 61 | 20 70 69 78 65 6c 20 69 |ed for a| pixel i|
|00004e90| 6e 20 77 68 69 63 68 20 | 73 75 62 2d 63 75 62 65 |n which |sub-cube|
|00004ea0| 20 69 74 73 20 63 6f 6c | 6f 72 0a 62 65 6c 6f 6e | its col|or.belon|
|00004eb0| 67 73 2e 20 54 68 65 6e | 20 69 74 20 69 73 20 63 |gs. Then| it is c|
|00004ec0| 68 65 63 6b 65 64 20 69 | 66 20 61 20 63 6f 72 72 |hecked i|f a corr|
|00004ed0| 65 73 70 6f 6e 64 69 6e | 67 20 73 75 62 2d 6e 6f |espondin|g sub-no|
|00004ee0| 64 65 20 66 6f 72 20 74 | 68 69 73 20 73 75 62 2d |de for t|his sub-|
|00004ef0| 63 75 62 65 0a 61 6c 72 | 65 61 64 79 20 65 78 69 |cube.alr|eady exi|
|00004f00| 73 74 73 2e 20 49 66 20 | 6e 6f 74 20 61 20 6e 65 |sts. If |not a ne|
|00004f10| 77 20 6e 6f 64 65 20 69 | 6e 20 74 68 65 20 4f 63 |w node i|n the Oc|
|00004f20| 74 72 65 65 20 69 73 20 | 67 65 6e 65 72 61 74 65 |tree is |generate|
|00004f30| 64 20 77 68 69 63 68 20 | 72 65 70 72 65 73 65 6e |d which |represen|
|00004f40| 74 73 0a 74 68 69 73 20 | 73 75 62 2d 63 75 62 65 |ts.this |sub-cube|
|00004f50| 2e 20 54 68 65 6e 20 74 | 68 65 20 73 75 62 2d 63 |. Then t|he sub-c|
|00004f60| 75 62 65 20 69 74 73 65 | 6c 66 20 69 73 20 64 69 |ube itse|lf is di|
|00004f70| 76 69 64 65 64 20 69 6e | 20 65 69 67 68 74 20 73 |vided in| eight s|
|00004f80| 75 62 2d 73 75 62 2d 63 | 75 62 65 73 20 61 6e 64 |ub-sub-c|ubes and|
|00004f90| 0a 73 6f 20 6f 6e 2e 20 | 54 68 65 20 73 75 62 64 |.so on. |The subd|
|00004fa0| 69 76 69 73 69 6f 6e 20 | 69 73 20 64 6f 6e 65 20 |ivision |is done |
|00004fb0| 75 6e 74 69 6c 20 74 68 | 65 20 63 6f 6c 6f 72 20 |until th|e color |
|00004fc0| 69 73 20 6c 6f 63 61 74 | 65 64 20 69 6e 20 74 68 |is locat|ed in th|
|00004fd0| 65 20 66 69 6e 65 73 74 | 20 63 75 62 65 0a 77 68 |e finest| cube.wh|
|00004fe0| 69 63 68 20 63 6f 6e 74 | 61 69 6e 73 20 6f 6e 6c |ich cont|ains onl|
|00004ff0| 79 20 6f 6e 65 20 6f 66 | 20 74 68 65 20 70 6f 73 |y one of| the pos|
|00005000| 73 69 62 6c 65 20 64 69 | 73 63 72 65 74 65 20 52 |sible di|screte R|
|00005010| 47 42 20 70 6f 69 6e 74 | 73 2e 20 54 68 69 73 20 |GB point|s. This |
|00005020| 72 65 73 75 6c 74 73 20 | 69 6e 0a 38 20 6c 65 76 |results |in.8 lev|
|00005030| 65 6c 73 20 6f 66 20 73 | 75 62 2d 63 75 62 65 73 |els of s|ub-cubes|
|00005040| 2c 20 77 68 69 63 68 20 | 61 6c 6c 20 72 65 70 72 |, which |all repr|
|00005050| 65 73 65 6e 74 20 61 20 | 6e 6f 64 65 20 69 6e 20 |esent a |node in |
|00005060| 64 69 66 66 65 72 65 6e | 74 20 6c 65 76 65 6c 73 |differen|t levels|
|00005070| 20 6f 66 20 74 68 65 0a | 4f 63 74 72 65 65 2e 20 | of the.|Octree. |
|00005080| 54 68 65 20 6e 6f 64 65 | 73 20 69 6e 20 74 68 65 |The node|s in the|
|00005090| 20 66 69 6e 65 73 74 20 | 6c 65 76 65 6c 20 28 61 | finest |level (a|
|000050a0| 6c 73 6f 20 63 61 6c 6c | 65 64 20 64 65 65 70 65 |lso call|ed deepe|
|000050b0| 73 74 20 6c 65 76 65 6c | 29 2c 20 77 68 69 63 68 |st level|), which|
|000050c0| 20 68 61 76 65 0a 6e 6f | 20 73 75 62 2d 6e 6f 64 | have.no| sub-nod|
|000050d0| 65 73 2c 20 61 72 65 20 | 63 61 6c 6c 65 64 20 6c |es, are |called l|
|000050e0| 65 61 76 65 73 2e 0a 0a | 20 20 54 68 65 20 73 6f |eaves...| The so|
|000050f0| 72 74 69 6e 67 20 70 72 | 6f 63 65 64 75 72 65 20 |rting pr|ocedure |
|00005100| 69 73 20 64 6f 6e 65 20 | 66 6f 72 20 61 6c 6c 20 |is done |for all |
|00005110| 70 69 78 65 6c 73 20 69 | 6e 20 74 68 65 20 69 6e |pixels i|n the in|
|00005120| 70 75 74 20 69 6d 61 67 | 65 73 2e 0a 41 64 64 69 |put imag|es..Addi|
|00005130| 74 69 6f 6e 61 6c 6c 79 | 20 74 68 65 20 6d 6f 64 |tionally| the mod|
|00005140| 69 66 69 65 64 20 61 6c | 67 6f 72 69 74 68 6d 20 |ified al|gorithm |
|00005150| 64 6f 65 73 20 66 6f 72 | 20 65 61 63 68 20 73 75 |does for| each su|
|00005160| 62 2d 63 75 62 65 20 61 | 20 63 6f 75 6e 74 20 6f |b-cube a| count o|
|00005170| 66 20 74 68 65 0a 70 69 | 78 65 6c 73 20 77 68 69 |f the.pi|xels whi|
|00005180| 63 68 20 77 68 65 72 65 | 20 6c 6f 63 61 74 65 64 |ch where| located|
|00005190| 20 69 6e 20 74 68 69 73 | 20 63 75 62 65 2e 20 46 | in this| cube. F|
|000051a0| 75 72 74 68 65 72 6d 6f | 72 65 20 61 20 73 75 6d |urthermo|re a sum|
|000051b0| 20 6f 66 20 74 68 65 20 | 52 47 42 20 76 61 6c 75 | of the |RGB valu|
|000051c0| 65 73 0a 69 73 20 63 6f | 6d 70 75 74 65 64 20 66 |es.is co|mputed f|
|000051d0| 6f 72 20 61 6c 6c 20 70 | 69 78 65 6c 73 20 69 6e |or all p|ixels in|
|000051e0| 20 65 61 63 68 20 73 75 | 62 20 63 75 62 65 2e 0a | each su|b cube..|
|000051f0| 0a 20 20 49 6e 20 70 72 | 69 6e 63 69 70 6c 65 20 |. In pr|inciple |
|00005200| 61 6c 6c 20 70 69 78 65 | 6c 73 20 69 6e 20 61 20 |all pixe|ls in a |
|00005210| 74 72 75 65 20 63 6f 6c | 6f 72 20 70 69 63 74 75 |true col|or pictu|
|00005220| 72 65 20 63 61 6e 20 68 | 61 76 65 20 64 69 66 66 |re can h|ave diff|
|00005230| 65 72 65 6e 74 20 73 68 | 61 64 65 73 2e 0a 54 68 |erent sh|ades..Th|
|00005240| 75 73 2c 20 74 68 65 20 | 4f 63 74 72 65 65 20 6d |us, the |Octree m|
|00005250| 69 67 68 74 20 67 72 6f | 77 20 61 6e 64 20 67 72 |ight gro|w and gr|
|00005260| 6f 77 2c 20 61 6e 64 20 | 69 74 20 6d 61 79 20 62 |ow, and |it may b|
|00005270| 65 63 6f 6d 65 20 69 6d | 70 6f 73 73 69 62 6c 65 |ecome im|possible|
|00005280| 20 74 6f 20 73 74 6f 72 | 65 0a 74 68 65 20 69 6e | to stor|e.the in|
|00005290| 66 6f 72 6d 61 74 69 6f | 6e 20 66 6f 72 20 61 6c |formatio|n for al|
|000052a0| 6c 20 6e 6f 64 65 73 20 | 69 6e 20 74 68 65 20 6d |l nodes |in the m|
|000052b0| 61 69 6e 20 6d 65 6d 6f | 72 79 2e 20 4f 66 20 63 |ain memo|ry. Of c|
|000052c0| 6f 75 72 73 65 20 74 68 | 69 73 20 64 65 70 65 6e |ourse th|is depen|
|000052d0| 64 73 20 6f 6e 0a 74 68 | 65 20 63 6f 6e 74 65 6e |ds on.th|e conten|
|000052e0| 74 20 6f 66 20 74 68 65 | 20 69 6e 70 75 74 20 69 |t of the| input i|
|000052f0| 6d 61 67 65 73 2e 20 54 | 6f 20 61 76 6f 69 64 20 |mages. T|o avoid |
|00005300| 61 20 76 65 72 79 20 6c | 61 72 67 65 20 4f 63 74 |a very l|arge Oct|
|00005310| 72 65 65 20 61 20 72 65 | 64 75 63 74 69 6f 6e 20 |ree a re|duction |
|00005320| 69 73 0a 64 6f 6e 65 2c | 20 77 68 65 6e 20 74 68 |is.done,| when th|
|00005330| 65 20 6e 75 6d 62 65 72 | 20 6f 66 20 6e 6f 64 65 |e number| of node|
|00005340| 73 20 74 68 61 74 20 74 | 68 65 20 4f 63 74 72 65 |s that t|he Octre|
|00005350| 65 20 68 61 73 20 69 6e | 20 74 68 65 20 73 65 63 |e has in| the sec|
|00005360| 6f 6e 64 2d 64 65 65 70 | 65 73 74 0a 6c 65 76 65 |ond-deep|est.leve|
|00005370| 6c 20 65 78 63 65 65 64 | 73 20 61 20 63 65 72 74 |l exceed|s a cert|
|00005380| 61 69 6e 20 74 68 72 65 | 73 68 6f 6c 64 2e 20 54 |ain thre|shold. T|
|00005390| 68 65 20 72 65 64 75 63 | 74 69 6f 6e 20 69 73 20 |he reduc|tion is |
|000053a0| 64 6f 6e 65 20 62 79 20 | 74 68 72 6f 77 69 6e 67 |done by |throwing|
|000053b0| 20 61 77 61 79 20 61 6c | 6c 0a 6c 65 61 76 65 73 | away al|l.leaves|
|000053c0| 20 69 6e 20 74 68 65 20 | 64 65 65 70 65 73 74 20 | in the |deepest |
|000053d0| 6c 65 76 65 6c 2e 20 54 | 68 65 20 73 6f 72 74 69 |level. T|he sorti|
|000053e0| 6e 67 20 69 73 20 73 74 | 6f 70 70 65 64 20 69 6e |ng is st|opped in|
|000053f0| 20 74 68 65 20 73 65 63 | 6f 6e 64 2d 64 65 65 70 | the sec|ond-deep|
|00005400| 65 73 74 0a 6c 65 76 65 | 6c 20 77 68 65 72 65 20 |est.leve|l where |
|00005410| 74 68 65 20 6e 6f 64 65 | 73 20 6f 66 20 74 68 65 |the node|s of the|
|00005420| 20 4f 63 74 72 65 65 20 | 61 72 65 20 6e 6f 77 20 | Octree |are now |
|00005430| 6c 65 61 76 65 73 2e 20 | 42 75 74 2c 20 74 68 65 |leaves. |But, the|
|00005440| 6f 72 65 74 69 63 61 6c | 6c 79 20 37 0a 6c 65 76 |oretical|ly 7.lev|
|00005450| 65 6c 73 20 73 74 69 6c | 6c 20 61 6c 6c 6f 77 0a |els stil|l allow.|
|00005460| 0a 31 32 38 2a 31 32 38 | 2a 31 32 38 20 3e 20 32 |.128*128|*128 > 2|
|00005470| 20 4d 69 6c 6c 69 6f 6e | 0a 0a 64 69 66 66 65 72 | Million|..differ|
|00005480| 65 6e 74 20 52 47 42 20 | 63 6f 6d 62 69 6e 61 74 |ent RGB |combinat|
|00005490| 69 6f 6e 73 20 6f 72 20 | 70 6f 73 73 69 62 6c 65 |ions or |possible|
|000054a0| 20 66 69 6e 65 73 74 20 | 73 75 62 2d 63 75 62 65 | finest |sub-cube|
|000054b0| 73 2e 20 53 6f 20 69 74 | 20 63 61 6e 20 62 65 0a |s. So it| can be.|
|000054c0| 6e 65 63 65 73 73 61 72 | 79 20 74 6f 20 72 65 64 |necessar|y to red|
|000054d0| 75 63 65 20 74 68 65 20 | 6c 65 76 65 6c 20 6f 66 |uce the |level of|
|000054e0| 20 73 6f 72 74 20 61 63 | 63 75 72 61 63 79 20 66 | sort ac|curacy f|
|000054f0| 75 72 74 68 65 72 20 75 | 6e 74 69 6c 20 74 68 65 |urther u|ntil the|
|00005500| 20 4f 63 74 72 65 65 0a | 72 65 6d 61 69 6e 73 20 | Octree.|remains |
|00005510| 73 6d 61 6c 6c 20 65 6e | 6f 75 67 68 2e 20 42 75 |small en|ough. Bu|
|00005520| 74 20 74 68 69 73 20 6d | 61 79 20 63 61 75 73 65 |t this m|ay cause|
|00005530| 20 6c 61 74 65 72 20 61 | 20 70 6f 6f 72 20 72 65 | later a| poor re|
|00005540| 73 75 6c 74 20 6f 66 20 | 74 68 65 0a 71 75 61 6e |sult of |the.quan|
|00005550| 74 69 7a 61 74 69 6f 6e | 2c 20 62 65 63 61 75 73 |tization|, becaus|
|00005560| 65 20 61 6c 6c 20 70 69 | 78 65 6c 73 20 77 68 69 |e all pi|xels whi|
|00005570| 63 68 20 63 6f 6c 6f 72 | 73 20 73 68 61 72 65 20 |ch color|s share |
|00005580| 61 20 63 6f 6d 6d 6f 6e | 20 6c 65 61 66 20 6f 66 |a common| leaf of|
|00005590| 20 74 68 65 0a 4f 63 74 | 72 65 65 20 77 69 6c 6c | the.Oct|ree will|
|000055a0| 20 68 61 76 65 20 74 68 | 65 20 73 61 6d 65 20 63 | have th|e same c|
|000055b0| 6f 6c 6f 72 20 69 6e 20 | 74 68 65 20 72 65 73 75 |olor in |the resu|
|000055c0| 6c 74 69 6e 67 20 71 75 | 61 6e 74 69 7a 65 64 20 |lting qu|antized |
|000055d0| 69 6d 61 67 65 2e 20 54 | 68 75 73 2c 20 69 74 20 |image. T|hus, it |
|000055e0| 69 73 0a 64 65 73 69 72 | 61 62 6c 65 20 74 6f 20 |is.desir|able to |
|000055f0| 6b 65 65 70 20 74 68 65 | 20 61 63 63 75 72 61 63 |keep the| accurac|
|00005600| 79 20 6c 65 76 65 6c 20 | 61 20 68 69 67 68 20 61 |y level |a high a|
|00005610| 73 20 70 6f 73 73 69 62 | 6c 65 20 61 6e 64 20 61 |s possib|le and a|
|00005620| 20 63 6f 6d 70 72 6f 6d | 69 73 65 0a 62 65 74 77 | comprom|ise.betw|
|00005630| 65 65 6e 20 63 6f 6d 70 | 75 74 61 74 69 6f 6e 61 |een comp|utationa|
|00005640| 6c 20 65 66 66 6f 72 74 | 20 61 6e 64 20 71 75 61 |l effort| and qua|
|00005650| 6e 74 69 7a 65 20 71 75 | 61 6c 69 74 79 20 68 61 |ntize qu|ality ha|
|00005660| 73 20 74 6f 20 62 65 20 | 6f 62 74 61 69 6e 65 64 |s to be |obtained|
|00005670| 2e 0a 0a 20 20 49 6e 20 | 74 68 65 20 73 65 63 6f |... In |the seco|
|00005680| 6e 64 20 70 68 61 73 65 | 20 6f 66 20 74 68 65 20 |nd phase| of the |
|00005690| 71 75 61 6e 74 69 7a 61 | 74 69 6f 6e 20 74 68 65 |quantiza|tion the|
|000056a0| 20 63 6f 6c 6f 72 20 74 | 61 62 6c 65 20 69 73 20 | color t|able is |
|000056b0| 63 6f 6d 70 75 74 65 64 | 2e 20 46 6f 72 0a 74 68 |computed|. For.th|
|000056c0| 69 73 20 70 75 72 70 6f | 73 65 20 74 68 65 20 4f |is purpo|se the O|
|000056d0| 63 74 72 65 65 20 77 68 | 69 63 68 20 77 61 73 20 |ctree wh|ich was |
|000056e0| 67 65 6e 65 72 61 74 65 | 64 20 64 75 72 69 6e 67 |generate|d during|
|000056f0| 20 74 68 65 20 73 63 61 | 6e 6e 69 6e 67 20 70 72 | the sca|nning pr|
|00005700| 6f 63 65 73 73 20 68 61 | 73 0a 74 6f 20 62 65 20 |ocess ha|s.to be |
|00005710| 72 65 64 75 63 65 64 20 | 66 75 72 74 68 65 72 20 |reduced |further |
|00005720| 75 6e 74 69 6c 20 74 68 | 65 20 6e 75 6d 62 65 72 |until th|e number|
|00005730| 20 6f 66 20 6c 65 61 76 | 65 73 20 69 73 20 6c 6f | of leav|es is lo|
|00005740| 77 65 72 20 28 6f 72 20 | 65 71 75 61 6c 29 20 74 |wer (or |equal) t|
|00005750| 68 61 6e 20 74 68 65 0a | 73 70 65 63 69 66 69 65 |han the.|specifie|
|00005760| 64 20 6d 61 78 69 6d 75 | 6d 20 6f 66 20 63 6f 6c |d maximu|m of col|
|00005770| 6f 72 73 2e 20 43 6f 6d | 70 61 72 65 64 20 74 6f |ors. Com|pared to|
|00005780| 20 74 68 65 20 72 65 64 | 75 63 74 69 6f 6e 20 64 | the red|uction d|
|00005790| 75 72 69 6e 67 20 74 68 | 65 20 73 63 61 6e 6e 69 |uring th|e scanni|
|000057a0| 6e 67 0a 70 72 6f 63 65 | 73 73 2c 20 77 68 69 63 |ng.proce|ss, whic|
|000057b0| 68 20 69 73 20 64 6f 6e | 65 20 6f 6e 6c 79 20 22 |h is don|e only "|
|000057c0| 6c 65 76 65 6c 2d 77 69 | 73 65 22 2c 20 74 68 65 |level-wi|se", the|
|000057d0| 20 66 69 6e 61 6c 20 72 | 65 64 75 63 74 69 6f 6e | final r|eduction|
|000057e0| 20 69 73 20 70 65 72 66 | 6f 72 6d 65 64 20 69 6e | is perf|ormed in|
|000057f0| 0a 61 20 6d 6f 72 65 20 | 63 6f 6d 70 6c 69 63 61 |.a more |complica|
|00005800| 74 65 64 20 77 61 79 2e | 20 49 74 20 69 73 20 74 |ted way.| It is t|
|00005810| 61 6b 65 6e 20 69 6e 74 | 6f 20 61 63 63 6f 75 6e |aken int|o accoun|
|00005820| 74 20 68 6f 77 20 6d 61 | 6e 79 20 70 69 78 65 6c |t how ma|ny pixel|
|00005830| 73 20 62 65 6c 6f 6e 67 | 20 74 6f 0a 65 61 63 68 |s belong| to.each|
|00005840| 20 6e 6f 64 65 20 69 6e | 20 74 68 65 20 4f 63 74 | node in| the Oct|
|00005850| 72 65 65 2e 20 54 68 65 | 20 6e 6f 64 65 20 77 69 |ree. The| node wi|
|00005860| 74 68 20 74 68 65 20 6d | 69 6e 69 6d 75 6d 20 70 |th the m|inimum p|
|00005870| 69 78 65 6c 20 63 6f 75 | 6e 74 20 69 73 20 73 65 |ixel cou|nt is se|
|00005880| 61 72 63 68 65 64 2e 0a | 49 74 27 73 20 73 75 62 |arched..|It's sub|
|00005890| 2d 74 72 65 65 73 20 61 | 72 65 20 64 69 73 63 61 |-trees a|re disca|
|000058a0| 72 64 65 64 20 61 6e 64 | 20 69 74 20 62 65 63 6f |rded and| it beco|
|000058b0| 6d 65 73 20 61 20 6c 65 | 61 66 2e 20 54 68 69 73 |mes a le|af. This|
|000058c0| 20 69 73 20 72 65 70 65 | 61 74 65 64 20 75 6e 74 | is repe|ated unt|
|000058d0| 69 6c 0a 74 68 65 20 6e | 75 6d 62 65 72 20 6f 66 |il.the n|umber of|
|000058e0| 20 6c 65 61 76 65 73 20 | 69 73 20 6c 6f 77 20 65 | leaves |is low e|
|000058f0| 6e 6f 75 67 68 2e 20 54 | 68 65 6e 20 66 6f 72 20 |nough. T|hen for |
|00005900| 65 61 63 68 20 6c 65 61 | 66 20 74 68 65 20 61 76 |each lea|f the av|
|00005910| 65 72 61 67 65 20 63 6f | 6c 6f 72 0a 76 61 6c 75 |erage co|lor.valu|
|00005920| 65 73 20 61 72 65 20 63 | 6f 6d 70 75 74 65 64 3a |es are c|omputed:|
|00005930| 20 54 68 65 20 73 75 6d | 73 20 6f 66 20 74 68 65 | The sum|s of the|
|00005940| 20 72 65 64 2c 20 67 72 | 65 65 6e 20 61 6e 64 20 | red, gr|een and |
|00005950| 62 6c 75 65 20 76 61 6c | 75 65 73 20 61 72 65 20 |blue val|ues are |
|00005960| 64 69 76 69 64 65 64 0a | 62 79 20 74 68 65 20 6e |divided.|by the n|
|00005970| 75 6d 62 65 72 20 6f 66 | 20 70 69 78 65 6c 73 2e |umber of| pixels.|
|00005980| 20 54 68 65 73 65 20 61 | 76 65 72 61 67 65 64 20 | These a|veraged |
|00005990| 52 47 42 20 76 61 6c 75 | 65 73 20 61 72 65 20 72 |RGB valu|es are r|
|000059a0| 65 70 6c 61 63 65 64 20 | 62 79 20 74 68 65 0a 6e |eplaced |by the.n|
|000059b0| 65 61 72 65 73 74 20 69 | 6e 74 65 67 65 72 73 20 |earest i|ntegers |
|000059c0| 61 6e 64 20 74 68 65 20 | 72 65 73 75 6c 74 69 6e |and the |resultin|
|000059d0| 67 20 6e 75 6d 62 65 72 | 73 20 61 72 65 20 74 61 |g number|s are ta|
|000059e0| 6b 65 6e 20 61 73 20 65 | 6e 74 72 79 20 69 6e 20 |ken as e|ntry in |
|000059f0| 74 68 65 20 63 6f 6c 6f | 72 0a 74 61 62 6c 65 2e |the colo|r.table.|
|00005a00| 0a 0a 20 20 41 66 74 65 | 72 20 74 68 65 20 63 6f |.. Afte|r the co|
|00005a10| 6c 6f 72 20 74 61 62 6c | 65 20 69 73 20 67 65 6e |lor tabl|e is gen|
|00005a20| 65 72 61 74 65 64 20 74 | 68 65 20 66 69 6e 61 6c |erated t|he final|
|00005a30| 20 73 74 61 67 65 20 69 | 73 20 64 6f 6e 65 2e 20 | stage i|s done. |
|00005a40| 41 6c 6c 20 70 69 78 65 | 6c 73 20 69 6e 0a 74 68 |All pixe|ls in.th|
|00005a50| 65 20 69 6d 61 67 65 73 | 20 61 72 65 20 73 6f 72 |e images| are sor|
|00005a60| 74 65 64 20 61 67 61 69 | 6e 20 75 73 69 6e 67 20 |ted agai|n using |
|00005a70| 74 68 65 20 2d 2d 20 6e | 6f 77 20 72 65 64 75 63 |the -- n|ow reduc|
|00005a80| 65 64 20 2d 2d 20 4f 63 | 74 72 65 65 20 75 6e 74 |ed -- Oc|tree unt|
|00005a90| 69 6c 20 61 20 6c 65 61 | 66 0a 69 73 20 72 65 61 |il a lea|f.is rea|
|00005aa0| 63 68 65 64 2e 20 54 68 | 65 6e 20 74 68 65 20 70 |ched. Th|en the p|
|00005ab0| 69 78 65 6c 20 69 73 20 | 6d 61 70 70 65 64 20 74 |ixel is |mapped t|
|00005ac0| 6f 20 74 68 65 20 72 65 | 73 70 65 63 74 69 76 65 |o the re|spective|
|00005ad0| 20 65 6e 74 72 79 20 69 | 6e 20 74 68 65 20 63 6f | entry i|n the co|
|00005ae0| 6c 6f 72 0a 74 61 62 6c | 65 2e 20 46 6f 72 20 61 |lor.tabl|e. For a|
|00005af0| 6c 6c 20 70 69 78 65 6c | 73 20 77 68 69 63 68 20 |ll pixel|s which |
|00005b00| 77 65 72 65 20 75 73 65 | 64 20 64 75 72 69 6e 67 |were use|d during|
|00005b10| 20 74 68 65 20 73 63 61 | 6e 6e 69 6e 67 20 70 72 | the sca|nning pr|
|00005b20| 6f 63 65 73 73 20 61 20 | 6c 65 61 66 20 69 6e 0a |ocess a |leaf in.|
|00005b30| 74 68 65 20 72 65 64 75 | 63 65 64 20 4f 63 74 72 |the redu|ced Octr|
|00005b40| 65 65 20 65 78 69 73 74 | 73 2e 20 54 68 69 73 20 |ee exist|s. This |
|00005b50| 6c 65 61 66 20 72 65 70 | 72 65 73 65 6e 74 73 20 |leaf rep|resents |
|00005b60| 61 20 63 75 62 65 20 69 | 6e 20 74 68 65 20 63 6f |a cube i|n the co|
|00005b70| 6c 6f 72 20 73 70 61 63 | 65 0a 74 68 61 74 20 63 |lor spac|e.that c|
|00005b80| 6f 6e 74 61 69 6e 73 20 | 74 68 65 20 63 6f 6c 6f |ontains |the colo|
|00005b90| 72 20 6f 66 20 74 68 65 | 20 70 69 78 65 6c 20 28 |r of the| pixel (|
|00005ba0| 62 65 73 69 64 65 20 6f | 74 68 65 72 20 63 6f 6c |beside o|ther col|
|00005bb0| 6f 72 73 20 64 65 70 65 | 6e 64 69 6e 67 20 6f 6e |ors depe|nding on|
|00005bc0| 20 74 68 65 0a 6c 65 76 | 65 6c 20 6f 66 20 74 68 | the.lev|el of th|
|00005bd0| 65 20 6c 65 61 66 29 2e | 0a 0a 20 20 49 6e 20 73 |e leaf).|.. In s|
|00005be0| 6f 6d 65 20 63 69 72 63 | 75 6d 73 74 61 6e 63 65 |ome circ|umstance|
|00005bf0| 73 20 69 74 20 69 73 20 | 75 73 65 66 75 6c 20 74 |s it is |useful t|
|00005c00| 6f 20 62 65 20 61 62 6c | 65 20 74 6f 20 6d 61 70 |o be abl|e to map|
|00005c10| 20 61 6c 73 6f 20 69 6d | 61 67 65 73 20 77 68 69 | also im|ages whi|
|00005c20| 63 68 20 77 65 72 65 0a | 6e 6f 74 20 73 63 61 6e |ch were.|not scan|
|00005c30| 6e 65 64 20 70 72 65 76 | 69 6f 75 73 6c 79 2e 20 |ned prev|iously. |
|00005c40| 49 66 20 73 75 63 68 20 | 61 6e 20 22 75 6e 6b 6e |If such |an "unkn|
|00005c50| 6f 77 6e 22 20 69 6d 61 | 67 65 20 69 73 20 6d 61 |own" ima|ge is ma|
|00005c60| 70 70 65 64 20 70 69 78 | 65 6c 73 20 6d 61 79 20 |pped pix|els may |
|00005c70| 6f 63 63 75 72 0a 77 68 | 69 63 68 20 68 61 76 65 |occur.wh|ich have|
|00005c80| 20 63 6f 6c 6f 72 73 20 | 74 68 61 74 20 61 72 65 | colors |that are|
|00005c90| 20 6e 6f 74 20 72 65 70 | 72 65 73 65 6e 74 65 64 | not rep|resented|
|00005ca0| 20 62 79 20 61 6e 79 20 | 6c 65 61 66 20 69 6e 20 | by any |leaf in |
|00005cb0| 74 68 65 20 4f 63 74 72 | 65 65 2e 20 54 68 65 73 |the Octr|ee. Thes|
|00005cc0| 65 0a 22 75 6e 6b 6e 6f | 77 6e 22 20 63 6f 6c 6f |e."unkno|wn" colo|
|00005cd0| 72 73 20 61 72 65 20 6c | 6f 63 61 74 65 64 20 69 |rs are l|ocated i|
|00005ce0| 6e 20 63 75 62 65 73 20 | 77 68 69 63 68 20 77 65 |n cubes |which we|
|00005cf0| 72 65 20 6e 6f 74 20 63 | 6f 6e 73 69 64 65 72 65 |re not c|onsidere|
|00005d00| 64 20 70 72 65 76 69 6f | 75 73 6c 79 2e 0a 54 68 |d previo|usly..Th|
|00005d10| 65 20 73 6f 72 74 69 6e | 67 20 70 72 6f 63 65 73 |e sortin|g proces|
|00005d20| 73 20 69 73 20 65 78 74 | 65 6e 64 65 64 20 74 6f |s is ext|ended to|
|00005d30| 20 68 61 6e 64 6c 65 20 | 61 6c 73 6f 20 73 75 63 | handle |also suc|
|00005d40| 68 20 73 69 74 75 61 74 | 69 6f 6e 73 2e 20 49 6e |h situat|ions. In|
|00005d50| 20 61 6c 6c 20 63 61 73 | 65 73 0a 74 68 65 20 73 | all cas|es.the s|
|00005d60| 6f 72 74 69 6e 67 20 73 | 74 61 72 74 73 20 72 65 |orting s|tarts re|
|00005d70| 67 75 6c 61 72 6c 79 20 | 61 6e 64 20 69 74 20 69 |gularly |and it i|
|00005d80| 73 20 65 76 61 6c 75 61 | 74 65 64 20 69 6e 20 77 |s evalua|ted in w|
|00005d90| 68 69 63 68 20 73 75 62 | 2d 63 75 62 65 20 74 68 |hich sub|-cube th|
|00005da0| 65 20 63 6f 6c 6f 72 0a | 6f 66 20 61 20 70 69 78 |e color.|of a pix|
|00005db0| 65 6c 20 62 65 6c 6f 6e | 67 73 2e 20 49 66 20 61 |el belon|gs. If a|
|00005dc0| 20 6e 6f 64 65 20 66 6f | 72 20 74 68 69 73 20 73 | node fo|r this s|
|00005dd0| 75 62 2d 63 75 62 65 20 | 65 78 69 73 74 73 20 69 |ub-cube |exists i|
|00005de0| 6e 20 74 68 65 20 4f 63 | 74 72 65 65 20 74 68 65 |n the Oc|tree the|
|00005df0| 0a 73 65 61 72 63 68 20 | 69 73 20 63 6f 6e 74 69 |.search |is conti|
|00005e00| 6e 75 65 64 20 72 65 67 | 75 6c 61 72 6c 79 2e 20 |nued reg|ularly. |
|00005e10| 49 66 20 6e 6f 20 6e 6f | 64 65 20 65 78 69 73 74 |If no no|de exist|
|00005e20| 73 20 2d 2d 20 74 68 69 | 73 20 6d 65 61 6e 73 20 |s -- thi|s means |
|00005e30| 6e 6f 20 73 63 61 6e 6e | 65 64 0a 70 69 78 65 6c |no scann|ed.pixel|
|00005e40| 20 68 61 64 20 61 20 63 | 6f 6c 6f 72 20 77 68 69 | had a c|olor whi|
|00005e50| 63 68 20 62 65 6c 6f 6e | 67 65 64 20 74 6f 20 74 |ch belon|ged to t|
|00005e60| 68 65 20 73 61 6d 65 20 | 73 75 62 2d 63 75 62 65 |he same |sub-cube|
|00005e70| 20 2d 2d 20 61 6e 20 65 | 78 74 72 61 20 70 72 6f | -- an e|xtra pro|
|00005e80| 63 65 64 75 72 65 0a 69 | 73 20 73 74 61 72 74 65 |cedure.i|s starte|
|00005e90| 64 2e 20 46 6f 72 20 61 | 6c 6c 20 73 75 62 2d 6e |d. For a|ll sub-n|
|00005ea0| 6f 64 65 73 20 74 68 61 | 74 20 65 78 69 73 74 20 |odes tha|t exist |
|00005eb0| 74 68 65 20 64 69 73 74 | 61 6e 63 65 20 69 6e 20 |the dist|ance in |
|00005ec0| 74 68 65 20 33 2d 64 69 | 6d 65 6e 73 69 6f 6e 61 |the 3-di|mensiona|
|00005ed0| 6c 0a 63 6f 6c 6f 72 20 | 73 70 61 63 65 20 62 65 |l.color |space be|
|00005ee0| 74 77 65 65 6e 20 74 68 | 65 20 63 6f 6c 6f 72 20 |tween th|e color |
|00005ef0| 6f 66 20 74 68 65 20 70 | 69 78 65 6c 20 61 6e 64 |of the p|ixel and|
|00005f00| 20 74 68 65 20 61 76 65 | 72 61 67 65 20 63 6f 6c | the ave|rage col|
|00005f10| 6f 72 20 6f 66 20 74 68 | 69 73 0a 73 75 62 2d 6e |or of th|is.sub-n|
|00005f20| 6f 64 65 20 69 73 20 63 | 6f 6d 70 75 74 65 64 20 |ode is c|omputed |
|00005f30| 28 4e 4f 54 45 3a 20 49 | 6e 20 70 70 6d 32 66 6c |(NOTE: I|n ppm2fl|
|00005f40| 69 20 74 68 65 20 6d 61 | 78 69 6d 75 6d 20 6e 6f |i the ma|ximum no|
|00005f50| 72 6d 20 69 73 20 75 73 | 65 64 20 61 73 20 74 68 |rm is us|ed as th|
|00005f60| 65 0a 64 69 73 74 61 6e | 63 65 2c 20 6e 6f 74 20 |e.distan|ce, not |
|00005f70| 74 68 65 20 67 65 6f 6d | 65 74 72 69 63 20 64 69 |the geom|etric di|
|00005f80| 73 74 61 6e 63 65 29 2e | 20 54 68 65 6e 20 74 68 |stance).| Then th|
|00005f90| 65 20 73 65 61 72 63 68 | 20 69 73 20 63 6f 6e 74 |e search| is cont|
|00005fa0| 69 6e 75 65 64 20 77 69 | 74 68 20 74 68 65 0a 73 |inued wi|th the.s|
|00005fb0| 75 62 2d 6e 6f 64 65 20 | 74 68 61 74 20 72 65 70 |ub-node |that rep|
|00005fc0| 72 65 73 65 6e 74 73 20 | 74 68 65 20 6c 6f 77 65 |resents |the lowe|
|00005fd0| 73 74 20 64 69 73 74 61 | 6e 63 65 2e 20 54 68 65 |st dista|nce. The|
|00005fe0| 20 70 72 6f 63 65 64 75 | 72 65 20 69 73 20 72 65 | procedu|re is re|
|00005ff0| 70 65 61 74 65 64 20 75 | 6e 74 69 6c 0a 61 20 6c |peated u|ntil.a l|
|00006000| 65 61 66 20 69 73 20 72 | 65 61 63 68 65 64 2e 20 |eaf is r|eached. |
|00006010| 4c 69 6b 65 20 69 6e 20 | 74 68 65 20 72 65 67 75 |Like in |the regu|
|00006020| 6c 61 72 20 63 61 73 65 | 20 74 68 65 20 70 69 78 |lar case| the pix|
|00006030| 65 6c 20 69 73 20 6d 61 | 70 70 65 64 20 74 6f 20 |el is ma|pped to |
|00006040| 74 68 65 20 63 6f 6c 6f | 72 0a 6f 66 20 74 68 69 |the colo|r.of thi|
|00006050| 73 20 6c 65 61 66 2e 20 | 49 66 20 74 68 69 73 20 |s leaf. |If this |
|00006060| 65 78 74 72 61 20 73 65 | 61 72 63 68 20 70 72 6f |extra se|arch pro|
|00006070| 63 65 64 75 72 65 20 69 | 73 20 6e 65 63 65 73 73 |cedure i|s necess|
|00006080| 61 72 79 20 66 6f 72 20 | 73 6f 6d 65 20 70 69 78 |ary for |some pix|
|00006090| 65 6c 73 2c 0a 70 70 6d | 32 66 6c 69 20 63 6f 75 |els,.ppm|2fli cou|
|000060a0| 6e 74 73 20 74 68 65 6d | 20 61 6e 64 20 77 72 69 |nts them| and wri|
|000060b0| 74 65 73 20 69 6e 20 61 | 20 6d 65 73 73 61 67 65 |tes in a| message|
|000060c0| 20 68 6f 77 20 6d 61 6e | 79 20 22 6e 6f 6e 2d 66 | how man|y "non-f|
|000060d0| 69 74 74 69 6e 67 22 20 | 70 69 78 65 6c 73 0a 77 |itting" |pixels.w|
|000060e0| 65 72 65 20 66 6f 75 6e | 64 2e 20 0a 0a 43 6f 6e |ere foun|d. ..Con|
|000060f0| 74 72 6f 6c 6c 69 6e 67 | 20 74 68 65 20 71 75 61 |trolling| the qua|
|00006100| 6e 74 69 7a 61 74 69 6f | 6e 0a 2d 90 1c 0a 20 20 |ntizatio|n.-... |
|00006110| 49 6e 20 74 68 65 20 66 | 6f 6c 6c 6f 77 69 6e 67 |In the f|ollowing|
|00006120| 20 77 65 20 61 73 73 75 | 6d 65 20 74 68 61 74 20 | we assu|me that |
|00006130| 74 68 65 20 6d 61 78 69 | 6d 75 6d 20 6e 75 6d 62 |the maxi|mum numb|
|00006140| 65 72 20 6f 66 20 63 6f | 6c 6f 72 73 20 77 61 73 |er of co|lors was|
|00006150| 20 64 65 74 65 72 6d 69 | 6e 65 64 0a 70 72 65 76 | determi|ned.prev|
|00006160| 69 6f 75 73 6c 79 20 61 | 6e 64 20 74 68 65 20 3c |iously a|nd the <|
|00006170| 6e 75 6d 63 6f 6c 6f 72 | 73 3e 20 70 61 72 61 6d |numcolor|s> param|
|00006180| 65 74 65 72 20 69 73 20 | 6b 65 70 74 20 66 69 78 |eter is |kept fix|
|00006190| 2e 20 55 73 75 61 6c 6c | 79 20 74 68 69 73 20 76 |. Usuall|y this v|
|000061a0| 61 6c 75 65 20 69 73 0a | 32 35 36 20 61 6e 79 77 |alue is.|256 anyw|
|000061b0| 61 79 2e 20 54 68 65 6e | 20 74 68 65 20 70 72 6f |ay. Then| the pro|
|000061c0| 67 72 61 6d 20 68 61 73 | 20 74 77 6f 20 70 61 72 |gram has| two par|
|000061d0| 61 6d 65 74 65 72 73 20 | 62 79 20 77 68 69 63 68 |ameters |by which|
|000061e0| 20 74 68 65 20 73 65 6c | 65 63 74 69 6f 6e 20 6f | the sel|ection o|
|000061f0| 66 20 74 68 65 0a 6f 75 | 74 70 75 74 20 63 6f 6c |f the.ou|tput col|
|00006200| 6f 72 20 74 61 62 6c 65 | 20 63 61 6e 20 62 65 20 |or table| can be |
|00006210| 63 6f 6e 74 72 6f 6c 6c | 65 64 2e 20 54 68 65 73 |controll|ed. Thes|
|00006220| 65 20 61 72 65 20 74 68 | 65 20 3c 6e 6f 64 65 6c |e are th|e <nodel|
|00006230| 69 6d 69 74 3e 20 61 6e | 64 20 74 68 65 0a 3c 72 |imit> an|d the.<r|
|00006240| 65 64 75 63 65 6c 65 76 | 65 6c 73 3e 20 70 61 72 |educelev|els> par|
|00006250| 61 6d 65 74 65 72 73 2e | 20 54 68 65 20 66 69 72 |ameters.| The fir|
|00006260| 73 74 20 6f 6e 65 20 73 | 65 74 73 20 74 68 65 20 |st one s|ets the |
|00006270| 6d 61 78 69 6d 75 6d 20 | 6e 75 6d 62 65 72 20 6f |maximum |number o|
|00006280| 66 20 6e 6f 64 65 73 20 | 69 6e 0a 74 68 65 20 73 |f nodes |in.the s|
|00006290| 65 63 6f 6e 64 2d 66 69 | 6e 65 73 74 20 6c 65 76 |econd-fi|nest lev|
|000062a0| 65 6c 2e 20 4c 69 6b 65 | 20 64 65 73 63 72 69 62 |el. Like| describ|
|000062b0| 65 64 20 61 62 6f 76 65 | 20 74 68 65 20 6c 65 76 |ed above| the lev|
|000062c0| 65 6c 20 6f 66 20 74 68 | 65 20 4f 63 74 72 65 65 |el of th|e Octree|
|000062d0| 20 69 73 0a 72 65 64 75 | 63 65 64 20 77 68 65 6e | is.redu|ced when|
|000062e0| 20 64 75 72 69 6e 67 20 | 74 68 65 20 73 63 61 6e | during |the scan|
|000062f0| 6e 69 6e 67 20 6f 66 20 | 74 68 65 20 69 6e 70 75 |ning of |the inpu|
|00006300| 74 20 69 6d 61 67 65 73 | 20 74 68 69 73 20 76 61 |t images| this va|
|00006310| 6c 75 65 20 69 73 20 65 | 78 63 65 65 64 65 64 2e |lue is e|xceeded.|
|00006320| 0a 57 69 74 68 20 61 20 | 64 65 65 70 65 72 20 6c |.With a |deeper l|
|00006330| 65 76 65 6c 20 69 6e 20 | 74 68 65 20 4f 63 74 72 |evel in |the Octr|
|00006340| 65 65 2c 20 66 69 6e 65 | 72 20 6e 75 61 6e 63 65 |ee, fine|r nuance|
|00006350| 73 20 62 65 74 77 65 65 | 6e 20 6f 75 74 70 75 74 |s betwee|n output|
|00006360| 20 63 6f 6c 6f 72 73 20 | 61 72 65 0a 70 6f 73 73 | colors |are.poss|
|00006370| 69 62 6c 65 2e 20 54 68 | 69 73 20 69 73 20 75 73 |ible. Th|is is us|
|00006380| 65 66 75 6c 20 77 68 65 | 6e 20 73 6d 6f 6f 74 68 |eful whe|n smooth|
|00006390| 20 74 72 61 6e 73 69 74 | 69 6f 6e 73 20 61 72 65 | transit|ions are|
|000063a0| 20 70 72 65 73 65 6e 74 | 20 69 6e 20 74 68 65 20 | present| in the |
|000063b0| 69 6e 70 75 74 0a 69 6d | 61 67 65 73 2e 20 54 79 |input.im|ages. Ty|
|000063c0| 70 69 63 61 6c 6c 79 2c | 20 73 74 65 70 73 20 6f |pically,| steps o|
|000063d0| 63 63 75 72 20 69 6e 20 | 73 75 63 68 20 74 72 61 |ccur in |such tra|
|000063e0| 6e 73 69 74 69 6f 6e 73 | 20 64 75 65 20 74 6f 20 |nsitions| due to |
|000063f0| 74 68 65 20 71 75 61 6e | 74 69 7a 61 74 69 6f 6e |the quan|tization|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.