ReactOS  0.4.12-dev-75-g00dd17e
colormac.h File Reference
#include "config.h"
#include "macros.h"
#include "mtypes.h"
Include dependency graph for colormac.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

Generic color packing macros. All inputs should be GLubytes.
Todo:
We may move these into texstore.h at some point.
#define PACK_COLOR_8888(X, Y, Z, W)   (((X) << 24) | ((Y) << 16) | ((Z) << 8) | (W))
 
#define PACK_COLOR_8888_REV(X, Y, Z, W)   (((W) << 24) | ((Z) << 16) | ((Y) << 8) | (X))
 
#define PACK_COLOR_888(X, Y, Z)   (((X) << 16) | ((Y) << 8) | (Z))
 
#define PACK_COLOR_565(X, Y, Z)   ((((X) & 0xf8) << 8) | (((Y) & 0xfc) << 3) | (((Z) & 0xf8) >> 3))
 
#define PACK_COLOR_565_REV(X, Y, Z)   (((X) & 0xf8) | ((Y) & 0xe0) >> 5 | (((Y) & 0x1c) << 11) | (((Z) & 0xf8) << 5))
 
#define PACK_COLOR_5551(R, G, B, A)
 
#define PACK_COLOR_1555(A, B, G, R)
 
#define PACK_COLOR_1555_REV(A, B, G, R)
 
#define PACK_COLOR_2101010_UB(A, B, G, R)
 
#define PACK_COLOR_2101010_US(A, B, G, R)
 
#define PACK_COLOR_4444(R, G, B, A)   ((((R) & 0xf0) << 8) | (((G) & 0xf0) << 4) | ((B) & 0xf0) | ((A) >> 4))
 
#define PACK_COLOR_4444_REV(R, G, B, A)   ((((B) & 0xf0) << 8) | (((A) & 0xf0) << 4) | ((R) & 0xf0) | ((G) >> 4))
 
#define PACK_COLOR_44(L, A)   (((L) & 0xf0) | (((A) & 0xf0) >> 4))
 
#define PACK_COLOR_88(L, A)   (((L) << 8) | (A))
 
#define PACK_COLOR_88_REV(L, A)   (((A) << 8) | (L))
 
#define PACK_COLOR_1616(L, A)   (((L) << 16) | (A))
 
#define PACK_COLOR_1616_REV(L, A)   (((A) << 16) | (L))
 
#define PACK_COLOR_332(R, G, B)   (((R) & 0xe0) | (((G) & 0xe0) >> 3) | (((B) & 0xc0) >> 6))
 
#define PACK_COLOR_233(B, G, R)   (((B) & 0xc0) | (((G) & 0xe0) >> 2) | (((R) & 0xe0) >> 5))
 

Functions

static void _mesa_unclamped_float_rgba_to_ubyte (GLubyte dst[4], const GLfloat src[4])
 

Detailed Description

Color-related macros

Definition in file colormac.h.

Macro Definition Documentation

◆ PACK_COLOR_1555

#define PACK_COLOR_1555 (   A,
  B,
  G,
  R 
)
Value:
((((B) & 0xf8) << 7) | (((G) & 0xf8) << 2) | (((R) & 0xf8) >> 3) | \
(((A) & 0x80) << 8))
#define R(b, x)
Definition: sha2.c:134
#define B(row, col)
Definition: m_matrix.c:146
Definition: ttei1.cpp:12
#define G(x, y, z)
Definition: md5.c:52

Definition at line 79 of file colormac.h.

Referenced by _mesa_texstore_argb1555(), pack_ubyte_ARGB1555(), and pack_ubyte_ARGB1555_REV().

◆ PACK_COLOR_1555_REV

#define PACK_COLOR_1555_REV (   A,
  B,
  G,
  R 
)
Value:
((((B) & 0xf8) >> 1) | (((G) & 0xc0) >> 6) | (((G) & 0x38) << 10) | (((R) & 0xf8) << 5) | \
((A) ? 0x80 : 0))
#define R(b, x)
Definition: sha2.c:134
#define B(row, col)
Definition: m_matrix.c:146
#define A(row, col)
Definition: m_matrix.c:145
#define G(x, y, z)
Definition: md5.c:52

Definition at line 83 of file colormac.h.

Referenced by _mesa_texstore_argb1555().

◆ PACK_COLOR_1616

#define PACK_COLOR_1616 (   L,
  A 
)    (((L) << 16) | (A))

◆ PACK_COLOR_1616_REV

#define PACK_COLOR_1616_REV (   L,
  A 
)    (((A) << 16) | (L))

Definition at line 113 of file colormac.h.

Referenced by _mesa_texstore_unorm1616().

◆ PACK_COLOR_2101010_UB

#define PACK_COLOR_2101010_UB (   A,
  B,
  G,
  R 
)
Value:
(((B) << 22) | ((G) << 12) | ((R) << 2) | \
(((A) & 0xc0) << 24))
#define R(b, x)
Definition: sha2.c:134
#define B(row, col)
Definition: m_matrix.c:146
#define A(row, col)
Definition: m_matrix.c:145
#define G(x, y, z)
Definition: md5.c:52

Definition at line 87 of file colormac.h.

◆ PACK_COLOR_2101010_US

#define PACK_COLOR_2101010_US (   A,
  B,
  G,
  R 
)
Value:
((((B) >> 6) << 20) | (((G) >> 6) << 10) | ((R) >> 6) | \
(((A) >> 14) << 30))
#define R(b, x)
Definition: sha2.c:134
#define B(row, col)
Definition: m_matrix.c:146
#define A(row, col)
Definition: m_matrix.c:145
#define G(x, y, z)
Definition: md5.c:52

Definition at line 91 of file colormac.h.

◆ PACK_COLOR_233

#define PACK_COLOR_233 (   B,
  G,
  R 
)    (((B) & 0xc0) | (((G) & 0xe0) >> 2) | (((R) & 0xe0) >> 5))

Definition at line 119 of file colormac.h.

◆ PACK_COLOR_332

#define PACK_COLOR_332 (   R,
  G,
  B 
)    (((R) & 0xe0) | (((G) & 0xe0) >> 3) | (((B) & 0xc0) >> 6))

Definition at line 116 of file colormac.h.

Referenced by _mesa_texstore_rgb332(), and pack_ubyte_RGB332().

◆ PACK_COLOR_44

#define PACK_COLOR_44 (   L,
  A 
)    (((L) & 0xf0) | (((A) & 0xf0) >> 4))

Definition at line 101 of file colormac.h.

Referenced by _mesa_texstore_unorm44(), and pack_ubyte_AL44().

◆ PACK_COLOR_4444

#define PACK_COLOR_4444 (   R,
  G,
  B,
  A 
)    ((((R) & 0xf0) << 8) | (((G) & 0xf0) << 4) | ((B) & 0xf0) | ((A) >> 4))

◆ PACK_COLOR_4444_REV

#define PACK_COLOR_4444_REV (   R,
  G,
  B,
  A 
)    ((((B) & 0xf0) << 8) | (((A) & 0xf0) << 4) | ((R) & 0xf0) | ((G) >> 4))

Definition at line 98 of file colormac.h.

Referenced by _mesa_texstore_argb4444().

◆ PACK_COLOR_5551

#define PACK_COLOR_5551 (   R,
  G,
  B,
  A 
)
Value:
((((R) & 0xf8) << 8) | (((G) & 0xf8) << 3) | (((B) & 0xf8) >> 2) | \
((A) >> 7))
#define R(b, x)
Definition: sha2.c:134
#define B(row, col)
Definition: m_matrix.c:146
Definition: ttei1.cpp:12
#define G(x, y, z)
Definition: md5.c:52

Definition at line 75 of file colormac.h.

Referenced by _mesa_texstore_rgba5551(), and pack_ubyte_RGBA5551().

◆ PACK_COLOR_565

#define PACK_COLOR_565 (   X,
  Y,
  Z 
)    ((((X) & 0xf8) << 8) | (((Y) & 0xfc) << 3) | (((Z) & 0xf8) >> 3))

Definition at line 69 of file colormac.h.

Referenced by _mesa_texstore_rgb565(), and pack_ubyte_RGB565().

◆ PACK_COLOR_565_REV

#define PACK_COLOR_565_REV (   X,
  Y,
  Z 
)    (((X) & 0xf8) | ((Y) & 0xe0) >> 5 | (((Y) & 0x1c) << 11) | (((Z) & 0xf8) << 5))

Definition at line 72 of file colormac.h.

Referenced by _mesa_texstore_rgb565(), pack_float_RGB565_REV(), and pack_ubyte_RGB565_REV().

◆ PACK_COLOR_88

#define PACK_COLOR_88 (   L,
  A 
)    (((L) << 8) | (A))

Definition at line 104 of file colormac.h.

Referenced by _mesa_texstore_unorm88(), pack_ubyte_AL88(), and pack_ubyte_AL88_REV().

◆ PACK_COLOR_888

#define PACK_COLOR_888 (   X,
  Y,
  Z 
)    (((X) << 16) | ((Y) << 8) | (Z))

Definition at line 66 of file colormac.h.

◆ PACK_COLOR_8888

◆ PACK_COLOR_8888_REV

#define PACK_COLOR_8888_REV (   X,
  Y,
  Z,
  W 
)    (((W) << 24) | ((Z) << 16) | ((Y) << 8) | (X))

Definition at line 63 of file colormac.h.

Referenced by _mesa_texstore_argb8888(), and _mesa_texstore_rgba8888().

◆ PACK_COLOR_88_REV

#define PACK_COLOR_88_REV (   L,
  A 
)    (((A) << 8) | (L))

Definition at line 107 of file colormac.h.

Referenced by _mesa_texstore_unorm88().

Function Documentation

◆ _mesa_unclamped_float_rgba_to_ubyte()

static void _mesa_unclamped_float_rgba_to_ubyte ( GLubyte  dst[4],
const GLfloat  src[4] 
)
inlinestatic