Skip to content

PES CSewSeg section

tatarize edited this page Apr 21, 2017 · 16 revisions
Type Bytes Value Description
u16 2 7 Length of following string
char 7 "CSewSeg" CSewSeg identification
csewseg_stitch_list CSewSeg stitch list subsection
csewseg_color_list CSewSeg color list subsection
u16 2 0 (typical) Unknown
u16 2 0 (typical) Unknown

CSewSeg stitch list subsection

The CSewSeg stitch list subsection is divided into stitch blocks. The last block does not end with the continuation code 0x8003 and so is 2 bytes shorter than the others. Some files seem to limit the number of stitches to a maximum of 1000 per block, is this required?

Type Bytes Value Description
u16 2 0 | 1 | ? Stitch type where 0 means a normal stitch and 1 means a jump stitch
u16 2 Thread index for block + 1
u16 2 N1 Number of following coordinates
csewseg_coordinates 4×N1 CSewSeg coordinate subsection
u16 2 0x8003 | ? Continuation code where 0x8003 means list continues with another following block, with the last block not having this field at all

CSewSeg coordinate subsection

Type Bytes Value Description
s16 2 Stitch x coordinate
s16 2 Stitch y coordinate

CSewSeg color list subsection

Type Bytes Value Description
u16 2 N1 Number of following colors
csewseg_color 4×N1 CSewSeg color subsection

CSewSeg color subsection

Type Bytes Value Description
u16 2 Block index where change of thread takes effect, starting from zero
u16 2 In PES versions 1 through 4 this is a PEC thread palette index and in versions 5 and 6 this is a thread index defined in the PES header section

Header

The header for the first block is contained within the CEmbOne section. However, if the PES Header specified that there would be more than one CSewSeg object these headers will be appended along with additional stitchgroups.

Type Bytes Value Description
u16 2 7 Length of following string
char 7 "CEmbOne" CEmbOne identification
section 40 Block Geometry, Extents and Affine Transformation
u16 2 1 (typical) Unknown
s16 2 CSewSeg x coordinate translation?
s16 2 CSewSeg y coordinate translation?
s16 2 CSewSeg width
s16 2 CSewSeg height
u8 8 0 (typical) Unknown
u16 2 CSewSeg block count