Table of Contents Glide Programming Guide


) Table Using the Alpha Component.1 lists the possible values for func, the first argument to grAlphaCombine()



Download 6.22 Mb.
Page38/106
Date03.02.2023
Size6.22 Mb.
#60547
1   ...   34   35   36   37   38   39   40   41   ...   106
GLIDEPGM
)
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.



  1. 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 * (aotheralocal)

GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL_ADD_LOCAL
GR_COMBINE_FUNCTION_BLEND


Download 6.22 Mb.

Share with your friends:
1   ...   34   35   36   37   38   39   40   41   ...   106




The database is protected by copyright ©ininet.org 2024
send message

    Main page