s_binary("89504E470D0A1A0A"); // IHDRChunk s_binary_block_size_word_bigendian_variable("IHDR"); //size of data field s_block_start("IHDRcrc"); s_string("IHDR"); // type s_block_start("IHDR"); // 1=BINARYBIGENDIAN, 3=ONEBYE s_int_variable(0x1a, 1); // Width s_int_variable(0x14, 1); // Height s_int_variable(0x8, 3); // Bit Depth - should be 1,2,4,8,16, based on colortype s_int_variable(0x3, 3); // ColorType - should be 0,2,3,4,6 s_binary("00 00"); // Compression || Filter - shall be 00 00 s_int_variable(0x0, 3); // Interlace - should be 0,1 s_block_end("IHDR"); s_binary_block_crc_word_littleendian("IHDRcrc"); // crc of type and data s_block_end("IHDRcrc"); // Palette Chunk s_binary_block_size_word_bigendian_variable("PLTE"); //size of data field s_block_start("PLTEcrc"); s_string("PLTE"); // type s_block_start("PLTE"); s_binary("00 00 00 36 b7 24 ff ff ff ee 12 12 4a 4a 4a ff b0 12 ee ee 12 1f 3f c0 a0 a0 a0 4f 6f df cc cc cc b0 b0 b0 1c 75 1d 24 24 24 32 cb fe a2 09 0a 11 11 11 12 12 12 13 13 13 14 14 14 15 15 15 16 16 16 17 17 17 18 18 18 19 19 19 1a 1a 1a 1b 1b 1b 1c 1c 1c 1d 1d 1d 1e 1e 1e 1f 1f 1f 20 20 20 21 21 21 22 22 22 23 23 23 24 24 24 25 25 25 26 26 26 27 27 27 28 28 28 29 29 29 2a 2a 2a 2b 2b 2b 2c 2c 2c 2d 2d 2d 2e 2e 2e 2f 2f 2f 30 30 30 31 31 31 32 32 32 33 33 33 34 34 34 35 35 35 36 36 36 37 37 37 38 38 38 39 39 39 3a 3a 3a 3b 3b 3b 3c 3c 3c 3d 3d 3d"); s_binary("3e 3e 3e 3f 3f 3f 40 40 40 41 41 41 42 42 42 43 43 43 44 44 44 45 45 45 46 46 46 47 47 47 48 48 48 49 49 49 4a 4a 4a 4b 4b 4b 4c 4c 4c 4d 4d 4d"); s_binary("4e 4e 4e 4f 4f 4f 50 50 50 51 51 51 52 52 52 53 53 53 54 54 54 55 55 55 56 56 56 57 57 57 58 58 58 59 59 59 5a 5a 5a 5b 5b 5b 5c 5c 5c 5d 5d 5d"); s_binary("5e 5e 5e 5f 5f 5f 60 60 60 61 61 61 62 62 62 63 63 63 64 64 64 65 65 65 66 66 66 67 67 67 68 68 68 69 69 69 6a 6a 6a 6b 6b 6b 6c 6c 6c 6d 6d 6d"); s_binary("6e 6e 6e 6f 6f 6f 70 70 70 71 71 71 72 72 72 73 73 73 74 74 74 75 75 75 76 76 76 77 77 77 78 78 78 79 79 79 7a 7a 7a 7b 7b 7b 7c 7c 7c 7d 7d 7d"); s_binary("7e 7e 7e 7f 7f 7f 80 80 80 81 81 81 82 82 82 83 83 83 84 84 84 85 85 85 86 86 86 87 87 87 88 88 88 89 89 89 8a 8a 8a 8b 8b 8b 8c 8c 8c 8d 8d 8d"); s_binary("8e 8e 8e 8f 8f 8f 90 90 90 91 91 91 92 92 92 93 93 93 94 94 94 95 95 95 96 96 96 97 97 97 98 98 98 99 99 99 9a 9a 9a 9b 9b 9b 9c 9c 9c 9d 9d 9d"); s_binary("9e 9e 9e 9f 9f 9f a0 a0 a0 a1 a1 a1 a2 a2 a2 a3 a3 a3 a4 a4 a4 a5 a5 a5 a6 a6 a6 a7 a7 a7 a8 a8 a8 a9 a9 a9 aa aa aa ab ab ab ac ac ac ad ad ad"); s_binary("ae ae ae af af af b0 b0 b0 b1 b1 b1 b2 b2 b2 b3 b3 b3 b4 b4 b4 b5 b5 b5 b6 b6 b6 b7 b7 b7 b8 b8 b8 b9 b9 b9 ba ba ba bb bb bb bc bc bc bd bd bd"); s_binary("be be be bf bf bf c0 c0 c0 c1 c1 c1 c2 c2 c2 c3 c3 c3 c4 c4 c4 c5 c5 c5 c6 c6 c6 c7 c7 c7 c8 c8 c8 c9 c9 c9 ca ca ca cb cb cb cc cc cc cd cd cd"); s_binary("ce ce ce cf cf cf d0 d0 d0 d1 d1 d1 d2 d2 d2 d3 d3 d3 d4 d4 d4 d5 d5 d5 d6 d6 d6 d7 d7 d7 d8 d8 d8 d9 d9 d9 da da da db db db dc dc dc dd dd dd"); s_binary("de de de df df df e0 e0 e0 e1 e1 e1 e2 e2 e2 e3 e3 e3 e4 e4 e4 e5 e5 e5 e6 e6 e6 e7 e7 e7 e8 e8 e8 e9 e9 e9 ea ea ea eb eb eb ec ec ec ed ed ed"); s_binary("ee ee ee ef ef ef f0 f0 f0 f1 f1 f1 f2 f2 f2 f3 f3 f3 f4 f4 f4 f5 f5 f5 f6 f6 f6 f7 f7 f7 f8 f8 f8 f9 f9 f9 fa fa fa fb fb fb fc fc fc fd fd fd fe fe fe ff ff ff "); s_block_end("PLTE"); s_binary_block_crc_word_littleendian("PLTEcrc"); // crc of type and data s_block_end("PLTEcrc"); // Optional Background Color Chunk bKGD s_binary_block_size_word_bigendian_variable("bKGD"); //size of data field s_block_start("bKGDcrc"); s_string("bKGD"); // type s_block_start("bKGD"); s_binary("00"); s_block_end("bKGD"); s_binary_block_crc_word_littleendian("bKGDcrc"); // crc of type and data s_block_end("bKGDcrc"); // Optional Physical Pixel Dimension chunk pHYs s_binary_block_size_word_bigendian_variable("pHYs"); //size of data field s_block_start("pHYscrc"); s_string("pHYs"); // type s_block_start("pHYs"); s_int_variable(0xb13, 1); // Pixels per unit X s_int_variable(0xb13, 1); // Pixels per unit Y s_int_variable(0x1, 3); // Unit specifer, 1 = meter s_block_end("pHYs"); s_binary_block_crc_word_littleendian("pHYscrc"); // crc of type and data s_block_end("pHYscrc"); // Optional Suggested palette sPLT //s_binary_block_size_word_bigendian_variable("sPLT"); //size of data field //s_block_start("sPLTcrc"); // s_string("sPLT"); // type // s_block_start("sPLT"); // s_string_variable("Palette name"); // Palette name < 79 bytes // s_binary("00"); // Null // s_binary("08"); // Sample depth // s_string_variable("AAAAAA"); // Should be divisible by 6 // s_block_end("sPLT"); //s_binary_block_crc_word_littleendian("sPLTcrc"); // crc of type and data //s_block_end("sPLTcrc"); // Optional Image Last-Modification Time tIME s_binary_block_size_word_bigendian_variable("tIME"); //size of data field s_block_start("tIMEcrc"); s_string("tIME"); // type s_block_start("tIME"); s_binary("07 d4 09 11 03 16 22"); s_block_end("tIME"); s_binary_block_crc_word_littleendian("tIMEcrc"); // crc of type and data s_block_end("tIMEcrc"); // N of these // Image Data s_binary_block_size_word_bigendian_variable("IDAT"); //size of data field s_block_start("IDATcrc"); s_string("IDAT"); // type s_block_start("IDAT"); s_binary("78 da 8d 91 db 12 00 10 08"); s_binary("44 8d fe ff 9f 49 c5 d2 6c 63 9f d4 d1 bd b5 42"); s_binary("32 d5 1f a9 cf 91 64 a2 a8 27 66 0e 45 2f 73 73"); s_binary("21 33 04 80 be 0d 41 e0 f9 14 28 5c 10 be 91 27"); s_binary("82 aa 07 dd 15 7f 11 4f c8 db a0 cd f3 91 f9 a2"); s_binary("f8 7a 8b a3 14 a7 a4 1a 47 00 04 0d "); s_block_end("IDAT"); s_binary_block_crc_word_littleendian("IDATcrc"); // crc of type and data s_block_end("IDATcrc"); // N of these // Optional Internationalization Textual Data iTXt //s_binary_block_size_word_bigendian_variable_variable("iTXt"); //size of data field //s_block_start("iTXtcrc"); // s_string("iTXt"); // type // s_block_start("iTXt"); // s_string_variable("Keyword"); // Keyword < 79 bytes // s_binary("00 00 00"); // null and no compression // s_string_variable("en-uk"); // Language tag // s_binary("00"); // null // s_string_variable("Keyvord"); // Translated keyword // s_binary("00"); // null // s_string_variable("text"); // Text // s_block_end("iTXt"); //s_binary_block_crc_word_littleendian("iTXtcrc"); // crc of type and data //s_block_end("iTXtcrc"); // N of these // Optional Textual Data //s_binary_block_size_word_bigendian_variable_variable("tEXt"); //size of data field //s_block_start("tEXtcrc"); // s_string("tEXt"); // type // s_block_start("tEXt"); // s_string_variable("Title"); // < 79 bytes // s_binary("00"); // s_string_variable("text"); // s_block_end("tEXt"); //s_binary_block_crc_word_littleendian("tEXtcrc"); // crc of type and data //s_block_end("tEXtcrc"); // Optional Compressed Textual Data //s_binary_block_size_word_bigendian_variable_variable("zTXt"); //size of data field //s_block_start("zTXtcrc"); // s_string("zTXt"); // type // s_block_start("zTXt"); // s_string_variable("Title"); // < 79 bytes // s_binary("00 00"); // NULL | Compression method // s_binary("78 01 4b 4c 4c 04"); // zip stream // s_block_end("zTXt"); //s_binary_block_crc_word_littleendian("zTXtcrc"); // crc of type and data //s_block_end("zTXtcrc"); // Image trailer s_binary_block_size_word_bigendian_variable("IEND"); //size of data field s_block_start("IENDcrc"); s_string("IEND"); // type s_block_start("IEND"); s_block_end("IEND"); s_binary_block_crc_word_littleendian("IENDcrc"); // crc of type and data s_block_end("IENDcrc");