示例#1
0
 def encode_line(self, line):
     pixels = [self.yuv[col, line] for col in xrange(self.WIDTH)]
     channel = (line % 2) + 1
     y_pixel_time = self.Y_SCAN / self.WIDTH
     uv_pixel_time = self.C_SCAN / self.WIDTH
     return chain(
             [(FREQ_BLACK, self.SYNC_PORCH)],
             ((byte_to_freq(p[0]), y_pixel_time) for p in pixels),
             [(self.INTER_CH_FREQS[channel], self.INTER_CH_GAP),
                 (FREQ_VIS_START, self.PORCH)],
             ((byte_to_freq(p[channel]), uv_pixel_time) for p in pixels))
示例#2
0
 def encode_line(self, line):
     msec_pixel = self.SCAN / self.WIDTH
     image = self.image
     for col in xrange(self.WIDTH):
         pixel = image.getpixel((col, line))
         freq_pixel = byte_to_freq(sum(pixel) / len(pixel))
         yield freq_pixel, msec_pixel
示例#3
0
 def encode_line(self, line):
     msec_pixel = self.SCAN / self.WIDTH
     image = self.pixels
     for col in xrange(self.WIDTH):
         pixel = image[col, line]
         freq_pixel = byte_to_freq(pixel[0])
         yield freq_pixel, msec_pixel
示例#4
0
 def encode_line(self, line):
     msec_pixel = self.SCAN / self.WIDTH
     image = self.image
     for col in xrange(self.WIDTH):
         pixel = image.getpixel((col, line))
         freq_pixel = byte_to_freq(sum(pixel) / len(pixel))
         yield freq_pixel, msec_pixel
示例#5
0
 def encode_line(self, line):
     msec_pixel = self.SCAN / self.WIDTH
     image = self.pixels
     for index in self.COLOR_SEQ:
         for item in self.before_channel(index):
             yield item
         for col in xrange(self.WIDTH):
             pixel = image[col, line]
             freq_pixel = byte_to_freq(pixel[index])
             yield freq_pixel, msec_pixel
         for item in self.after_channel(index):
             yield item
示例#6
0
 def encode_line(self, line):
     cs = self.COLOR_SEQ
     msec_pixel = self.SCAN / self.WIDTH
     image = self.image
     for index in cs:
         for item in self.before_channel(index):
             yield item
         for col in xrange(self.WIDTH):
             pixel = image.getpixel((col, line))
             freq_pixel = byte_to_freq(pixel[index])
             yield freq_pixel, msec_pixel
         for item in self.after_channel(index):
             yield item