docs: def get_cached_image(self, width, height, zoom, parameters=None, clear=False):
          """Get ImageSurface object, if possible, cached
  
          The method checks whether the image was already rendered. This is done by comparing the passed size and
          parameters with those of the last image. If they are equal, the cached image is returned. Otherwise,
          a new ImageSurface with the specified dimensions is created and returned.
          :param width: The width of the image
          :param height: The height of the image
          :param zoom: The current scale/zoom factor
          :param parameters: The parameters used for the image
          :param clear: If True, the cache is emptied, thus the image won't be retrieved from cache
          :returns: The flag is True when the image is retrieved from the cache, otherwise False; The cached image
            surface or a blank one with the desired size; The zoom parameter when the image was stored
          :rtype: bool, ImageSurface, float
          """
          global MAX_ALLOWED_AREA
          if not parameters:
              parameters = {}
  
          if self.__compare_parameters(width, height, zoom, parameters) and not clear:
              return True, self.__image, self.__zoom
  
          # Restrict image surface size to prevent excessive use of memory
          while True:
              try:
                  self.__limiting_multiplicator = 1
                  area = width * zoom * self.__zoom_multiplicator * height * zoom * self.__zoom_multiplicator
                  if area > MAX_ALLOWED_AREA:
                      self.__limiting_multiplicator = sqrt(MAX_ALLOWED_AREA / area)
  
                  image = ImageSurface(self.__format, int(ceil(width * zoom * self.multiplicator)),
                                       int(ceil(height * zoom * self.multiplicator)))
                  break  # If we reach this point, the area was successfully allocated and we can break the loop
              except Error:
                  MAX_ALLOWED_AREA *= 0.8
  
          self.__set_cached_image(image, width, height, zoom, parameters)
          return False, self.__image, zoom