gDPSetKeyGB

gDPSetKeyGB [Macro]

Function

gDPSetKeyR, gsDPSetKeyR, gDPSetKeyGB, gsDPSetKeyGB

Selects the color for chroma key operation

Syntax

#include "gbi.h"
gDPSetKeyR(Gfx *gdl, cR, sR, wR)
gsDPSetKeyR(         cR, sR, wR)
gDPSetKeyGB(Gfx *gdl, cG, sG, wG, cB, sB, wB)
gsDPSetKeyGB(         cG, sG, wG, cB, sB, wB)

Arguments

*gdl
Pointer to graphics display list

color center
defines the intensity at which key is active (0~255)

color scale
(1.0/(size of soft edge))*255.
The scale is in the range 0~255. For hard edge keying, set scale to 255.

color width
(Size of half the key window including the soft edge)

*scale
Width is in 12bit4.8 format. When width>1.0, keying is disabled for the channel.

Description

This macro selects the color for chroma key operation.

Conceptually, the equation used for keying is:

key = clamp(0.0, -abs((X - center) * scale) + width, 1.0)

The alpha key is the minimum of KeyR, KeyG, KeyB

Note

The red, green, and blue chroma key information is split into two separate macros simply because they do not all fit in one.

See Also

gDPSetCombineKey