Cnd Format Reader

pull/133/head
Tatarize 2021-10-01 08:57:22 -07:00
rodzic 2bcbfffe1b
commit c9f432f2fb
2 zmienionych plików z 38 dodań i 0 usunięć

Wyświetl plik

@ -0,0 +1,28 @@
from .ReadHelper import read_int_16le, read_int_8
def read_cnd_stitches(f, out):
while True:
control = read_int_8(f)
if control is None:
break
x = read_int_16le(f)
y = read_int_16le(f)
# if control & 0x20 == 0x20:
# y = -y
# if control & 0x40 == 0x40:
# x = -x
if y is None:
break
if control & 0xF == 0x07: # Jump
out.move(x, y)
continue
elif control & 0xF == 0x01:
out.stitch_abs(x, y)
continue
break # Uncaught Control
out.end()
def read(f, out, settings=None):
read_cnd_stitches(f, out)

Wyświetl plik

@ -932,6 +932,16 @@ class EmbPattern:
"writer": ExpWriter,
}
)
# yield (
# {
# "description": "Melco Condensed Embroidery Format",
# "extension": "cnd",
# "extensions": ("cnd",),
# "mimetype": "application/x-cnd",
# "category": "embroidery",
# "reader": CndReader,
# }
# )
yield (
{
"description": "Tajima Embroidery Format",