isResizerAvailable

function isResizerAvailable(): boolean

Returns whether the GPU-accelerated Resizer pipeline is available on this device.

  • On iOS, this requires the Metal GPU framework, which is always available.
  • On Android, this requires the Vulkan GPU framework and AHardwareBuffer* extensions, which are only available on Android SDK 28.

Example

function getResizer(options: ResizerOptions): Resizer | CPUFallbackResizer {
  if (isResizerAvailable()) {
    // GPU accelerated Resizer pipeline is available!
    return createResizer(options)
  } else {
    // GPU accelerated Resizer pipeline is not available on this device,
    // fall back to a CPU implementation.
    return ...
  }
}