ColorMatrix 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
用于转换位图的颜色和 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
- 继承
- 属性
注解
用于转换位图的颜色和 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’ = a*R + b*G + c*B + d*A + e;
G’ = f*R + g*G + h*B + i*A + j;
B’ = k*R + l*G + m*B + n*A + o;
A’ = p*R + q*G + r*B + s*A + t;
然后,生成的颜色 [R’, G’, B’, A’]
将每个通道固定到 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.ColorMatrix
Java 文档
本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。
构造函数
ColorMatrix() |
创建初始化为标识的新 colormatrix(好像已调用 reset() 一样)。 |
ColorMatrix(ColorMatrix) |
使用指定的 colormatrix 初始化的新 colormatrix。 |
ColorMatrix(IntPtr, JniHandleOwnership) |
创建 JNI 对象的托管表示形式时使用的构造函数;由运行时调用。 |
ColorMatrix(Single[]) |
创建使用指定值数组初始化的新 colormatrix。 |
属性
Class |
返回此 |
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 设置为标识: |
Set(ColorMatrix) |
将 src colormatrix 分配到此矩阵,复制其所有值。 |
Set(Single[]) |
将浮点数组分配到此矩阵中,复制其所有值。 |
SetConcat(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, Int32) |
使当前线程等待直到唤醒,通常是通过 <em>通知</em> 或 <em interrupted</em>>,或直到经过一定数量的实时。 (继承自 Object) |
Wait(Int64) |
使当前线程等待直到唤醒,通常是通过 <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 矩阵。 |