Databases Reference
In-Depth Information
If Timer < t0 Then
t0 = t0 - CLng(24) * CLng(60) * CLng(60)
End If
Loop
tn = Timer
End Sub
5.10
LINEAR AND NONLINEAR MAPPING
Although the color morphing example given in the previous section of this chapter serves as an
interesting academic example, its usefulness in real-world applications is somewhat limited. What
is useful, however, is the ability to take a coloring scheme and map it to a range or region of
interest. Using the previous example, if the ideal value one is looking for is 100, but an acceptable
range of values could be
±
10% of the ideal value, the desired value of ( x ) will therefore fall
between 90 and 110 (90
110). In such an instance, the user might wish to map the color
spectrum from green to red onto the region of interest (90
x
110). Here, the ideal color
(green) would be mapped to the value of 100, and as results approach the limits of the acceptable
region (90 or 110), the colors would turn from green to yellow to orange to red. Such a mapping
can be done in one of two ways. The first and simplest is a linear map, whereby the colors
change incrementally from the starting color to the ending color in a manner in which each
successive step from the starting color to the ending color is identical. A more complicated means
of mapping is a nonlinear map. Nonlinear maps are usually utilized with exponential functions
that allow the initial (or ideal) color to dominate over the range for a longer interval prior to
having the colors change more rapidly toward the ending color. Linear and potential nonlinear
mapping schemes are shown in Figure 5.28.
Such a mapping scheme immediately raises several issues to the forefront, which arise from the
fact that two differing intervals must be utilized to apply such a color-mapping scheme. The first
interval is that which encompasses the range of expected values herein referred to as the interval
range (IR). The second interval is that which encompasses all of the potential RGB color values over
the spectrum to be applied, herein referred to as the color step range (CSR). This, of course, brings
to light one of three possible cases with respect to the range of the two intervals.
x
1.
IR > CSR
2.
IR
=
CSR
3.
IR < CSR
FIGURE 5.28 Linear vs. nonlinear mapping.
Search WWH ::




Custom Search