Contents

generate()

Creates a 3D representation of the image if one does not already exist.

Declaration

@abi(final func generateNonisolatedNonsendingFinal() async throws) nonisolated(nonsending) final func generate() async throws

Discussion

This method checks for cancellation of an enclosing Task during generation, and cancels its own async generation early (by throwing an error) if task cancellation is detected.

Also throws an error if the image size does not meet the following requirements:

  • At least 320 pixels on its shortest side

  • At most 16,384 pixels on its largest side

  • Aspect ratio between 1:3 and 3:1