Find the opaque pixel value corresponding to an RGB triple */
| 803 | |
| 804 | /* Find the opaque pixel value corresponding to an RGB triple */ |
| 805 | Uint32 |
| 806 | SDL_MapRGB(const SDL_PixelFormat * format, Uint8 r, Uint8 g, Uint8 b) |
| 807 | { |
| 808 | if (format->palette == NULL) { |
| 809 | return (r >> format->Rloss) << format->Rshift |
| 810 | | (g >> format->Gloss) << format->Gshift |
| 811 | | (b >> format->Bloss) << format->Bshift | format->Amask; |
| 812 | } else { |
| 813 | return SDL_FindColor(format->palette, r, g, b, SDL_ALPHA_OPAQUE); |
| 814 | } |
| 815 | } |
| 816 | |
| 817 | /* Find the pixel value corresponding to an RGBA quadruple */ |
| 818 | Uint32 |