import struct

class Readout_Mode:
    def __init__(self):
        self.mode = 0
        self.width = 0
        self.height = 0
        self.gain = 0
        self.pixel_width = 0
        self.pixel_height = 0

    def unpack(self, data):
        (self.mode,
         self.width,
         self.height,
         self.gain,
         self.pixel_width,
         self.pixel_height) = struct.unpack('<4H2I', data)

    def prettyprint(self):
        print("Mode: %d" % self.mode)
        print("Width: %d" % self.width)
        print("Height: %d" % self.height)
        print("Gain: %d" % self.gain)
        print("Pixel width: %d" % self.pixel_width)
        print("Pixel height: %d" % self.pixel_height)