:pserver:cvs@pserver.samba.org:/cvsroot - gnokii - Tue Dec 4 22:45 CET 2001
[gnokii.git] / Docs / logos.txt
1 $Id$
2
3 ------------------------[ Tutorial about logos files ]-------------------------
4 nol (operator logo) and ngg (caller logo) files include the header as few
5 first bytes of their content. That is 16 or 20 bytes structure. Header
6 contains type of the file, netcode, width and height of icon. But width and
7 height of icon is very important. Why? Because in NOKIA 7110, width = 72 bytes
8 and height = 28 lines, and in other NOKIA phones witdh = 72 bytes, but height
9 is only 14 lines ( thx for that info to Gabriele Zappi ).
10
11 [1] NOL header
12
13             1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
14             N O L 0 1 0 x 0 1  0  x  0  x  0  1  0  1  0  x  0
15
16     so :
17         first 3 bytes that's type of file
18         next 3 bytes (4,5,6) - nothing important
19         next 4 (7,8,9,10) - network code :
20                sprintf(netcode, "%d %02d", header[7] + 256 * header[8], header[9]);
21                <<<<<<<<<<< this line is from common/gsm-common.h >>>>>>>>>>>
22         
23         next 3 (11,12,13) - very important bytes :
24                             width of icon = header[11]
25                             height of icon = header[13]
26         another 7 bytes (14,15,..,20) - I think that's nothing special
27     
28 [2] NGG header
29
30                1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
31                N G G 0 1 0 x 0 x  0  1  0  1  0  x  0
32
33         so :
34            first 3 bytes that's type of file 
35            next 3 bytes (4,5,6) - nothing important
36            next 3 (7,8,9) - very important
37                             width of icon = header[7]
38                             height of icon = header[9]
39            another 7 bytes (10,11,..,16) - nothing special 
40
41 [3] icon's bytes
42
43 To show icon on terminal you can read (height) times 72 bytes line and print
44 these lines in the terminal:
45
46              ...
47              for (i = 0; i < heigth; i++) {
48                  read(buffer, 1, width, fd);
49                  printf("%s\n", buffer);
50              }
51              ...         
52
53 ------------------[ 2001 crayola <--> szuflandia corporation ]-----------------
54                    crayola@polbox.com klepacz@juni.gliwice.pl