class_docstr: **Bases:** :class:`GraphicsObject <pyqtgraph.GraphicsObject>`
class_docstr_tok: ["*","*","Bases",":","*","*",":","class",":","`","GraphicsObject","<","pyqtgraph.GraphicsObject",">","`"]
code: def _convert_2dlut_to_1dlut(self, lut):
      # converts:
      #   - uint8 (N, 1) to uint8 (N,)
      #   - uint8 (N, 3) or (N, 4) to uint32 (N,)
      # this allows faster lookup as 1d lookup is faster
      xp = self._xp
      augmented_alpha = False
  
      if lut.ndim == 1:
          return lut, augmented_alpha
  
      if lut.shape[1] == 3:  # rgb
          # convert rgb lut to rgba so that it is 32-bits
          lut = xp.column_stack(
              [lut, xp.full(lut.shape[0], 255, dtype=xp.uint8)]
          )
          augmented_alpha = True
      if lut.shape[1] == 4:  # rgba
          lut = lut.view(xp.uint32)
      lut = lut.ravel()
  
      return lut, augmented_alpha
  
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 31 for calling the ImageItem obj's underlying member method code with example usage: obj._convert_2dlut_to_1dlut(lut) and returns: lut,  augmented_alpha, lut,  augmented_alpha