diff --git a/pysstv/color.py b/pysstv/color.py index be8096f..3076fd9 100644 --- a/pysstv/color.py +++ b/pysstv/color.py @@ -16,14 +16,12 @@ class ColorSSTV(GrayscaleSSTV): msec_pixel = self.SCAN / self.WIDTH image = self.pixels for index in self.COLOR_SEQ: - for item in self.before_channel(index): - yield item + yield from self.before_channel(index) for col in range(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 + yield from self.after_channel(index) def before_channel(self, index): return [] @@ -65,8 +63,7 @@ class ScottieS1(MartinM1): def before_channel(self, index): if index == RED: - for item in MartinM1.horizontal_sync(self): - yield item + yield from MartinM1.horizontal_sync(self) yield FREQ_BLACK, self.INTER_CH_GAP @@ -159,8 +156,7 @@ class PD90(ColorSSTV): def gen_image_tuples(self): yuv = self.image.convert('YCbCr').load() for line in range(0, self.HEIGHT, 2): - for item in self.horizontal_sync(): - yield item + yield from self.horizontal_sync() yield FREQ_BLACK, self.PORCH pixels0 = [yuv[col, line] for col in range(self.WIDTH)] pixels1 = [yuv[col, line + 1] for col in range(self.WIDTH)] diff --git a/pysstv/grayscale.py b/pysstv/grayscale.py index 75472aa..cc225cd 100644 --- a/pysstv/grayscale.py +++ b/pysstv/grayscale.py @@ -10,10 +10,8 @@ class GrayscaleSSTV(SSTV): def gen_image_tuples(self): for line in range(self.HEIGHT): - for item in self.horizontal_sync(): - yield item - for item in self.encode_line(line): - yield item + yield from self.horizontal_sync() + yield from self.encode_line(line) def encode_line(self, line): msec_pixel = self.SCAN / self.WIDTH diff --git a/pysstv/sstv.py b/pysstv/sstv.py index 5cc5f77..0dab7c0 100644 --- a/pysstv/sstv.py +++ b/pysstv/sstv.py @@ -113,8 +113,7 @@ class SSTV(object): parity_freq = FREQ_VIS_BIT1 if num_ones % 2 == 1 else FREQ_VIS_BIT0 yield parity_freq, MSEC_VIS_BIT yield FREQ_SYNC, MSEC_VIS_BIT # stop bit - for freq_tuple in self.gen_image_tuples(): - yield freq_tuple + yield from self.gen_image_tuples() for fskid_byte in map(ord, self.fskid_payload): for _ in range(6): bit = fskid_byte & 1