UberColorPickerDialog.java 文件源码

java
阅读 32 收藏 0 点赞 0 评论 0

项目:GitHub 作者:
/**
 * Keep all colorspace representations in sync.
 */
private void updateYUVfromRGB() {
    float r = mRGB[0] / 255.0f;
    float g = mRGB[1] / 255.0f;
    float b = mRGB[2] / 255.0f;

    ColorMatrix cm = new ColorMatrix();
    cm.setRGB2YUV();
    final float[] a = cm.getArray();

    mYUV[0] = a[0] * r + a[1] * g + a[2] * b;
    mYUV[0] = pinToUnit(mYUV[0]);
    mYUV[1] = a[5] * r + a[6] * g + a[7] * b;
    mYUV[1] = pin(mYUV[1], -.5f, .5f);
    mYUV[2] = a[10] * r + a[11] * g + a[12] * b;
    mYUV[2] = pin(mYUV[2], -.5f, .5f);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号