)
Table Using the Alpha Component.1 lists the possible values for func, the first argument to grAlphaCombine(). The f that appears in the formulas in Table Using the Alpha Component.1 is a scale factor that is chosen by the second argument, factor. Table Using the Alpha Component.2 lists the possible scale factors. alocal and aother are chosen by the third and fourth arguments, local and other; the candidates are listed in Table Using the Alpha Component.3. As with grColorCombine(), the final argument, invert, is a Boolean that is set if a bit-wise inversion of the computed alpha value is desired. Inverting the bits in a color component c is the same as computing (1.0 – c) for floating point color values in the range [0..1] or (255 – c) for 8-bit color values in the range [0..255].
The default alpha combine unit configuration is
grAlphaCombine( GR_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_ONE,
GR_COMBINE_LOCAL_NONE,
GR_COMBINE_OTHER_CONSTANT,
FXFALSE
);
Two examples in the previous chapter, Example Color and Lighting.7 and Example Color and Lighting.8, use the alocal or aother value.
Table Using the Alpha Component.1 Combining functions for alpha.
The first argument to grAlphaCombine(), func, specifies the alpha combine function; its value is chosen from among the symbols list in the left hand column of the table below. The right hand column gives the combining function that corresponds to each symbolic name. F is a scale factor and is defined by the factor argument to grAlphaCombine(). alocal and aother are specified by the third and fourth arguments.
Combine function
|
computed alpha
|
GR_COMBINE_FUNCTION_ZERO
|
0
|
GR_COMBINE_FUNCTION_LOCAL
|
alocal
|
GR_COMBINE_FUNCTION_LOCAL_ALPHA
|
alocal
|
GR_COMBINE_FUNCTION_SCALE_OTHER
GR_COMBINE_FUNCTION_BLEND_OTHER
|
f * aother
|
GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL
|
f * aother + alocal
|
GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL_ALPHA
|
f * aother + alocal
|
GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL
|
f * (aother – alocal)
|
GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL_ADD_LOCAL
GR_COMBINE_FUNCTION_BLEND
|
|
Share with your friends: |