assets/tools/MiRCART{Reduce,ToAnsi}.py: fixed.

libcanvas/CanvasExportStore.py: fixed.
assets/text/TODO: updated.
This commit is contained in:
Lucio Andrés Illanes Albornoz 2019-09-07 17:38:28 +02:00
parent f3140d4b3d
commit 8367c166f3
4 changed files with 20 additions and 16 deletions

View File

@ -1,14 +1,15 @@
1) General {cleanup,refactor} 1) General {cleanup,refactor}
2) Transparent {back,fore}ground colour 2) Transparent {back,fore}ground colour
3) Implement ANSI CSI CU[BDPU] sequences 3) Implement instrumentation & unit tests
4) Incremental auto{load,save} & {backup,restore} 4) Implement ANSI CSI CU[BDPU] sequences
5) Open and toggle a reference image in the background 5) Incremental auto{load,save} & {backup,restore}
6) Client-Server or Peer-to-Peer realtime collaboration 6) Open and toggle a reference image in the background
7) Arbitrary {format,palette}s ({4,8} bit ANSI/mIRC, etc.) 7) Client-Server or Peer-to-Peer realtime collaboration
8) Hotkey & graphical interfaces to {composed,parametrised} tools 8) Arbitrary {format,palette}s ({4,8} bit ANSI/mIRC, etc.)
9) GUI: a) scrollbar b) switch from wxPython to GTK c) revisit About dialogue 9) Hotkey & graphical interfaces to {composed,parametrised} tools
10) Layers, layout (e.g. for comics, zines, etc.) & asset management (e.g. kade, lion, etc.) & traits w/ {inserting,merging,linking} 10) GUI: a) scrollbar b) switch from wxPython to GTK c) revisit About dialogue
11) Sprites & scripted (Python?) animation on the basis of asset traits and {composable,parametrised} patterns (metric flow, particle system, rigging, ...) 11) Layers, layout (e.g. for comics, zines, etc.) & asset management (e.g. kade, lion, etc.) & traits w/ {inserting,merging,linking}
12) Sprites & scripted (Python?) animation on the basis of asset traits and {composable,parametrised} patterns (metric flow, particle system, rigging, ...)
13) Composition and parametrisation of tools from higher-order operators (brushes, filters, outlines, patterns & shaders) and unit tools; unit tools: 13) Composition and parametrisation of tools from higher-order operators (brushes, filters, outlines, patterns & shaders) and unit tools; unit tools:
a) geometric primitives (arrow, circle, cloud/speech bubble, curve, heart, hexagon, line, pentagon, polygon, rhombus, triangle, square, star) a) geometric primitives (arrow, circle, cloud/speech bubble, curve, heart, hexagon, line, pentagon, polygon, rhombus, triangle, square, star)
b) regions (crop, duplicate, erase, fill, invert, measure, pick, rotate, scale, select, shift, slice, tile, translate) b) regions (crop, duplicate, erase, fill, invert, measure, pick, rotate, scale, select, shift, slice, tile, translate)

View File

@ -9,6 +9,7 @@ import os, sys
[sys.path.append(os.path.join(os.getcwd(), "..", "..", path)) for path in ["libcanvas", "librtl"]] [sys.path.append(os.path.join(os.getcwd(), "..", "..", path)) for path in ["libcanvas", "librtl"]]
from CanvasImportStore import CanvasImportStore from CanvasImportStore import CanvasImportStore
from CanvasExportStore import CanvasExportStore
import sys import sys
def reduce(inPathName): def reduce(inPathName):
@ -25,15 +26,17 @@ def reduce(inPathName):
print("\u001f", end="", file=outFile) print("\u001f", end="", file=outFile)
lastAttribs = inCurCell[2] lastAttribs = inCurCell[2]
if lastColours == None \ if lastColours == None \
or (lastColours[0] != inCurCell[:2][0] \ or ((lastColours[0] != inCurCell[:2][0]) \
and lastColours[1] != inCurCell[:2][1]): and (lastColours[1] != inCurCell[:2][1])) \
or ((lastColours[0] == inCurCell[:2][0]) \
and (lastColours[1] != inCurCell[:2][1])):
if (inCurCell[3] in set("0123456789")) and (inCurCell[1] < 10): if (inCurCell[3] in set("0123456789")) and (inCurCell[1] < 10):
print("\u0003{:d},{:02d}{}".format(*inCurCell[:2], inCurCell[3]), end="", file=outFile) print("\u0003{:d},{:02d}{}".format(*inCurCell[:2], inCurCell[3]), end="", file=outFile)
else: else:
print("\u0003{:d},{:d}{}".format(*inCurCell[:2], inCurCell[3]), end="", file=outFile) print("\u0003{:d},{:d}{}".format(*inCurCell[:2], inCurCell[3]), end="", file=outFile)
lastColours = inCurCell[:2] lastColours = inCurCell[:2]
elif (lastColours[1] == inCurCell[:2][1]) \ elif (lastColours[0] != inCurCell[:2][0]) \
and (lastColours[0] != inCurCell[:2][0]): and (lastColours[1] == inCurCell[:2][1]):
if (inCurCell[3] in set("0123456789")) and (inCurCell[0] < 10): if (inCurCell[3] in set("0123456789")) and (inCurCell[0] < 10):
print("\u0003{:02d}{}".format(inCurCell[0], inCurCell[3]), end="", file=outFile) print("\u0003{:02d}{}".format(inCurCell[0], inCurCell[3]), end="", file=outFile)
else: else:

View File

@ -18,11 +18,11 @@ def main(*argv):
print("usage: {} <MiRCART input file pathname>".format(sys.argv[0]), file=sys.stderr) print("usage: {} <MiRCART input file pathname>".format(sys.argv[0]), file=sys.stderr)
else: else:
canvasImportStore = CanvasImportStore() canvasImportStore = CanvasImportStore()
rc, error = canvasImportStore.importAnsiFile(argv[1]) rc, error = canvasImportStore.importTextFile(argv[1])
if rc: if rc:
canvasExportStore = CanvasExportStore() canvasExportStore = CanvasExportStore()
canvasExportStore.exportAnsiFile(canvasImportStore.outMap, canvasImportStore.inSize, sys.stdout) canvasExportStore.exportAnsiFile(canvasImportStore.outMap, canvasImportStore.inSize, sys.stdout)
else else:
print("error: {}".format(error), file=sys.stderr) print("error: {}".format(error), file=sys.stderr)
if __name__ == "__main__": if __name__ == "__main__":
main(*sys.argv) main(*sys.argv)

View File

@ -125,7 +125,7 @@ class CanvasExportStore():
outImgDraw = ImageDraw.Draw(outImg); outImgDraw.fontmode = "1"; outImgDraw = ImageDraw.Draw(outImg); outImgDraw.fontmode = "1";
for inCurRow in range(len(canvasMap)): for inCurRow in range(len(canvasMap)):
for inCurCol in range(len(canvasMap[inCurRow])): for inCurCol in range(len(canvasMap[inCurRow])):
inCurCell = canvasMap[inCurRow][inCurCol]; outColours = (0, 0); inCurCell = canvasMap[inCurRow][inCurCol]; outColours = [0, 0];
if inCurCell[2] & self._CellState.CS_BOLD: if inCurCell[2] & self._CellState.CS_BOLD:
if inCurCell[3] != " ": if inCurCell[3] != " ":
if inCurCell[3] == "": if inCurCell[3] == "":