code: def _load(self):
      palette = self._read_palette()
  
      data = bytearray()
      self.fd.seek(self._blp_offsets[0])
  
      if self._blp_compression == 1:
          # Uncompressed or DirectX compression
  
          if self._blp_encoding == BLP_ENCODING_UNCOMPRESSED:
              _data = BytesIO(self.fd.read(self._blp_lengths[0]))
              while True:
                  try:
                      (offset,) = struct.unpack("<B", _data.read(1))
                  except struct.error:
                      break
                  b, g, r, a = palette[offset]
                  data.extend((r, g, b))
  
          elif self._blp_encoding == BLP_ENCODING_DXT:
              if self._blp_alpha_encoding == BLP_ALPHA_ENCODING_DXT1:
                  linesize = (self.size[0] + 3) // 4 * 8
                  for yb in range((self.size[1] + 3) // 4):
                      for d in decode_dxt1(
                          self.fd.read(linesize),
                          alpha=bool(self._blp_alpha_depth),
                      ):
                          data += d
  
              elif self._blp_alpha_encoding == BLP_ALPHA_ENCODING_DXT3:
                  linesize = (self.size[0] + 3) // 4 * 16
                  for yb in range((self.size[1] + 3) // 4):
                      for d in decode_dxt3(self.fd.read(linesize)):
                          data += d
  
              elif self._blp_alpha_encoding == BLP_ALPHA_ENCODING_DXT5:
                  linesize = (self.size[0] + 3) // 4 * 16
                  for yb in range((self.size[1] + 3) // 4):
                      for d in decode_dxt5(self.fd.read(linesize)):
                          data += d
              else:
                  raise BLPFormatError(
                      "Unsupported alpha encoding %r"
                      % (self._blp_alpha_encoding)
                  )
          else:
              raise BLPFormatError(
                  "Unknown BLP encoding %r" % (self._blp_encoding)
              )
  
      else:
          raise BLPFormatError(
              "Unknown BLP compression %r" % (self._blp_compression)
          )
  
      self.set_as_raw(bytes(data))
  
imports: import struct
  from io import BytesIO
  from .None import Image, ImageFile
label_desc: Use image node_id 1 for calling the BLP2Decoder obj's underlying member method code with example usage: obj._load() without return types