class_docstr: Wrapper for the FI bitmap object.
class_docstr_tok: ["Wrapper","for","the","FI","bitmap","object","."]
code: def get_image_data(self):
      dtype, shape, bpp = self._get_type_and_shape()
      array = self._wrap_bitmap_bits_in_array(shape, dtype, False)
      with self._fi as lib:
          isle = lib.FreeImage_IsLittleEndian()
  
      # swizzle the color components and flip the scanlines to go from
      # FreeImage's BGR[A] and upside-down internal memory format to
      # something more normal
      def n(arr):
          # return arr[..., ::-1].T  # Does not work on numpypy yet
          if arr.ndim == 1:  # pragma: no cover
              return arr[::-1].T
          elif arr.ndim == 2:  # Always the case here ...
              return arr[:, ::-1].T
          elif arr.ndim == 3:  # pragma: no cover
              return arr[:, :, ::-1].T
          elif arr.ndim == 4:  # pragma: no cover
              return arr[:, :, :, ::-1].T
  
      if len(shape) == 3 and isle and dtype.type == numpy.uint8:
          b = n(array[0])
          g = n(array[1])
          r = n(array[2])
          if shape[0] == 3:
              return numpy.dstack((r, g, b))
          elif shape[0] == 4:
              a = n(array[3])
              return numpy.dstack((r, g, b, a))
          else:  # pragma: no cover - we check this earlier
              raise ValueError(
                  "Cannot handle images of shape %s" % shape
              )
  
      # We need to copy because array does *not* own its memory
      # after bitmap is freed.
      a = n(array).copy()
      return a
  
imports: import os
  import sys
  import ctypes
  import threading
  import logging
  import numpy
  from ..core import get_remote_file, load_lib, Dict, resource_dirs, IS_PYPY, get_platform, InternetNotAllowedError, NeedDownloadError
label_desc: Use image node_id 4 for calling the FIBitmap obj's underlying member method code with example usage: obj.get_image_data() and returns: a, arr, numpy, arr, numpy, arr, arr