def __init__(self): """Construct a new, blank StrokeShape.""" object.__init__(self) self.tasks = idletask.Processor() self.strokemap = {} self.brush_string = None
def __init__(self): object.__init__(self) self.tasks = idletask.Processor() self.strokemap = {}
# Copyright (C) 2009 by Martin Renold <*****@*****.**> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. import time, struct import zlib from numpy import * import mypaintlib import tiledsurface, idletask N = tiledsurface.N tasks = idletask.Processor(max_pending=6) class StrokeShape: """ This class stores the shape of a stroke in as a 1-bit bitmap. The information is stored in compressed memory blocks of the size of a tile (for fast lookup). """ def __init__(self): self.strokemap = {} def init_from_snapshots(self, snapshot_before, snapshot_after): assert not self.strokemap # extract the layer from each snapshot a, b = snapshot_before.tiledict, snapshot_after.tiledict