Texture class base
Constructors
- Texture.fromImage(GpuContext gpuContext, Image image)
-
Wraps the GPU texture that backs
imageas a Flutter GPU Texture, without copying any pixel data.factory
Properties
- enableRenderTargetUsage → bool
-
Enable using this texture as a render pass attachment.
final
- enableShaderReadUsage → bool
-
Enable reading or sampling from this texture in a shader.
final
- enableShaderWriteUsage → bool
-
Enable writing to the texture in a shader.
final
- format → PixelFormat
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → int
-
final
- isValid → dynamic
-
no setter
- mipLevelCount → int
-
The number of mip levels allocated for this texture.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sampleCount → int
-
final
- sliceCount → int
-
The number of slices in this texture. Determined by textureType:
1 for 2D and external textures, 6 for cubemap textures.
no setter
- storageMode → StorageMode
-
final
- textureType → TextureType
-
final
- width → int
-
final
Methods
-
asImage(
) → Image -
getBaseMipLevelSizeInBytes(
) → int -
Returns the size in bytes of the base mip level (one slice). Equivalent
to
getMipLevelSizeInBytes(0). -
getMipLevelHeight(
int mipLevel) → int -
Returns the height of the texture at
mipLevel, clamped at 1. -
getMipLevelSizeInBytes(
int mipLevel) → int -
Returns the size in bytes of the
mipLevelmip level (one slice). Mip dimensions are clamped at 1, matching standard mip chain semantics. For block-compressed formats the dimensions are rounded up to whole blocks. -
getMipLevelWidth(
int mipLevel) → int -
Returns the width of the texture at
mipLevel, clamped at 1. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
overwrite(
ByteData sourceBytes, {int mipLevel = 0, int slice = 0}) → void -
Overwrites a mip level (and slice for cubemap textures) of this
Texture with the contents of
sourceBytes. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
fullMipCount(
int width, int height) → int -
Returns the maximum number of mip levels Flutter GPU will allocate
for a texture of the given
widthandheight.