isResizerAvailable

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 devices.

  • On Android, this requires the Vulkan GPU framework and AHardwareBuffer* extensions, which are only available on Android 9 (API 28) or higher.

suspend fun getResizer(options: ResizerOptions): Resizer? =
if (isResizerAvailable()) {
// GPU accelerated Resizer pipeline is available!
createResizer(options)
} else {
// GPU accelerated Resizer pipeline is not available on this device, fall back to a CPU implementation.
null
}