def next_frame(self, out):
        fb = self.fb
        phase = self.phase
        div = self.div
        wave = self.wave

        cball.bytearray_memset(out, 0)
        cball.bytearray_blend(fb, out, self.fb, self.fade)

        for c in range(6):
            self.colors[c].next_color_into(self.palette, c*3)
            p = phase % self.div[c] * 2000 // self.div[c]
            for i in range(20):
                p += 100
                if p > 2000:
                    p -= 2000
                if p < 500:
                    w = wave[p]
                    ix = c*120 + i*6
                    out[ix  ] = w
                    out[ix+1] = w
                    out[ix+2] = w
                    out[ix+3] = w
                    out[ix+4] = w
                    out[ix+5] = w

        cball.apply_palette(self.colorfb, self.colormap, self.palette)
        cball.bytearray_interval_multiply(out, out, self.colorfb)
        cball.bytearray_max(fb, fb, out)
        cball.bytearray_memcpy(out, fb)

        self.phase += self.speed
        self.phase %= self.phase_max
Beispiel #2
0
 def next_frame(self, fbuf):
     self.update(self.speed)
     cball.bytearray_memset(fbuf, 255)
     self.spiral.next_frame(self.fb)
     cball.bytearray_blend(self.fb, self.fb, fbuf, .5)
     cball.bytearray_memset(fbuf, 0)
     cball.shader(fbuf, self.leds.flat_data, self.shader_flat)
     cball.bytearray_interval_multiply(fbuf, fbuf, self.fb)
 def next_frame(self, fbuf):
     r = self.remap
     cball.bytearray_memset(fbuf, 0)
     self.phase = (self.phase-1)%self.phase_max
     for i in range(20):
         val = self.wave[ (self.led_ix[i]+self.phase)%self.phase_max ]
         for j in range(6):
             ix = (j*20+i)*2
             fbuf[r[ix  ]*3 + 0] = val//2
             fbuf[r[ix+1]*3 + 2] = val//2
    def next_frame(self, fbuf):
        cball.bytearray_memset(fbuf, 0)
        self.phase = (self.phase-1)%self.phase_max
        a, b, c, d = 0, self.edge_count*4*3, self.edge_count*4*3*2, self.edge_count*4*3*3
        for i in range(self.edge_count):
            val = self.wave[ (self.led_ix[i]+self.phase)%self.phase_max ]
            for j in range(4):
                edge_base = (i*4*3+j*3)
                fbuf[edge_base+a] = val//2
                fbuf[edge_base+a+1] = val//4

                fbuf[edge_base+b+2] = val//2
                fbuf[edge_base+b] = val//4

                fbuf[edge_base+c+1] = val//2
                fbuf[edge_base+c+2] = val//4

                fbuf[edge_base+d] = val//2
                fbuf[edge_base+d+2] = val//4
Beispiel #5
0
 def next_frame(self, fbuf):
     cball.bytearray_memset(fbuf, 0)
Beispiel #6
0
 def next_frame(self, fbuf):
     self.update()
     cball.bytearray_memset(fbuf, 0)
     cball.shader(fbuf, self.leds.flat_data, self.shader_flat)
Beispiel #7
0
 def next_frame(self, fbuf):
     self.update(self.speed)
     cball.bytearray_memset(fbuf, 0)
     cball.shader(fbuf, self.leds.flat_data, self.shader_flat)
     cball.bytearray_interval_multiply(fbuf, fbuf, self.checkers)