class_docstr: Wrapper for the FI bitmap object.
class_docstr_tok: ["Wrapper","for","the","FI","bitmap","object","."]
code: def _get_type_and_shape(self):
      bitmap = self._bitmap
  
      # Get info on bitmap
      with self._fi as lib:
          w = lib.FreeImage_GetWidth(bitmap)
          h = lib.FreeImage_GetHeight(bitmap)
          self._fi_type = fi_type = lib.FreeImage_GetImageType(bitmap)
          if not fi_type:
              raise ValueError("Unknown image pixel type")
  
      # Determine required props for numpy array
      bpp = None
      dtype = FI_TYPES.dtypes[fi_type]
  
      if fi_type == FI_TYPES.FIT_BITMAP:
          with self._fi as lib:
              bpp = lib.FreeImage_GetBPP(bitmap)
              has_pallette = lib.FreeImage_GetColorsUsed(bitmap)
          if has_pallette:
              # Examine the palette. If it is grayscale, we return as such
              if has_pallette == 256:
                  palette = lib.FreeImage_GetPalette(bitmap)
                  palette = ctypes.c_void_p(palette)
                  p = (ctypes.c_uint8 * (256 * 4)).from_address(
                      palette.value
                  )
                  p = numpy.frombuffer(p, numpy.uint32).copy()
                  if (GREY_PALETTE == p).all():
                      extra_dims = []
                      return (
                          numpy.dtype(dtype),
                          extra_dims + [w, h],
                          bpp,
                      )
              # Convert bitmap and call this method again
              newbitmap = lib.FreeImage_ConvertTo32Bits(bitmap)
              newbitmap = ctypes.c_void_p(newbitmap)
              self._set_bitmap(newbitmap)
              return self._get_type_and_shape()
          elif bpp == 8:
              extra_dims = []
          elif bpp == 24:
              extra_dims = [3]
          elif bpp == 32:
              extra_dims = [4]
          else:  # pragma: no cover
              # raise ValueError('Cannot convert %d BPP bitmap' % bpp)
              # Convert bitmap and call this method again
              newbitmap = lib.FreeImage_ConvertTo32Bits(bitmap)
              newbitmap = ctypes.c_void_p(newbitmap)
              self._set_bitmap(newbitmap)
              return self._get_type_and_shape()
      else:
          extra_dims = FI_TYPES.extra_dims[fi_type]
  
      # Return dtype and shape
      return numpy.dtype(dtype), extra_dims + [w, h], bpp
  
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 8 for calling the FIBitmap obj's underlying member method code with example usage: obj._get_type_and_shape() and returns: numpy,  unknown,  bpp, self, numpy,  unknown,  bpp, self