Back to Filament

setExternalImage

docs/android/dokka/filament-android/com.google.android.filament/-texture/set-external-image.md

1.75.02.4 KB
Original Source

//filament-android/com.google.android.filament/Texture/setExternalImage

setExternalImage

[main]
open fun setExternalImage(engine: Engine, eglImage: Long)

Specifies the external image to associate with this Texture.

This Texture instance must use SAMPLER_EXTERNAL.

Typically the external image is OS specific, and can be a video or camera frame. There are many restrictions when using an external image as a texture, such as:

  • only the level of detail (LOD) 0 can be specified
  • only NEAREST or LINEAR filtering is supported
  • the size and format of the texture is defined by the external image

Parameters

main

engineEngine this texture is associated to. Must be the instance passed to Builder.build().
eglImageAn opaque handle to a platform specific image. Supported types are eglImageOES on Android and CVPixelBufferRef on iOS.
On iOS the following pixel formats are supported:
  • `kCVPixelFormatType_32BGRA` -     `kCVPixelFormatType_420YpCbCr8BiPlanarFullRange` |
    

See also

Texture.Builder

[main]
open fun setExternalImage(engine: Engine, externalImageRef: Any)

Specifies the external image to associate with this Texture.

Typically, the external image is OS specific, and can be a video or camera frame. There are many restrictions when using an external image as a texture, such as:

  • only the level of detail (lod) 0 can be specified
  • only nearest or linear filtering is supported
  • the size and format of the texture is defined by the external image
  • only the CLAMP_TO_EDGE wrap mode is supported

Parameters

main

engineEngine this texture is associated to. Must be the instance passed to Builder.build().
externalImageRefAn OS specific Object. On Android it must be a android.hardware.HardwareBuffer