Skip to content

Commit

Permalink
PNG Guides and EmbPattern init.
Browse files Browse the repository at this point in the history
PngWriter has guides added.
A couple corrections to PngWriter.
PyEmbroidery is turned into a shell references to EmbPattern static calls.
EmbPattern has init parameters of filename, or EmbPattern.
EmbPattern has .read() and .write() which accept settings as direct keyword arguments.
  • Loading branch information
tatarize authored Sep 9, 2020
1 parent 91dee08 commit 68663f3
Show file tree
Hide file tree
Showing 4 changed files with 1,135 additions and 808 deletions.
30 changes: 30 additions & 0 deletions pyembroidery/ArtReader.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# from .ReadHelper import read_int_8
# from io import BytesIO
#
# import compoundfiles
# import zlib
#
#
# def swizzle(b):
# b ^= 0xD2
# b <<= 1
# b |= b >> 8
# return b & 0xFF
#
#
# def parse_art_file(file):
# with open(file, 'rb') as f:
# contents = compoundfiles.CompoundFileReader(f).open('Contents')
# contents.seek(4) # file size
# return zlib.decompress(bytes([swizzle(b) for b in contents.read()]))
#
#
# def read(f, out, settings=None):
# contents = compoundfiles.CompoundFileReader(f).open('Contents')
# contents.seek(4) # file size
# art = BytesIO(zlib.decompress(bytes([swizzle(b) for b in contents.read()])))
# while True:
# b = read_int_8(art)
# if b is None or b == -1:
# break
# print('%02X' % b)
Loading

0 comments on commit 68663f3

Please sign in to comment.