Instance Method

write(to:)

Exports the texture data to an image file at the specified URL.

Declaration

func write(to URL: URL) -> Bool

Parameters

URL

The file URL at which to write the texture image.

Return Value

true if export succeeded; false otherwise.

Discussion

Model I/O automatically infers the file format in which to export the image from the filename extension of the url parameter. This method can export textures in JPEG, TIFF, PNG, or (in macOS only) OpenEXR format.

See Also

Exporting Textures

func write(to: URL, type: CFString) -> Bool

Exports the texture data to an image file at the specified URL, of the specified type.

func imageFromTexture() -> Unmanaged<CGImage>?

Exports the texture data as a CoreGraphics image.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software