Ejemplo n.º 1
0
    def __init__(self, lastConfig):
        self.name = "CML3"
        self.sideLen = 80
        self.colorMap = 'blugr3'
        self.colorsNum = 256
        #initLattice=imageCML('./sri_mandala.jpg');
        self.initLattice=randomPing(self.sideLen,self.sideLen,scaleFactor=0.001)
        #self.initLattice=magicSquare(self.sideLen)
        #self.initLattice=primesSquare(self.sideLen)
        #self.initLattice=randbin(self.sideLen,self.sideLen)
        #self.initLattice = lastConfig.initLattice
        #print initLattice
        # wait variable can slow things down by running a counter inside
        #why do we have a, gl, and gg in here as well as initCML?
        self.cml = DiffusiveCML(self.initLattice,kern='asymm',a=1.5,gl=0.4,gg=0.2,wait=10000)
        #self.cml = DiffusiveCML(self.initLattice,kern='symm4');
        self.stats = AnalysisCML(self.initLattice)
        #cml = DiffusiveCML(initLattice,kern='magic11')
        #cml = CompetitiveCML(initLattice)
        # drawmod is useful to limit framerate or find a cycle avoiding flicker
        self.drawmod=20
        self.kernType='asymm'

        gei = GradientEditorItem()
        gei.loadPreset(self.colorMap)
        self.lut = gei.getLookupTable(self.colorsNum, alpha=False)
Ejemplo n.º 2
0
    def __init__(self, config):

        self.config = config
        self.scale = 1.0
        gei = GradientEditorItem()

        # see definition of GradientEditorItem() to define an LUT
        # presets cyclic, spectrum, thermal, flame, yellowy, bipolar, greyclip, grey
        #gei.loadPreset(config.colorMap)
        gei.loadPreset('thermal')
        self.lut = gei.getLookupTable(config.colorsNum, alpha=False)
Ejemplo n.º 3
0
Archivo: CML_Qt.py Proyecto: nyjel/cml
win.setWindowTitle("pyqtgraph example: VideoSpeedTest")
win.setObjectName("MainWindow")
win.resize(sidelen * 8, sidelen * 8)
# rawImg = RawImageWidget(scaled=True)
rawImg = RawImageWidget.RawImageWidget()
win.setCentralWidget(rawImg)
win.show()

LUT = None
n = 256
gei = GradientEditorItem()
# see definition of GradientEditorItem() to define an LUT
# presets cyclic, spectrum, thermal, flame, yellowy, bipolar, greyclip, grey,bluish
# was cyclic, pretty nice
gei.loadPreset("cyclic")
LUT = gei.getLookupTable(n, alpha=False)

# Various initial lattice styles
cmlInit = ""
# initLattice=imageCML('/Users/daviddemaris/Dropbox/Public/JungAionFormula.jpg')
# win.resize(size(initLattice,0),size(initLattice,1))
# cmlInit='image'
# initLattice=imageCML('./sri_mandala.jpg');
initLattice = randomPing(sidelen, sidelen, scaleFactor=0.0)
# initLattice=magicSquare(sidelen)
# initLattice=primesSquare(sidelen)
# initLattice=randbin(sidelen,sidelen)
# print initLattice
# wait variable can slow things down by running a counter inside
# why do we have a, gl, and gg in here as well as initCML?
# cml = DiffusiveCML(initLattice,kern='asymm',a=1.5,gl=0.4,gg=0.2,wait=10000)