al - Audio Library Functions gDP - DP GBI Macros gdSP - General GBI Macros gSP - SP GBI Macros gt - Turbo Microcode RDP gu - Graphics Utilities Math - Math Functions nuSys - NuSystem os - N64 Operating System sp - Sprite Library Functions uh - Host to Target IO 64DD - N64 Disk Drive
|
gDPSetConvertFormat#include "gbi.h" gDPSetConvert(Gfx *gdl, int k0, int k1, int k2, int k3, int k4, int k5) gsDPSetConvert(int k0, int k1, int k2, int k3, int k4, int k5)Arguments
This macro sets the matrix coefficients for converting YUV pixels to RGB. Conceptually, the equations are: R = C0 * (Y-16) + C1 * V G = C0 * (Y-16) + C2 * U - C3 * V B = C0 * (Y-16) + C4 * UIn the hardware, the color conversion is done in two stages. In the Texture Filter unit (TF), the following equations are performed: R' = Y + K0 * V G' = Y + K1 * U + K2 * V B' = Y + K3 * UIn the color combiner, the following equations are performed: R = (R' - K4) * K5 + R' G = (G' - K4) * K5 + G' B = (B' - K4) * K5 + B'Where (Cx terms as used in the conceptual equation above): K0 = C1/C0 K1 = C2/C0 K2 = C3/C0 K3 = C4/C0 K4 = 16 + 16/(C0 - 1.0) K5 = C0 - 1.0Typical values for YUV to RGB conversion are: K0 = 175 K1 = -43 K2 = -89 K3 = 222 K4 = 114 K5 = 42Note You must set the color combiner (CC) and the texture filter to the proper settings in order to perform the color conversion. See Also gDPSetTextureConvert gDPSetCombineMode
|