我已经为饱和度编写了以下矩阵,但它没有给出正确的结果。有人可以告诉我这里有什么问题吗?
ColorMatrix colorMatrix = new ColorMatrix(saturationFilter(0.3f));
ColorMatrixColorFilter matrix = new ColorMatrixColorFilter(colorMatrix);
public static float[] saturationFilter(float x){
float lumR = 0.3086f;
float lumG = 0.6094f;
float lumB = 0.0820f;
float matrix[] = {lumR*(1-x)+x,lumG*(1-x),lumB*(1-x), 0, 0, 0,0,
lumR*(1-x)+x,lumG*(1-x),lumB*(1-x), 0, 0, 0,0,
lumR*(1-x)+x,lumG*(1-x),lumB*(1-x), 0, 0, 0,0,
0f, 0f, 0f, 1f, 0f,
0f ,0f, 0f, 0f ,1f};
return matrix;
}