<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update(self):
 """ Applies pending changes to the screen. Nothing will be drawn on the screen until this function is called. """

        if self.var_info.bits_per_pixel == 1:
            b = self._img.tobytes("raw", "1;R")
            self.mmap[:len(b)] = b

        elif self.var_info.bits_per_pixel == 16:
            self.mmap[:] = self._img_to_rgb565_bytes()

        elif self.var_info.bits_per_pixel == 32:
            self.mmap[:] = self._img.convert("RGB").tobytes("raw", "XRGB")

        else:
            raise Exception("Not supported - platform %s with bits_per_pixel %s" %
                (self.platform, self.var_info.bits_per_pixel))