Share via


ColorMatrix 类

定义

用于转换位图的颜色和 alpha 分量 4x5 矩阵。

[Android.Runtime.Register("android/graphics/ColorMatrix", DoNotGenerateAcw=true)]
public class ColorMatrix : Java.Lang.Object
[<Android.Runtime.Register("android/graphics/ColorMatrix", DoNotGenerateAcw=true)>]
type ColorMatrix = class
    inherit Object
继承
ColorMatrix
属性

注解

用于转换位图的颜色和 alpha 分量 4x5 矩阵。 矩阵可以作为单个数组传递,并按如下方式处理:

[ a, b, c, d, e,
               f, g, h, i, j,
               k, l, m, n, o,
               p, q, r, s, t ]

当应用于颜色 [R, G, B, A]时,生成的颜色将按以下方式计算:

R&rsquo; = a*R + b*G + c*B + d*A + e;
              G&rsquo; = f*R + g*G + h*B + i*A + j;
              B&rsquo; = k*R + l*G + m*B + n*A + o;
              A&rsquo; = p*R + q*G + r*B + s*A + t;

然后,生成的颜色 [R&rsquo;, G&rsquo;, B&rsquo;, A&rsquo;] 将每个通道固定到 0 范围 255

下面的示例 ColorMatrix 通过按 缩放每个通道 -1,然后将结果 255 向上移动以保留在标准颜色空间中来反转传入颜色。

[ -1, 0, 0, 0, 255,
                0, -1, 0, 0, 255,
                0, 0, -1, 0, 255,
                0, 0, 0, 1, 0 ]

android.graphics.ColorMatrixJava 文档。

此页面的某些部分是基于 创建和共享的工作进行的修改,并根据 署名许可中所述的条款使用。

构造函数

ColorMatrix()

创建初始化为标识 (的新 colormatrix,就像) 调用 reset () 一样。

ColorMatrix(ColorMatrix)

创建使用指定的 colormatrix 初始化的新 colormatrix。

ColorMatrix(IntPtr, JniHandleOwnership)

创建 JNI 对象的托管表示形式时使用的构造函数;由运行时调用。

ColorMatrix(Single[])

创建使用指定的值数组初始化的新 colormatrix。

属性

Class

返回此 Object的运行时类。

(继承自 Object)
Handle

基础 Android 实例的句柄。

(继承自 Object)
JniIdentityHashCode

用于转换位图的颜色和 alpha 分量 4x5 矩阵。

(继承自 Object)
JniPeerMembers

用于转换位图的颜色和 alpha 分量 4x5 矩阵。

PeerReference

用于转换位图的颜色和 alpha 分量 4x5 矩阵。

(继承自 Object)
ThresholdClass

此 API 支持 Mono for Android 基础结构,不应直接从代码中使用。

ThresholdType

此 API 支持 Mono for Android 基础结构,不应直接从代码中使用。

方法

Clone()

创建并返回此对象的副本。

(继承自 Object)
Dispose()

用于转换位图的颜色和 alpha 分量 4x5 矩阵。

(继承自 Object)
Dispose(Boolean)

用于转换位图的颜色和 alpha 分量 4x5 矩阵。

(继承自 Object)
Equals(Object)

指示某个其他对象是否“等于”此对象。

(继承自 Object)
GetArray()

返回表示此 colormatrix 的浮点数组。

GetHashCode()

返回对象的哈希代码值。

(继承自 Object)
JavaFinalize()

当垃圾回收确定不再引用对象时,由垃圾回收器对对象调用。

(继承自 Object)
Notify()

唤醒正在等待此对象的监视器的单个线程。

(继承自 Object)
NotifyAll()

唤醒正在等待此对象的监视器的所有线程。

(继承自 Object)
PostConcat(ColorMatrix)

将此 colormatrix 与指定的 postmatrix 相连接。

PreConcat(ColorMatrix)

将此 colormatrix 与指定的 prematrix 相连接。

Reset()

将此 colormatrix 设置为 identity:

Set(ColorMatrix)

将 src colormatrix 分配到此矩阵,复制其所有值。

Set(Single[])

将浮点数组分配给此矩阵,复制其所有值。

SetConcat(ColorMatrix, ColorMatrix)

将此 colormatrix 设置为两个指定颜色的串联,以便生成的 colormatrix 具有与应用 matB 然后应用 matA 相同的效果。

SetHandle(IntPtr, JniHandleOwnership)

设置 Handle 属性。

(继承自 Object)
SetRGB2YUV()

设置矩阵以将 RGB 转换为 YUV

SetRotate(Int32, Single)

按指定值设置颜色轴上的旋转。

SetSaturation(Single)

设置矩阵以影响颜色的饱和度。

SetScale(Single, Single, Single, Single)

将此 colormatrix 设置为按指定值缩放。

SetYUV2RGB()

将矩阵设置为从 YUV 转换为 RGB

ToArray<T>()

用于转换位图的颜色和 alpha 分量 4x5 矩阵。

(继承自 Object)
ToString()

返回对象的字符串表示形式。

(继承自 Object)
UnregisterFromRuntime()

用于转换位图的颜色和 alpha 分量 4x5 矩阵。

(继承自 Object)
Wait()

导致当前线程等待,直到它被唤醒,通常是通过 em <通知/em> 或 <em>interrupted</em>。<>

(继承自 Object)
Wait(Int64)

导致当前线程等待,直到它被唤醒,通常是通过 em <通知/em> 或 <em>interrupted</em>,或直到经过一定数量的实时。<>

(继承自 Object)
Wait(Int64, Int32)

导致当前线程等待,直到它被唤醒,通常是通过 em <通知/em> 或 <em>interrupted</em>,或直到经过一定数量的实时。<>

(继承自 Object)

显式接口实现

IJavaPeerable.Disposed()

用于转换位图的颜色和 alpha 分量 4x5 矩阵。

(继承自 Object)
IJavaPeerable.DisposeUnlessReferenced()

用于转换位图的颜色和 alpha 分量 4x5 矩阵。

(继承自 Object)
IJavaPeerable.Finalized()

用于转换位图的颜色和 alpha 分量 4x5 矩阵。

(继承自 Object)
IJavaPeerable.JniManagedPeerState

用于转换位图的颜色和 alpha 分量 4x5 矩阵。

(继承自 Object)
IJavaPeerable.SetJniIdentityHashCode(Int32)

用于转换位图的颜色和 alpha 分量 4x5 矩阵。

(继承自 Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates)

用于转换位图的颜色和 alpha 分量 4x5 矩阵。

(继承自 Object)
IJavaPeerable.SetPeerReference(JniObjectReference)

用于转换位图的颜色和 alpha 分量 4x5 矩阵。

(继承自 Object)

扩展方法

JavaCast<TResult>(IJavaObject)

执行 Android 运行时检查的类型转换。

JavaCast<TResult>(IJavaObject)

用于转换位图的颜色和 alpha 分量 4x5 矩阵。

GetJniTypeName(IJavaPeerable)

用于转换位图的颜色和 alpha 分量 4x5 矩阵。

适用于