Sdílet prostřednictvím


MeshSpecification Class

Definition

Class responsible for holding specifications for Mesh creations.

[Android.Runtime.Register("android/graphics/MeshSpecification", ApiSince=34, DoNotGenerateAcw=true)]
public class MeshSpecification : Java.Lang.Object
[<Android.Runtime.Register("android/graphics/MeshSpecification", ApiSince=34, DoNotGenerateAcw=true)>]
type MeshSpecification = class
    inherit Object
Inheritance
MeshSpecification
Attributes

Remarks

Class responsible for holding specifications for Mesh creations. This class generates a MeshSpecification via the MeshSpecification#make(Attribute[], int, Varying[], String, String) method, where multiple parameters to set up the mesh are supplied, including attributes, vertex stride, Varying, and vertex/fragment shaders. There are also additional methods to provide an optional ColorSpace as well as an alpha type.

For example a vertex shader that leverages a Varying may look like the following:

Varyings main(const Attributes attributes) {
                        Varyings varyings;
                        varyings.position = attributes.position;
                        return varyings;
                   }

The corresponding fragment shader that may consume the varying look like the following:

float2 main(const Varyings varyings, out float4 color) {
                        color = vec4(1.0, 0.0, 0.0, 1.0);
                        return varyings.position;
                 }

The color returned from this fragment shader is blended with the other parameters that are configured on the Paint object (ex. Paint#setBlendMode(BlendMode) used to draw the mesh.

The position returned in the fragment shader can be consumed by any following fragment shaders in the shader chain.

See https://developer.android.com/develop/ui/views/graphics/agsl for more information regarding Android Graphics Shader Language.

Note that there are several limitations on various mesh specifications: 1. The max amount of attributes allowed is 8. 2. The offset alignment length is 4 bytes. 2. The max stride length is 1024. 3. The max amount of varyings is 6.

These should be kept in mind when generating a mesh specification, as exceeding them will lead to errors.

Java documentation for android.graphics.MeshSpecification.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

MeshSpecification(IntPtr, JniHandleOwnership)

Fields

AlphaTypeOpaque
Obsolete.

Pixel is opaque.

AlphaTypePremultiplied
Obsolete.

Pixel components are premultiplied by alpha.

AlphaTypeUnknown
Obsolete.

uninitialized.

AlphaTypeUnpremultiplied
Obsolete.

Pixel components are independent of alpha.

TypeFloat
Obsolete.

Represents one float.

TypeFloat2
Obsolete.

Represents two floats.

TypeFloat3
Obsolete.

Represents three floats.

TypeFloat4
Obsolete.

Represents four floats.

TypeUbyte4
Obsolete.

Represents four bytes.

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
Handle

The handle to the underlying Android instance.

(Inherited from Object)
JniIdentityHashCode (Inherited from Object)
JniPeerMembers
PeerReference (Inherited from Object)
ThresholdClass
ThresholdType

Methods

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Make(MeshSpecification+Attribute[], Int32, MeshSpecification+Varying[], String, String, ColorSpace, MeshAlphaType)
Make(MeshSpecification+Attribute[], Int32, MeshSpecification+Varying[], String, String, ColorSpace)
Make(MeshSpecification+Attribute[], Int32, MeshSpecification+Varying[], String, String)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to