Grayscale modes

From Bennu Wiki
Jump to: navigation, search


Description

Greyscale modes are used to specify the mode of color scaling in the Grayscale().

Grayscale modes

Constant - Value - Description
GSCALE_RGB - 0 - changes the graphic to monochrome.
GSCALE_R - 1 - changes the graphic to RED scale.
GSCALE_G - 2 - changes the graphic to GREEN scale.
GSCALE_B - 3 - changes the graphic to BLUE scale.
GSCALE_RG - 4 - changes the graphic to YELLOW scale.
GSCALE_RB - 5 - changes the graphic to PURPLE scale.
GSCALE_GB - 6 - changes the graphic to CYAN scale.
GSCALE_OFF - -1 - no change, graphic stays as it is, so filter is not applied.

Notes

The exact formula is:

c = 0.3 * oldpixel_r + 0.59 * oldpixel_g + 0.11 * oldpixel_b

Method 0:

for every pixel:
    newpixel_rgb = (c,c,c)

Method 1:

for every pixel:
    newpixel_rgb = (c,0,0)

Method 2:

for every pixel:
    newpixel_rgb = (0,c,0)

Method 3:

for every pixel:
    newpixel_rgb = (0,0,c)

Method 4:

for every pixel:
    newpixel_rgb = (c,c,0)

Method 5:

for every pixel:
    newpixel_rgb = (c,0,c)

Method 6:

for every pixel:
    newpixel_rgb = (0,c,c)

Other methodnumbers:

for every pixel:
    newpixel_rgb = oldpixel_rgb

Note that rgbscale(0,map,1,1,1) = grayscale(0,map,0) for a valid graphic (0,map).



Mod_effects
Globals None
Imported:
M7
Constants BLUR3X3BLUR5X5BLUR5X5MAPBLURNORMALGSCALEBGSCALEGGSCALEGBGSCALEOFFGSCALERGSCALERBGSCALERGGSCALERGB
Functions Blur()Filter()Grayscale()Rgbscale()