ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

colormac.h File Reference
#include "imports.h"
#include "config.h"
#include "macros.h"

Go to the source code of this file.

Defines

#define BYTE_TO_CHAN(b)   ((b) < 0 ? 0 : (GLchan) (b))
#define UBYTE_TO_CHAN(b)   (b)
#define SHORT_TO_CHAN(s)   ((s) < 0 ? 0 : (GLchan) ((s) >> 7))
#define USHORT_TO_CHAN(s)   ((GLchan) ((s) >> 8))
#define INT_TO_CHAN(i)   ((i) < 0 ? 0 : (GLchan) ((i) >> 23))
#define UINT_TO_CHAN(i)   ((GLchan) ((i) >> 24))
#define CHAN_TO_UBYTE(c)   (c)
#define CHAN_TO_FLOAT(c)   UBYTE_TO_FLOAT(c)
#define CLAMPED_FLOAT_TO_CHAN(c, f)   CLAMPED_FLOAT_TO_UBYTE(c, f)
#define UNCLAMPED_FLOAT_TO_CHAN(c, f)   UNCLAMPED_FLOAT_TO_UBYTE(c, f)
#define COPY_CHAN4(DST, SRC)   COPY_4UBV(DST, SRC)
#define CHAN_PRODUCT(a, b)   ((GLubyte) (((GLint)(a) * ((GLint)(b) + 1)) >> 8))
#define UNCLAMPED_FLOAT_TO_RGB_CHAN(dst, f)
#define UNCLAMPED_FLOAT_TO_RGBA_CHAN(dst, f)
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_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_88(L, A)   (((L) << 8) | (A))
#define PACK_COLOR_88_REV(L, A)   (((A) << 8) | (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))

Detailed Description

Color-related macros

Definition in file colormac.h.


Generated on Sat May 26 2012 04:56:13 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.