Graphics Reference
In-Depth Information
B
B
B
(0,0,0)
(0,0,0)
(0,0,0)
bc2
bc2
bc2
R
bc1
R
R
bc1
G
G
G
Figure 2.3. Hue encoding process
in Figure 2.3 and can be outlined as follows:
1. Project the color point in the linear RGB space onto the color plane.
2. Compute the 2D coordinates of the point on the plane.
3. Find a 2D line on plane passing through (0,0,0) and the point.
4. Find the proportion in which the line crosses the 2D line between the base
color points, i.e., determine the blend factor for the base colors.
The first step is a simple geometric operation. From the second step on,
we have to perform geometric operations on 2D coordinates embedded within
the plane. Having the two base color points A and B , we can compute the 2D
coordinate frame of the plane as
A
B
( F x ·
B ) F x
F x =
F y =
A
B
( F x ·
B ) F x
and then compute 2D coordinates of any point within the plane using the dot
product:
F y ) .
Please note that we do not actually need the explicit RGB coordinates of the
point on the plane nearest to the color being encoded, but only its 2D coordinates
within the plane, x i and y i . As both the original point and the point projected
onto the plane will have the same 2D coordinates, we can skip step 1 in the
outlined algorithm completely. The projection onto the plane is a side effect of
the reduction to only two dimensions.
The problem of computing the base color blend factor for hue, when consid-
ering the points embedded within the color plane, is now reduced to the problem
of intersection of two lines: a line connecting both base color points and a line
( x i ,y i )=( P i ·
F x ,P i ·
Search WWH ::




Custom Search