From bd3b84cfb6defb8243e9405cbee07207391721ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20Veres-Szentkir=C3=A1lyi?= Date: Fri, 22 Nov 2013 18:33:39 +0100 Subject: [PATCH] ColorSSTV: load raster data only once --- pysstv/color.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pysstv/color.py b/pysstv/color.py index cc64cfe..7aa20fb 100644 --- a/pysstv/color.py +++ b/pysstv/color.py @@ -9,9 +9,12 @@ from itertools import chain RED, GREEN, BLUE = range(3) class ColorSSTV(GrayscaleSSTV): + def on_init(self): + self.pixels = self.image.load() + def encode_line(self, line): msec_pixel = self.SCAN / self.WIDTH - image = self.image.load() + image = self.pixels for index in self.COLOR_SEQ: for item in self.before_channel(index): yield item