99 | | The PKM compression method is some sort of Run-Length-Compression which is |
100 | | very efficient on pictures with long horizontal color repetitions. |
101 | | Actually, the compression is efficient if there are often more than 3 times |
102 | | the same color consecutively. |
103 | | |
104 | | I think that it would be better to give you the algorithm instead of swim- |
105 | | ming in incomprehensible explanations. |
106 | | |
107 | | {{{ |
| 99 | The PKM compression method is some sort of Run-Length-Compression which is very efficient on pictures with long horizontal color repetitions. |
| 100 | |
| 101 | Actually, the compression is efficient if there are often more than 3 times the same color consecutively. |
| 102 | |
| 103 | I think that it would be better to give you the algorithm instead of swimming in incomprehensible explanations. |
| 104 | |
| 105 | {{{#!C |
198 | | * As you can see, there could be a problem when you'd want to pack a raw |
199 | | pixel with a color equal to Pack_byte or Pack_word. These pixels should |
200 | | always be coded as a packet even if there is only one pixel. |
201 | | |
202 | | Example: (we suppose that Pack_byte=9) |
203 | | 9 will be encoded 9,9,1 (The 1st 9 in the encoded... |
204 | | 9,9 will be encoded 9,9,2 ... sequence is Pack_byte) |
205 | | etc... |
| 202 | * As you can see, there could be a problem when you'd want to pack a raw pixel with a color equal to Pack_byte or Pack_word. These pixels should always be coded as a packet even if there is only one pixel. |
| 203 | |
| 204 | Example: (we suppose that Pack_byte=9) |
| 205 | * {{{9}}} will be encoded {{{9,9,1}}} (The 1st 9 in the encoded sequence is Pack_byte) |
| 206 | * {{{9,9}}} will be encoded {{{9,9,2}}} |
| 207 | * etc... |