Updated the specs after writing BShape
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2635 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -2,7 +2,6 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>BPicture specifications</title>
|
<title>BPicture specifications</title>
|
||||||
|
|
||||||
<meta http-equiv="content-type"
|
<meta http-equiv="content-type"
|
||||||
content="text/html; charset=ISO-8859-1">
|
content="text/html; charset=ISO-8859-1">
|
||||||
<meta name="author" content="Marc Flerackers([email protected])">
|
<meta name="author" content="Marc Flerackers([email protected])">
|
||||||
@@ -10,7 +9,8 @@
|
|||||||
content="BPicture specifications for OpenBeOS">
|
content="BPicture specifications for OpenBeOS">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<span style="font-weight: bold; text-decoration: underline;">Picture data</span><br>
|
<span style="font-weight: bold; text-decoration: underline;">Picture
|
||||||
|
data</span><br>
|
||||||
<br>
|
<br>
|
||||||
The data of a BPicture is composed of instructions.<br>
|
The data of a BPicture is composed of instructions.<br>
|
||||||
<br>
|
<br>
|
||||||
@@ -29,15 +29,14 @@ These instructions have a small header, which looks as follows:<br>
|
|||||||
<td valign="top">size</td>
|
<td valign="top">size</td>
|
||||||
<td valign="top">The size of the data</td>
|
<td valign="top">The size of the data</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<br>
|
<br>
|
||||||
After this header the data follows. There are two exceptions: EnterStateChange
|
After this header the data follows. There are two exceptions:
|
||||||
and EnterFontState. These are used to enclose state and font changes. For
|
EnterStateChange and EnterFontState. These are used to enclose state and
|
||||||
ExitStateChange and ExitFontState there are no instructions, this is not needed
|
font changes. For ExitStateChange and ExitFontState there are no
|
||||||
as we know the size of the instruction block in the header of the Enter*
|
instructions, this is not needed as we know the size of the instruction
|
||||||
functions.<br>
|
block in the header of the Enter* functions.<br>
|
||||||
<br>
|
<br>
|
||||||
These are the known instructions at the moment:<br>
|
These are the known instructions at the moment:<br>
|
||||||
<br>
|
<br>
|
||||||
@@ -198,6 +197,17 @@ int32 flags<br>
|
|||||||
pixel data<br>
|
pixel data<br>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td valign="top">0x0112<br>
|
||||||
|
</td>
|
||||||
|
<td valign="top">DrawPicture<br>
|
||||||
|
</td>
|
||||||
|
<td valign="top">12<br>
|
||||||
|
</td>
|
||||||
|
<td valign="top">BPoint where?<br>
|
||||||
|
????<br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="top">0x0113</td>
|
<td valign="top">0x0113</td>
|
||||||
<td valign="top">StrokeArc<br>
|
<td valign="top">StrokeArc<br>
|
||||||
@@ -251,8 +261,19 @@ float arcTheta</td>
|
|||||||
<tr>
|
<tr>
|
||||||
<td valign="top">0x0201</td>
|
<td valign="top">0x0201</td>
|
||||||
<td valign="top">SetClippingRects</td>
|
<td valign="top">SetClippingRects</td>
|
||||||
<td valign="top">TODO</td>
|
<td valign="top">16 + size of rects<br>
|
||||||
<td valign="top">TODO</td>
|
</td>
|
||||||
|
<td valign="top">clipping_rect bound<br>
|
||||||
|
clipping_rect *rect</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td valign="top">0x0202</td>
|
||||||
|
<td valign="top">ClipToPicture</td>
|
||||||
|
<td valign="top">7 + 8 + 1 </td>
|
||||||
|
<td valign="top">zero bytes<br>
|
||||||
|
BPoint pt<br>
|
||||||
|
bool clip_to_inverse_picture<br>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="top">0x0203<br>
|
<td valign="top">0x0203<br>
|
||||||
@@ -275,11 +296,11 @@ float arcTheta</td>
|
|||||||
<tr>
|
<tr>
|
||||||
<td valign="top">0x0205<br>
|
<td valign="top">0x0205<br>
|
||||||
</td>
|
</td>
|
||||||
<td valign="top">SetClippingRects<br>
|
<td valign="top">SetClippingRects </td>
|
||||||
|
<td valign="top">0 </td>
|
||||||
|
<td valign="top">This is a shorter instruction for 0 clipping
|
||||||
|
rects.<br>
|
||||||
</td>
|
</td>
|
||||||
<td valign="top">TODO<br>
|
|
||||||
</td>
|
|
||||||
<td valign="top">TODO</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="top">0x0300<br>
|
<td valign="top">0x0300<br>
|
||||||
@@ -377,6 +398,17 @@ float miterLimit<br>
|
|||||||
<td valign="top">size of font instructions</td>
|
<td valign="top">size of font instructions</td>
|
||||||
<td valign="top">font instructions</td>
|
<td valign="top">font instructions</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td valign="top">0x030A<br>
|
||||||
|
</td>
|
||||||
|
<td valign="top">SetBlendingMode<br>
|
||||||
|
</td>
|
||||||
|
<td valign="top">4<br>
|
||||||
|
</td>
|
||||||
|
<td valign="top">source_alpha alphaSrcMode<br>
|
||||||
|
alpha_function alphaFncMode<br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="top">0x0380<br>
|
<td valign="top">0x0380<br>
|
||||||
</td>
|
</td>
|
||||||
@@ -466,7 +498,6 @@ char style</td>
|
|||||||
<td valign="top">int32 flags<br>
|
<td valign="top">int32 flags<br>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<br>
|
<br>
|
||||||
@@ -476,29 +507,22 @@ There are a few undocumented instructions:<br>
|
|||||||
style="text-align: left;" width="100%">
|
style="text-align: left;" width="100%">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="top">30A<br>
|
<td valign="top">0x0388<br>
|
||||||
</td>
|
|
||||||
<td valign="top">????<br>
|
|
||||||
</td>
|
</td>
|
||||||
|
<td valign="top">SetFontBPP </td>
|
||||||
<td valign="top">4<br>
|
<td valign="top">4<br>
|
||||||
</td>
|
</td>
|
||||||
<td valign="top">some state change</td>
|
<td valign="top"> int32 bpp </td>
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td valign="top">388<br>
|
|
||||||
</td>
|
|
||||||
<td valign="top">????<br>
|
|
||||||
</td>
|
|
||||||
<td valign="top">4<br>
|
|
||||||
</td>
|
|
||||||
<td valign="top">some font change<br>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<br>
|
<br>
|
||||||
Also, not all instructions where checked yet. The SetClippingRects and DrawPixels
|
Also, not all instructions where checked yet. The SetClippingRects and
|
||||||
data has still to be documented.<br>
|
DrawPixels data has still to be documented.<br>
|
||||||
|
<br>
|
||||||
|
Regarding DrawPicture and ClipToPicture, it seems the pictures to draw
|
||||||
|
are not inside the flattened data, instead they are stored as messages
|
||||||
|
in the BMessage in a field called "piclib".<br>
|
||||||
<br>
|
<br>
|
||||||
<span style="font-weight: bold; text-decoration: underline;">Shape data</span><br>
|
<span style="font-weight: bold; text-decoration: underline;">Shape data</span><br>
|
||||||
<br>
|
<br>
|
||||||
@@ -514,11 +538,11 @@ The shape data contained in a BPicture is stored as follows:<br>
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="top" rowspan="1" colspan="1">int32 *instructions<br>
|
<td valign="top" rowspan="1" colspan="1">uint32 *instructions<br>
|
||||||
</td>
|
</td>
|
||||||
<td valign="top" rowspan="1" colspan="1">Each instruction looks like:<br>
|
<td valign="top" rowspan="1" colspan="1">Each instruction looks
|
||||||
First byte is the instruction id, MoveTo is not coded as a seperate instruction,
|
like:<br>
|
||||||
but as a bitflag of the next instruction 0x80 see the table below.<br>
|
First byte is the instruction id<br>
|
||||||
The next three bytes is the amount of points used*<br>
|
The next three bytes is the amount of points used*<br>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -531,10 +555,9 @@ The next three bytes is the amount of points used*<br>
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td valign="top">BPoint *points </td>
|
||||||
<td valign="top">points<br>
|
<td valign="top">points<br>
|
||||||
</td>
|
</td>
|
||||||
<td valign="top"><br>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
@@ -553,51 +576,78 @@ The next three bytes is the amount of points used*<br>
|
|||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="top">0x0B</td>
|
<td valign="top">0x80</td>
|
||||||
<td valign="top">MoveTo</td>
|
<td valign="top">MoveTo</td>
|
||||||
<td valign="top">1</td>
|
|
||||||
<td valign="top"><br>
|
<td valign="top"><br>
|
||||||
</td>
|
</td>
|
||||||
|
<td valign="top">
|
||||||
|
<ul>
|
||||||
|
<li>A "MoveTo" instruction doesn't stand alone, but is OR-ed
|
||||||
|
with a "LineTo" or "BezierTo" instruction<br>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="top">0x10 </td>
|
<td valign="top">0x10 </td>
|
||||||
<td valign="top">LineTo</td>
|
<td valign="top">LineTo</td>
|
||||||
<td valign="top">point count in instruction<br>
|
<td valign="top">point count in instruction<br>
|
||||||
</td>
|
</td>
|
||||||
<td valign="top"><br>
|
<td valign="top">
|
||||||
|
<ul>
|
||||||
|
<li>One "LineTo" instruction draws "count" lines</li>
|
||||||
|
</ul>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="top">0x90 </td>
|
<td valign="top">0x90 </td>
|
||||||
<td valign="top">MoveTo LineTo</td>
|
<td valign="top">MoveTo LineTo</td>
|
||||||
<td valign="top">point count in instruction + 1</td>
|
<td valign="top">point count in instruction + 1</td>
|
||||||
<td valign="top"><br>
|
<td valign="top">
|
||||||
|
<ul>
|
||||||
|
<li>There is one extra point for the "MoveTo", which is not
|
||||||
|
counted in the instruction.<br>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="top">0x20 </td>
|
<td valign="top">0x20 </td>
|
||||||
<td valign="top">BezierTo</td>
|
<td valign="top">BezierTo</td>
|
||||||
<td valign="top">point count in instruction</td>
|
<td valign="top">point count in instruction</td>
|
||||||
<td valign="top">point count is always multiple of 3<br>
|
<td valign="top">
|
||||||
|
<ul>
|
||||||
|
<li>One "BezierTo" instruction draws "count" lines</li>
|
||||||
|
</ul>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="top">0xA0 </td>
|
<td valign="top">0xA0 </td>
|
||||||
<td valign="top">MoveTo BezierTo</td>
|
<td valign="top">MoveTo BezierTo</td>
|
||||||
<td valign="top">point count in instruction + 1</td>
|
<td valign="top">point count in instruction + 1</td>
|
||||||
<td valign="top">point count is always multiple of 3</td>
|
<td valign="top">
|
||||||
|
<ul>
|
||||||
|
<li>There is one extra point for the "MoveTo", which is not
|
||||||
|
counted in the instruction.<br>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="top">0x70 </td>
|
<td valign="top">0x40 </td>
|
||||||
<td valign="top">Close</td>
|
<td valign="top">Close</td>
|
||||||
<td valign="top">0<br>
|
<td valign="top">0 </td>
|
||||||
</td>
|
<td valign="top">
|
||||||
<td valign="top"><br>
|
<ul>
|
||||||
|
<li>"Close" can only follow a "LineTo" or "BezierTo" instruction</li>
|
||||||
|
<li>If an instruction follows "Close", the new instruction is
|
||||||
|
OR-ed with "Close" and replaces it instruction</li>
|
||||||
|
<li>A shape never starts with "Close"</li>
|
||||||
|
</ul>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user