GPUTexture


public final class GPUTexture implements AutoCloseable


A GPU texture object.

Summary

Public methods

external void

Decrements the reference count of the object and frees resources when the count reaches zero.

final external @NonNull GPUTextureView

Creates a new view of the texture.

final int
final external void

Destroys the texture and releases its resources.

final int
boolean
equals(Object other)
final int
final external int

Gets the depth or number of array layers of the texture.

final external int

Gets the dimension of the texture.

final external int

Gets the format of the texture.

final long
final external int

Gets the height of the texture.

final external int

Gets the number of mipmap levels of the texture.

final external int

Gets the sample count of the texture.

final external int
final external int

Gets the allowed usages of the texture.

final external int

Gets the width of the texture.

int
final int
final int
final int
final external void

Sets a human-readable label for debugging.

final int
final int
final int

Extension functions

final @NonNull Bitmap
TexturesUtils.createBitmap(
    @NonNull GPUTexture receiver,
    @NonNull GPUDevice device
)

Public methods

close

Added in 1.0.0-alpha04
public external void close()

Decrements the reference count of the object and frees resources when the count reaches zero.

This is the standard way to manage object lifetimes and should be used in use blocks. After calling this, the object is no longer usable.

createView

Added in 1.0.0-alpha04
@FastNative
public final external @NonNull GPUTextureView createView(GPUTextureViewDescriptor descriptor)

Creates a new view of the texture.

Parameters
GPUTextureViewDescriptor descriptor

The descriptor for the texture view.

Returns
@NonNull GPUTextureView

The created texture view.

depthOrArrayLayers

Added in 1.0.0-alpha04
public final int depthOrArrayLayers()

destroy

Added in 1.0.0-alpha04
@FastNative
public final external void destroy()

Destroys the texture and releases its resources.

dimension

Added in 1.0.0-alpha04
public final int dimension()

equals

public boolean equals(Object other)

format

Added in 1.0.0-alpha04
public final int format()

getDepthOrArrayLayers

Added in 1.0.0-alpha04
@FastNative
public final external int getDepthOrArrayLayers()

Gets the depth or number of array layers of the texture.

Returns
int

The texture depth or layer count.

getDimension

Added in 1.0.0-alpha04
@FastNative
public final external int getDimension()

Gets the dimension of the texture.

Returns
int

The texture dimension.

getFormat

Added in 1.0.0-alpha04
@FastNative
public final external int getFormat()

Gets the format of the texture.

Returns
int

The texture format.

getHandle

Added in 1.0.0-alpha04
public final long getHandle()

getHeight

Added in 1.0.0-alpha04
@FastNative
public final external int getHeight()

Gets the height of the texture.

Returns
int

The texture height.

getMipLevelCount

Added in 1.0.0-alpha04
@FastNative
public final external int getMipLevelCount()

Gets the number of mipmap levels of the texture.

Returns
int

The mipmap level count.

getSampleCount

Added in 1.0.0-alpha04
@FastNative
public final external int getSampleCount()

Gets the sample count of the texture.

Returns
int

The sample count.

getTextureBindingViewDimension

Added in 1.0.0-alpha04
@FastNative
public final external int getTextureBindingViewDimension()

getUsage

Added in 1.0.0-alpha04
@FastNative
public final external int getUsage()

Gets the allowed usages of the texture.

Returns
int

The texture usage flags.

getWidth

Added in 1.0.0-alpha04
@FastNative
public final external int getWidth()

Gets the width of the texture.

Returns
int

The texture width.

hashCode

public int hashCode()

height

Added in 1.0.0-alpha04
public final int height()

mipLevelCount

Added in 1.0.0-alpha04
public final int mipLevelCount()

sampleCount

Added in 1.0.0-alpha04
public final int sampleCount()

setLabel

Added in 1.0.0-alpha04
@FastNative
public final external void setLabel(@NonNull String label)

Sets a human-readable label for debugging.

Parameters
@NonNull String label

The label string.

textureBindingViewDimension

Added in 1.0.0-alpha04
public final int textureBindingViewDimension()

usage

Added in 1.0.0-alpha04
public final int usage()

width

Added in 1.0.0-alpha04
public final int width()

Extension functions

TexturesUtils.createBitmap

public final @NonNull Bitmap TexturesUtils.createBitmap(
    @NonNull GPUTexture receiver,
    @NonNull GPUDevice device
)