PES文件编码
八月 10, 2010 by 花老鼠 · Leave a Comment
PES格式的绣花文件是Deco、Brother、Babylock等绣花机共用的绣花文件格式。这个格式的优点在于包含了颜色信息,包含了绣花框大小的信息。下面是PES的编码构成
Most numerical values appear to be 16 bit signed ints and are shown as such in this document, unless otherwise noted.
All characters appear to be ascii.
#PES0001 (16 bytes in this section)
1. address of the PEC section start (this is a UInt32)
2. a value of 1 here seems to indicate design data is over 100KB long, or 0 for less than 100KB
3. 1 (the rest of the fields in this section appear to be always the same; they also match the ending fields of the next section)
4. 1
5. -1
6. 0
7. number of characters in the name of the next class (7 for CEmbOne)
CEmbOne (66 bytes in this section)
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22. design X offset
23. design Y offset
24. design width
25. design height
26.
27.
28.
29. 1 (the rest of the fields in this section appear to be always the same; they also match the ending fields of the previous section)
30. 1
31. -1
32. 0
33. number of characters in the name of the next class (7 for CSewSeg)
CSewSeg
Start stitch blocks
Block:
(color start indicator) (all color changes have the same value for this field; if the value here is not the same as the first block, it’s not a color change)
(color index)
(number of stitches in this block)
(x value)
(y value)
(x value)
(y value)
(x value)
…
-32765 (block seperator or joiner) (03 80 in hex, 32771 as UInt16)
(block)
(block seperator)
(block)
(block seperator)
…
when you read all the stitches for a block and the next value is not a block seperator, stitch blocks are done (I think)
Start color table:
(color index)
(number of blocks before next color change?)
(color index)
(number of blocks)
…
This block ends with 0 0 (00 00 in hex)
After the color table should be 16716 (LA in char, 4C 41 in hex) which seems to signal the start of the PEC section
这边还有C#的解析源码
