public final class ExrImage


Represents an EXR image in SceneCore.

EXR images are used by the SpatialEnvironment for drawing skyboxes.

Summary

Public methods

static final @NonNull ExrImage

Public factory for an ExrImage, asynchronously loading a preprocessed skybox from a Path relative to the application's assets/ folder.

static final @NonNull ExrImage

Public factory for an ExrImage, asynchronously loading a preprocessed skybox from a Uri.

static final @NonNull ExrImage
@MainThread
createFromZip(
    @NonNull Session session,
    @NonNull byte[] assetData,
    @NonNull String assetKey
)

Public factory function for a preprocessed EXRImage, where the preprocessed EXRImage is asynchronously loaded.

boolean
equals(Object other)
final @NonNull CubeMapTexture

Returns the reflection texture from a preprocessed EXR image.

int

Public methods

createFromZip

@MainThread
public static final @NonNull ExrImage createFromZip(@NonNull Session session, @NonNull Path path)

Public factory for an ExrImage, asynchronously loading a preprocessed skybox from a Path relative to the application's assets/ folder.

The input .zip file should contain the preprocessed image-based lighting (IBL) data, typically generated from an .exr or .hdr environment map using a tool like Filament's cmgen. See: https://github.com/google/filament/tree/main/tools/cmgen

Parameters
@NonNull Session session

The Session to use for loading the asset.

@NonNull Path path

The Path of the preprocessed .zip skybox file to be loaded, relative to the application's assets/ folder.

Returns
@NonNull ExrImage

a ExrImage upon completion. @throws IllegalArgumentException if Path.isAbsolute is true, as this method requires a relative path, or if the path does not specify a .zip file.

createFromZip

@MainThread
public static final @NonNull ExrImage createFromZip(@NonNull Session session, @NonNull Uri uri)

Public factory for an ExrImage, asynchronously loading a preprocessed skybox from a Uri.

The input .zip file should contain the preprocessed image-based lighting (IBL) data, typically generated from an .exr or .hdr environment map using a tool like Filament's cmgen. See: https://github.com/google/filament/tree/main/tools/cmgen

Parameters
@NonNull Session session

The Session to use for loading the asset.

@NonNull Uri uri

The Uri of the preprocessed .zip skybox file to be loaded.

Returns
@NonNull ExrImage

a ExrImage upon completion. @throws IllegalArgumentException if the Uri does not specify a .zip file.

createFromZip

@MainThread
public static final @NonNull ExrImage createFromZip(
    @NonNull Session session,
    @NonNull byte[] assetData,
    @NonNull String assetKey
)

Public factory function for a preprocessed EXRImage, where the preprocessed EXRImage is asynchronously loaded.

This method must be called from the main thread. https://developer.android.com/guide/components/processes-and-threads

Parameters
@NonNull Session session

The Session to use for loading the asset.

@NonNull byte[] assetData

The byte array of the preprocessed EXR image to be loaded.

@NonNull String assetKey

The key of the preprocessed EXR image to be loaded. This is used to identify the asset in the SceneCore cache.

Returns
@NonNull ExrImage

a ExrImage upon completion.

equals

public boolean equals(Object other)

getReflectionTexture

Added in 1.0.0-alpha05
@MainThread
public final @NonNull CubeMapTexture getReflectionTexture()

Returns the reflection texture from a preprocessed EXR image.

This method must be called from the main thread. https://developer.android.com/guide/components/processes-and-threads

Returns
@NonNull CubeMapTexture

a CubeMapTexture.

Throws
kotlin.IllegalStateException

if the reflection texture couldn't be retrieved or if the EXR image was not preprocessed.

hashCode

public int hashCode()