Chinaunix首页 | 论坛 | 博客
  • 博客访问: 318813
  • 博文数量: 23
  • 博客积分: 2115
  • 博客等级: 大尉
  • 技术积分: 371
  • 用 户 组: 普通用户
  • 注册时间: 2006-07-15 16:36
文章分类

全部博文(23)

文章存档

2013年(4)

2012年(4)

2011年(3)

2010年(6)

2009年(5)

2008年(1)

我的朋友

分类:

2010-07-09 10:22:40

The matrix coefficients constitute a 5 x 5 linear transformation that is used for transforming ARGB homogeneous values. For example, an ARGB vector is represented as red, green, blue, alpha and w, where w is always 1.

For example, suppose you want to start with the color (0.2, 0.0, 0.4, 1.0) and apply the following transformations:

Double the red component

Add 0.2 to the red, green, and blue components

The following matrix multiplication will perform the pair of transformations in the order listed.


The elements of a color matrix are indexed (zero-based) by row and then column. For example, the entry in the fifth row and third column of matrix M is denoted by M[4][2].

The 5×5 identity matrix (shown in the following illustration) has 1s on the diagonal and 0s everywhere else. If you multiply a color vector by the identity matrix, the color vector does not change. A convenient way to form the matrix of a color transformation is to start with the identity matrix and make a small change that produces the desired transformation.

阅读(394) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~