From 41100c544a9e16a6523ca49195ef28d62b24a311 Mon Sep 17 00:00:00 2001 From: Tom Hunger Date: Tue, 3 Feb 2015 20:10:26 +0000 Subject: [PATCH] Split printer encoding for a single image into a separate method. This is in preparation of changing the personality which takes a list of images. --- sirius/coding/encoders.py | 67 ++++++++++++++++++++++++++++----------- 1 file changed, 48 insertions(+), 19 deletions(-) diff --git a/sirius/coding/encoders.py b/sirius/coding/encoders.py index 351c47b..d88847c 100644 --- a/sirius/coding/encoders.py +++ b/sirius/coding/encoders.py @@ -13,25 +13,12 @@ __all__ = [ ] -def _encode_printer_message(command, pixel_count, rle_image, print_id): +def _encode_pixels(pixel_count, rle_image): """ - :param command: See LittlePrinterCommand in protocol.proto. :param pixel_count: total number of pixels :param rle_image: Run-length encoded black and white image. - :print_id: unique 32-bit number for ack-ing the print (sent back in didprint event) + :returns: The binary payload """ - LITTLE_PRINTER_DEVICE_ID = 1 - - # device type c, reserved byte c, - # command_name