docs/android/dokka/filament-android/com.google.android.filament/-texture/set-image.md
//filament-android/com.google.android.filament/Texture/setImage
[main]
open fun setImage(engine: Engine, level: Int, buffer: Texture.PixelBufferDescriptor)
setImage is used to modify the whole content of the texture from a CPU-buffer.
This Texture instance must use SAMPLER_2D or SAMPLER_EXTERNAL. If the later is specified and external textures are supported by the driver implementation, this method will have no effect, otherwise it will behave as if the texture was specified with SAMPLER_2D.
This is equivalent to calling: setImage(engine, level, 0, 0, getWidth(level), getHeight(level), buffer)
main
| engine | Engine this texture is associated to. Must be the instance passed to Builder.build(). |
| level | Level to set the image for. Must be less than getLevels. |
| buffer | Client-side buffer containing the image to set. buffer's format must match that of getFormat |
| Texture.Builder |
| Texture.PixelBufferDescriptor |
| BufferOverflowException | if the specified parameters would result in reading outside of buffer. |
[main]
open fun setImage(engine: Engine, level: Int, xoffset: Int, yoffset: Int, width: Int, height: Int, buffer: Texture.PixelBufferDescriptor)
setImage is used to modify a sub-region of the texture from a CPU-buffer.
This Texture instance must use SAMPLER_2D or SAMPLER_EXTERNAL. If the later is specified and external textures are supported by the driver implementation, this method will have no effect, otherwise it will behave as if the texture was specified with SAMPLER_2D.
main
| engine | Engine this texture is associated to. Must be the instance passed to Builder.build(). |
| level | Level to set the image for. Must be less than getLevels. |
| xoffset | x-offset in texel of the region to modify |
| yoffset | y-offset in texel of the region to modify |
| width | width in texel of the region to modify |
| height | height in texel of the region to modify |
| buffer | Client-side buffer containing the image to set. buffer's format must match that of getFormat |
| Texture.Builder |
| Texture.PixelBufferDescriptor |
| BufferOverflowException | if the specified parameters would result in reading outside of buffer. |
[main]
open fun setImage(engine: Engine, level: Int, xoffset: Int, yoffset: Int, zoffset: Int, width: Int, height: Int, depth: Int, buffer: Texture.PixelBufferDescriptor)
setImage is used to modify a sub-region of a 3D texture, 2D texture array or cubemap from a CPU-buffer. Cubemaps are treated like a 2D array of six layers.
This Texture instance must use SAMPLER_2D_ARRAY, SAMPLER_3D or SAMPLER_CUBEMAP.
main
| engine | Engine this texture is associated to. Must be the instance passed to Builder.build(). |
| level | Level to set the image for. Must be less than getLevels. |
| xoffset | x-offset in texel of the region to modify |
| yoffset | y-offset in texel of the region to modify |
| zoffset | z-offset in texel of the region to modify |
| width | width in texel of the region to modify |
| height | height in texel of the region to modify |
| depth | depth in texel or index of the region to modify |
| buffer | Client-side buffer containing the image to set. buffer's format must match that of getFormat |
| Texture.Builder |
| Texture.PixelBufferDescriptor |
| BufferOverflowException | if the specified parameters would result in reading outside of buffer. |