def __init__(self, logger, dist=None): Callback.Callbacks.__init__(self) self.logger = logger # For color and intensity maps self.cmap = None self.imap = None self.arr = None self.iarr = None self.carr = None self.sarr = None self.scale_pct = 1.0 self.maxv = 255 self.nptype = np.uint8 # For scaling algorithms hashsize = 65536 if dist is None: dist = ColorDist.LinearDist(hashsize) self.dist = dist self.reset_sarr(callback=False) # For callbacks for name in ('changed', ): self.enable_callback(name)
def __init__(self, logger, dist=None): Callback.Callbacks.__init__(self) self.logger = logger # For color and intensity maps self.cmap = None self.imap = None self.arr = None self.iarr = None self.carr = None self.sarr = None # For scaling algorithms hashsize = 65536 if dist == None: dist = ColorDist.LinearDist(hashsize) self.dist = dist # For callbacks for name in ('changed', ): self.enable_callback(name)
def __init__(self, logger, dist=None, bpp=None): Callback.Callbacks.__init__(self) self.logger = logger # For color and intensity maps self.cmap = None self.imap = None self.arr = None self.iarr = None self.carr = None self.sarr = None self.scale_pct = 1.0 # length of the color map self.maxc = 255 # targeted bit depth per-pixel band of the output RGB array # (can be less than the data size of the output array) if bpp is None: bpp = 8 self.bpp = bpp # maximum value that we can generate in this range self.maxv = 2 ** self.bpp - 1 # data size per pixel band in the output RGB array self._set_dtype() # For scaling algorithms hashsize = 65536 if dist is None: dist = ColorDist.LinearDist(hashsize) self.dist = dist self.reset_sarr(callback=False) # For callbacks for name in ('changed', ): self.enable_callback(name)
def __init__(self, logger, dist=None): super(PassThruRGBMapper, self).__init__(logger) # ignore passed in distribution self.dist = ColorDist.LinearDist(256)
def __init__(self, logger, dist=None, bpp=None): super(PassThruRGBMapper, self).__init__(logger, bpp=bpp) # ignore passed in distribution maxlen = self.maxc + 1 self.dist = ColorDist.LinearDist(maxlen)