docs: public static BufferedImage getImage(ByteBuffer imageData, Format format, Rectangle size) {
          final int width = size.getWidth();
          final int height = size.getHeight();
          final BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
          final int[] pixels = ((DataBufferInt) image.getRaster().getDataBuffer()).getData();
          for (int x = 0; x < width; x++) {
              for (int y = 0; y < height; y++) {
                  final int srcIndex = (x + y * width) * format.getComponentCount();
                  final int destIndex = x + (height - y - 1) * width;
                  if (format.hasRed()) {
                      pixels[destIndex] |= (imageData.get(srcIndex) & 0xff) << 16;
                  }
                  if (format.hasGreen()) {
                      pixels[destIndex] |= (imageData.get(srcIndex + 1) & 0xff) << 8;
                  }
                  if (format.hasBlue()) {
                      pixels[destIndex] |= imageData.get(srcIndex + 2) & 0xff;
                  }
                  if (format.hasAlpha()) {
                      pixels[destIndex] |= (imageData.get(srcIndex + 3) & 0xff) << 24;
                  } else {
                      pixels[destIndex] |= 0xff000000;
                  }
              }
          }
          return image;
      }