class_docstr: **Bases:** :class:`GraphicsObject <pyqtgraph.GraphicsObject>`
class_docstr_tok: ["*","*","Bases",":","*","*",":","class",":","`","GraphicsObject","<","pyqtgraph.GraphicsObject",">","`"]
code: def render(self):
      # Convert data to QImage for display.
      self._unrenderable = True
      if self.image is None or self.image.size == 0:
          return
  
      # Request a lookup table if this image has only one channel
      if self.image.ndim == 2 or self.image.shape[2] == 1:
          self.lut = self._ensure_proper_substrate(self.lut, self._xp)
          if isinstance(self.lut, Callable):
              lut = self._ensure_proper_substrate(
                  self.lut(self.image, 256), self._xp
              )
          else:
              lut = self.lut
      else:
          lut = None
  
      if self.autoDownsample:
          xds, yds = self._computeDownsampleFactors()
          if xds is None:
              return
  
          axes = [1, 0] if self.axisOrder == "row-major" else [0, 1]
          image = fn.downsample(self.image, xds, axis=axes[0])
          image = fn.downsample(image, yds, axis=axes[1])
          self._lastDownsample = (xds, yds)
  
          # Check if downsampling reduced the image size to zero due to inf values.
          if image.size == 0:
              return
      else:
          image = self.image
  
      # Convert single-channel image to 2D array
      if image.ndim == 3 and image.shape[-1] == 1:
          image = image[..., 0]
  
      # Assume images are in column-major order for backward compatibility
      # (most images are in row-major order)
      if self.axisOrder == "col-major":
          image = image.swapaxes(0, 1)
  
      levels = self.levels
      augmented_alpha = False
  
      if lut is not None and lut.dtype != self._xp.uint8:
          # Both _try_rescale_float() and _try_combine_lut() assume that
          # lut is of type uint8. It is considered a usage error if that
          # is not the case.
          # However, the makeARGB() codepath has previously allowed such
          # a usage to work. Rather than fail outright, we delegate this
          # case to makeARGB().
          warnings.warn(
              "Using non-uint8 LUTs is an undocumented accidental feature and may "
              "be removed at some point in the future. Please open an issue if you "
              "instead believe this to be worthy of protected inclusion in pyqtgraph.",
              DeprecationWarning,
              stacklevel=2,
          )
      elif image.dtype.kind == "f":
          image, levels, lut, augmented_alpha = self._try_rescale_float(
              image, levels, lut
          )
          # if we succeeded, we will have an uint8 image with levels None.
          # lut if not None will have <= 256 entries
  
      # if the image data is a small int, then we can combine levels + lut
      # into a single lut for better performance
      elif image.dtype in (self._xp.ubyte, self._xp.uint16):
          image, levels, lut, augmented_alpha = self._try_combine_lut(
              image, levels, lut
          )
  
      qimage = self._try_make_qimage(
          image, levels, lut, augmented_alpha
      )
  
      if qimage is not None:
          self._processingBuffer = None
          self._displayBuffer = None
          self.qimage = qimage
          self._renderRequired = False
          self._unrenderable = False
          return
  
      if (
          self._processingBuffer is None
          or self._processingBuffer.shape[:2] != image.shape[:2]
      ):
          self._buildQImageBuffer(image.shape)
  
      fn.makeARGB(
          image, lut=lut, levels=levels, output=self._processingBuffer
      )
      if self._xp == getCupy():
          self._processingBuffer.get(out=self._displayBuffer)
      self.qimage = fn.ndarray_to_qimage(
          self._displayBuffer, QtGui.QImage.Format.Format_ARGB32
      )
  
      self._renderRequired = False
      self._unrenderable = False
  
imports: import warnings
  from collections.abc import Callable
  import numpy
  from ..None import colormap
  from ..None import debug
  from ..None import functions
  from ..None import getConfigOption
  from ..Point import Point
  from ..Qt import QtCore, QtGui, QtWidgets
  from ..util.cupy_helper import getCupy
  from .GraphicsObject import GraphicsObject
label_desc: Use image node_id 27 for calling the ImageItem obj's underlying member method code with example usage: obj.render() without return types