|
iRex DR1000 Merger v0.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectit.andynaz.irex.dr1000.scribble.Page
public class Page
Represent a page of scribbles.
The scribbles are organized as a list of Stroke
objects, which have a
list of Stroke.Point
objects.
Scribbles are stored in the annotations.data
column (see
documentation of class ScribbleMgr
),
as a binary blob with the following structure. The not-used parts are
represented in gray (in this case the meaning is not sure) and the bytes in
the examples are represented as a couple of hexadecimal digits. Note that
the bytes are stored in a reversed order, so that the pair of bytes "01 00"
represent the integer 1 (and not 256)
The first 40 bytes are the ones related to the page data:
length | type | meaning | example |
---|---|---|---|
2 | version | 01 00 | |
4 | orientation | 00 00 00 00 | |
8 | page_pixel | 00 00 00 00 00 00 00 00 | |
2 | page_r | 00 00 | |
2 | page_g | 00 00 | |
2 | page_b | 00 00 | |
4 | ul_x | 00 00 00 00 | |
4 | ul_y | 00 00 00 00 | |
4 | lr_x | D7 04 00 00 | |
4 | lr_y | DA 06 00 00 | |
4 | int | number of strokes | A3 00 00 00 |
Only the last one is actually used, as it indicates the number of strokes in the page.
After that 40 bytes, there is a sequence of 24 bytes representing the properties of a stroke, according to the following schema.
length | type | meaning | example |
---|---|---|---|
4 | color | 03 00 00 00 | |
4 | float | zoom | D7 A0 89 42 |
4 | layer | 00 00 00 00 | |
4 | shape | 00 00 00 00 | |
4 | int | width | 01 00 00 00 |
4 | int | number of points | 35 00 00 00 |
After that part, there is a sequence of 12-bytes blocks, each representing a point, according to the following schema.
length | type | meaning | example |
---|---|---|---|
4 | int | x coordinate | 48 00 00 00 |
4 | int | y coordinate | 6C 00 00 00 |
4 | pressure | 00 00 00 00 |
After the sequence of points, another stroke begins (or the end of the blob is reached).
To create a Page
object from a blob, use the createSCribblePage
method.
Field Summary | |
---|---|
private List<Stroke> |
lStroke
List of strokes. |
Constructor Summary | |
---|---|
Page()
Creates a new Page object. |
Method Summary | |
---|---|
void |
addStroke(Stroke s)
Add a stroke. |
static Page |
createSCribblePage(List<Integer> l)
Create a Page from the blob. |
void |
drawStrokes(com.lowagie.text.pdf.PdfContentByte cb,
float xAdjust,
float yAdjust)
Draw all the strokes of this page. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private List<Stroke> lStroke
Constructor Detail |
---|
public Page()
Method Detail |
---|
public void addStroke(Stroke s)
s
- the stroke to addpublic void drawStrokes(com.lowagie.text.pdf.PdfContentByte cb, float xAdjust, float yAdjust)
cb
- the content of the PDFxAdjust
- the parameter to adjust the 'x' coordinates of the strokesyAdjust
- the parameter to adjust the 'y' coordinates of the strokespublic static Page createSCribblePage(List<Integer> l)
Stroke
objects inside the Page.
l
- the blob
null
if the
list l
is empty
|
iRex DR1000 Merger v0.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |