class_docstr: Wrapper for the FI bitmap object.
class_docstr_tok: ["Wrapper","for","the","FI","bitmap","object","."]
docstr: Hardcore way to inject numpy array in bitmap.
code: def _finish_wrapped_array(self, array):  # IS_PYPY
      """Hardcore way to inject numpy array in bitmap."""
      # Get bitmap info
      with self._fi as lib:
          pitch = lib.FreeImage_GetPitch(self._bitmap)
          bits = lib.FreeImage_GetBits(self._bitmap)
          bpp = lib.FreeImage_GetBPP(self._bitmap)
      # Get channels and realwidth
      nchannels = bpp // 8 // array.itemsize
      realwidth = pitch // nchannels
      # Apply padding for pitch if necessary
      extra = realwidth - array.shape[-2]
      assert 0 <= extra < 10
      # Make sort of Fortran, also take padding (i.e. pitch) into account
      newshape = array.shape[-1], realwidth, nchannels
      array2 = numpy.zeros(newshape, array.dtype)
      if nchannels == 1:
          array2[:, : array.shape[-2], 0] = array.T
      else:
          for i in range(nchannels):
              array2[:, : array.shape[-2], i] = array[i, :, :].T
      # copy data
      data_ptr = array2.__array_interface__["data"][0]
      ctypes.memmove(bits, data_ptr, array2.nbytes)
      del array2
  
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 7 for calling the FIBitmap obj's underlying member method code with example usage: obj._finish_wrapped_array(array) without return types