def __init__(self, drivers, width=<NUM_LIT:0>, height=<NUM_LIT:0>,<EOL>rotation=<NUM_LIT:0>, vert_flip=False, y_flip=False,<EOL>serpentine=True,<EOL>threadedUpdate=False, brightness=<NUM_LIT:255>,<EOL>pixelSize=(<NUM_LIT:1>, <NUM_LIT:1>), **kwargs):
self.gen_multi = make_matrix_coord_map_multi<EOL>super().__init__(drivers, threadedUpdate, brightness, **kwargs)<EOL>rot_mod = rotation % <NUM_LIT><EOL>self.rotation = <NUM_LIT> * round(rot_mod / <NUM_LIT>)<EOL>if self.rotation != rot_mod:<EOL><INDENT>log.warning(ROTATION_WARNING, rotation, self.rotation)<EOL><DEDENT>self.width = width or getattr(self.drivers[<NUM_LIT:0>], '<STR_LIT:width>') or <NUM_LIT:0><EOL>self.height = height or getattr(self.drivers[<NUM_LIT:0>], '<STR_LIT>') or <NUM_LIT:0><EOL>self.vert_flip = vert_flip<EOL>self.y_flip = y_flip<EOL>self.serpentine = serpentine<EOL>self.pixelSize = pixelSize<EOL>pw, ph = self.pixelSize<EOL>if not (self.width or self.height):<EOL><INDENT>square = int(math.sqrt(self.numLEDs))<EOL>if (square * square) == self.numLEDs:<EOL><INDENT>self.width = self.height = square<EOL><DEDENT>else:<EOL><INDENT>raise TypeError('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT><DEDENT>if self.width * self.height > self.numLEDs:<EOL><INDENT>raise ValueError(<EOL>'<STR_LIT>'<EOL>% (self.width, self.height, self.numLEDs))<EOL><DEDENT>if not self.coord_map:<EOL><INDENT>if len(self.drivers) == <NUM_LIT:1>:<EOL><INDENT>log.debug(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>')<EOL>y_flip = y_flip or vert_flip<EOL>self.coord_map = make_matrix_coord_map(<EOL>self.width, self.height,<EOL>serpentine=serpentine,<EOL>rotation=rotation,<EOL>y_flip=vert_flip)<EOL><DEDENT>elif self.drivers:<EOL><INDENT>raise TypeError(<EOL>'<STR_LIT>')<EOL><DEDENT><DEDENT>self.set_pixel_positions(<EOL>make_matrix_coord_map_positions(self.coord_map))<EOL>if rotation in (<NUM_LIT>, <NUM_LIT>):<EOL><INDENT>w = self.width<EOL>h = self.height<EOL>self.width = h<EOL>self.height = w<EOL><DEDENT>self.texture = None<EOL>self.set = self._setColor<EOL>if pw < <NUM_LIT:0> or pw > self.width or ph < <NUM_LIT:0> or ph > self.height:<EOL><INDENT>raise ValueError(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>if self.width % pw != <NUM_LIT:0> or self.height % ph != <NUM_LIT:0>:<EOL><INDENT>raise ValueError(<EOL>'<STR_LIT>')<EOL><DEDENT>if pw == <NUM_LIT:1> and ph == <NUM_LIT:1>:<EOL><INDENT>self._set = self.__setNormal<EOL><DEDENT>else:<EOL><INDENT>self._set = self.__setScaled<EOL>self.width = self.width / pw<EOL>self.height = self.height / ph<EOL>self.numLEDs = self.width * self.height<EOL><DEDENT>self.fonts = font.fonts<EOL>
Main class for matricies.

        driver --  instance that inherits from DriverBase
        width --  X axis size of matrix
        height --  Y axis size of matrix
        coord_map --  a 2D matrix defining the X,Y to strip index mapping.
            Not needed in most cases
        rotation -- how to rotate when generating the map.
            Not used if coord_map specified
        vert_flip - flips the generated map along the Y axis.
            This along with rotation can achieve any orientation