code: def _component2dtype(self, component):
          
          if component.prec > 16:
              msg = "Unhandled precision: {0} bits.".format(component.prec)
              raise IOError(msg)
  
          if component.sgnd:
              dtype = np.int8 if component.prec <=8 else np.int16
          else:
              dtype = np.uint8 if component.prec <=8 else np.uint16
  
          return dtype
docs: Determin the appropriate numpy datatype for an OpenJPEG component.
  
          Parameters
          ----------
          component : ctypes pointer to ImageCompType (image_comp_t)
              single image component structure.
  
          Returns
          -------
          builtins.type
              numpy datatype to be used to construct an image array