| 1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 2 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
| 3 |
<head> |
| 4 |
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
| 5 |
<meta http-equiv="X-UA-Compatible" content="IE=11"/> |
| 6 |
<meta name="generator" content="Doxygen 1.9.4"/> |
| 7 |
<meta name="viewport" content="width=device-width, initial-scale=1"/> |
| 8 |
<title>libkate: Format - header packet type 0x80 - ID header</title> |
| 9 |
<link href="tabs.css" rel="stylesheet" type="text/css"/> |
| 10 |
<script type="text/javascript" src="jquery.js"></script> |
| 11 |
<script type="text/javascript" src="dynsections.js"></script> |
| 12 |
<link href="doxygen.css" rel="stylesheet" type="text/css" /> |
| 13 |
</head> |
| 14 |
<body> |
| 15 |
<div id="top"><!-- do not remove this div, it is closed by doxygen! --> |
| 16 |
<div id="titlearea"> |
| 17 |
<table cellspacing="0" cellpadding="0"> |
| 18 |
<tbody> |
| 19 |
<tr id="projectrow"> |
| 20 |
<td id="projectalign"> |
| 21 |
<div id="projectname">libkate<span id="projectnumber"> 0.4.3</span> |
| 22 |
</div> |
| 23 |
</td> |
| 24 |
</tr> |
| 25 |
</tbody> |
| 26 |
</table> |
| 27 |
</div> |
| 28 |
<!-- end header part --> |
| 29 |
<!-- Generated by Doxygen 1.9.4 --> |
| 30 |
<script type="text/javascript" src="menudata.js"></script> |
| 31 |
<script type="text/javascript" src="menu.js"></script> |
| 32 |
<script type="text/javascript"> |
| 33 |
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */ |
| 34 |
$(function() { |
| 35 |
initMenu('',false,false,'search.php','Search'); |
| 36 |
}); |
| 37 |
/* @license-end */ |
| 38 |
</script> |
| 39 |
<div id="main-nav"></div> |
| 40 |
</div><!-- top --> |
| 41 |
<div><div class="header"> |
| 42 |
<div class="headertitle"><div class="title">Format - header packet type 0x80 - ID header </div></div> |
| 43 |
</div><!--header--> |
| 44 |
<div class="contents"> |
| 45 |
<div class="textblock"><p >The ID header must be the first packet in a Kate stream. It carries information about the stream.</p> |
| 46 |
<p >Here is a table description of the format of the ID header:</p> |
| 47 |
<pre class="fragment"> * Kate bitstream version 0.3 |
| 48 |
* |
| 49 |
* Default field type: LITTLE ENDIAN unsigned integer |
| 50 |
|
| 51 |
0 1 2 3 | |
| 52 |
0 1 2 3 | |
| 53 |
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1| Byte |
| 54 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 55 |
| packtype | Identifier char[7]: 'kate\0\0\0' | 0-3 |
| 56 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 57 |
| kate magic continued | 4-7 |
| 58 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 59 |
| reserved - 0 | version major | version minor | num headers | 8-11 |
| 60 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 61 |
| text encoding | directionality| reserved - 0 | granule shift | 12-15 |
| 62 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 63 |
| cw sh | canvas width | ch sh | canvas height | 16-19 |
| 64 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 65 |
| reserved - 0 | 20-23 |
| 66 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 67 |
| granule rate numerator | 24-27 |
| 68 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 69 |
| granule rate denominator | 28-31 |
| 70 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 71 |
| language (NUL terminated) | 32-35 |
| 72 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 73 |
| language (continued) | 36-39 |
| 74 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 75 |
| language (continued) | 40-43 |
| 76 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 77 |
| language (continued) | 44-47 |
| 78 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 79 |
| category (NUL terminated) | 48-51 |
| 80 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 81 |
| category (continued) | 52-55 |
| 82 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 83 |
| category (continued) | 56-59 |
| 84 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 85 |
| category (continued) | 60-63 |
| 86 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+</pre><p >and for a description of those fields:</p> |
| 87 |
<ul> |
| 88 |
<li><code>packtype</code> the packet type for this header - always 0x80</li> |
| 89 |
</ul> |
| 90 |
<ul> |
| 91 |
<li><code>kate</code> <code>magic</code> the 7 byte string "kate\0\0\0", as all other Kate headers</li> |
| 92 |
</ul> |
| 93 |
<ul> |
| 94 |
<li><code>version</code> <code>major</code> the major version number of the bitstream</li> |
| 95 |
</ul> |
| 96 |
<ul> |
| 97 |
<li><code>version</code> <code>minor</code> the minor version number of the bitstream</li> |
| 98 |
</ul> |
| 99 |
<ul> |
| 100 |
<li><code>num</code> <code>headers</code> the number of header packets present in this stream</li> |
| 101 |
</ul> |
| 102 |
<ul> |
| 103 |
<li><code>text</code> <code>encoding</code> the default encoding used by text (usually 0, UTF-8)</li> |
| 104 |
</ul> |
| 105 |
<ul> |
| 106 |
<li><code>directionality</code> the default directionality of the text</li> |
| 107 |
</ul> |
| 108 |
<ul> |
| 109 |
<li><code>granule</code> <code>shift</code> the number of bits in the granule positions reserved for storing the offset part</li> |
| 110 |
</ul> |
| 111 |
<ul> |
| 112 |
<li><code>cw</code> <code>sh</code> (from bitstream 0.2) the number of bits to left shift the <code>canvas</code> <code>width</code> field to compute the original canvas width </li> |
| 113 |
<li><code>canvas</code> width (from bitstream 0.2) the number to shift left by <code>cw</code> <code>sh</code> to compute the original canvas width</li> |
| 114 |
</ul> |
| 115 |
<p>zero is a valid width, and represents an unset width</p> |
| 116 |
<ul> |
| 117 |
<li><code>ch</code> <code>sh</code> (from bitstream 0.2) the number of bits to left shift the <code>canvas</code> <code>height</code> field to compute the original canvas height </li> |
| 118 |
<li><code>canvas</code> height (from bitstream 0.2) the number to shift left by <code>ch</code> <code>sh</code> to compute the original canvas height</li> |
| 119 |
</ul> |
| 120 |
<p>zero is a valid height, and represents an unset height</p> |
| 121 |
<ul> |
| 122 |
<li><code>granule</code> <code>rate</code> <code>numerator</code> the numerator of the fraction representing how many granule units represent a second (from bitstream 0.2)</li> |
| 123 |
</ul> |
| 124 |
<ul> |
| 125 |
<li><code>granule</code> <code>rate</code> <code>denominator</code> the denominator of the fraction representing how many granule units represent a second</li> |
| 126 |
</ul> |
| 127 |
<ul> |
| 128 |
<li><code>language</code> the default language of the text in this stream (will be NUL terminated)</li> |
| 129 |
</ul> |
| 130 |
<p>an empty string is a valid language, and represents an unset language</p> |
| 131 |
<ul> |
| 132 |
<li><code>category</code> the category of the text in this stream (will be NUL terminated)</li> |
| 133 |
</ul> |
| 134 |
<p>an empty string is a valid category, and represents an unset category</p> |
| 135 |
<p >All fields marked as "reserved - 0" should be set to zero when encoding a stream with this version of the bitstream format. However, if decoding a stream encoded with a version of the bitstream format with the same bitstream major version but a higher bitstream minor version, those fields may be non zero, if they were subsequently allocated to carry additional information. </p> |
| 136 |
</div></div><!-- contents --> |
| 137 |
</div><!-- PageDoc --> |
| 138 |
<!-- start footer part --> |
| 139 |
<hr class="footer"/><address class="footer"><small> |
| 140 |
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.4 |
| 141 |
</small></address> |
| 142 |
</body> |
| 143 |
</html> |