XFcPixelConverter.h File Reference

Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members

# XFcPixelConverter.h File Reference

Pixel format conversion functions/macros. More...

## Compounds

class | XFcPixelConverter

## Defines

#define | XFCPC_565_TO_X888(srccolor) ((((srccolor) & 0x001f) << 3) | (((srccolor) & 0x001c) >> 2) | (((srccolor) & 0x07e0) << 5) | (((srccolor) & 0x0600) >> 1) | (((srccolor) & 0xf800) << 8) | (((srccolor) & 0xe000) << 3))
| Converts from 16bit 5:6:5 to 32bit x:8:8:8 format.
#define | XFCPC_565_TO_1555(srccolor) ((((srccolor) & 0x001f)) | (((srccolor) & 0x07c0) >> 1) | (((srccolor) & 0xf800) >> 1) | 0x8000)
| Converts from 16bit 5:6:5 to 16bit 1:5:5:5 format.
#define | XFCPC_565_TO_8888(srccolor) ((((srccolor) & 0x001f) << 3) | (((srccolor) & 0x001c) >> 2) | (((srccolor) & 0x07e0) << 5) | (((srccolor) & 0x0600) >> 1) | (((srccolor) & 0xf800) << 8) | (((srccolor) & 0xe000) << 3) | 0xff000000)
| Converts from 16bit 5:6:5 to 32bit 8:8:8:8 format.
#define | XFCPC_565_TO_X6X5X5(srccolor) ((((srccolor) & 0x07e0) << 16) | (((srccolor) & 0xf81f)))
| Converts from 16bit 5:6:5 to 32bit x:6:x:5:x:5 format.
#define | XFCPC_565_TO_1X5X5X5(srccolor) ((((srccolor) & 0x001f)) | (((srccolor) & 0x07c0) << 15) | (((srccolor) & 0xf800) >> 1) | 0x80000000)
| Converts from 16bit 5:6:5 to 32bit 1:x:5:x:5:x:5 format.
#define | XFCPC_565_TO_55X5(srccolor) (srccolor & 0xffdf)
| Converts from 16bit 5:6:5 to 16bit 5:5:x:5 format.
#define | XFCPC_565_TO_5515(srccolor) ((((srccolor) & 0x001f)) | (((srccolor) & 0x07c0)) | (((srccolor) & 0xf800)) | 0x20)
| Converts from 16bit 5:6:5 to 16bit 5:5:1:5 format.
#define | XFCPC_565_TO_PREMUL8888(srccolor) ((((srccolor) & 0x001f) << 3) | (((srccolor) & 0x001c) >> 2) | (((srccolor) & 0x07e0) << 5) | (((srccolor) & 0x0600) >> 1) | (((srccolor) & 0xf800) << 8) | (((srccolor) & 0xe000) << 3) | 0xff000000)
| Converts from 16bit 5:6:5 to 32bit premultiplied 8:8:8:8 format.
#define | XFCPC_X888_TO_565(srccolor) ((((srccolor) & 0x0000f8) >> 3) | (((srccolor) & 0x00fc00) >> 5) | (((srccolor) & 0xf80000) >> 8))
| Converts from 32bit x:8:8:8 to 16bit 5:6:5 format.
#define | XFCPC_X888_TO_1555(srccolor) ((((srccolor) & 0x000000f8) >> 3) | (((srccolor) & 0x0000f800) >> 6) | (((srccolor) & 0x00f80000) >> 9) | 0x8000)
| Converts from 32bit x:8:8:8 to 16bit 1:5:5:5 format.
#define | XFCPC_X888_TO_8888(srccolor) (((srccolor) | 0xff000000))
| Converts from 32bit x:8:8:8 to 32bit 8:8:8:8 format.
#define | XFCPC_X888_TO_X6X5X5(srccolor) ((((srccolor) & 0x0000f8) >> 3) | (((srccolor) & 0x00fc00) << 11) | (((srccolor) & 0xf80000) >> 8))
| Converts from 32bit x:8:8:8 to 32bit x:6:x:5:x:5 format.
#define | XFCPC_X888_TO_1X5X5X5(srccolor) ((((srccolor) & 0x000000f8) >> 3) | (((srccolor) & 0x0000f800) << 10) | (((srccolor) & 0x00f80000) >> 9) | ((0x80000000)))
| Converts from 32bit 8:8:8:8 to 32bit 1:x:5:x:5:x:5 format.
#define | XFCPC_X888_TO_55X5(srccolor) ((((srccolor) & 0x0000f8) >> 3) | (((srccolor) & 0x00f800) >> 5) | (((srccolor) & 0xf80000) >> 8))
| Converts from 32bit x:8:8:8 to 16bit 5:5:x:5 format.
#define | XFCPC_X888_TO_5515(srccolor) ((((srccolor) & 0x000000f8) >> 3) | (((srccolor) & 0x0000f800) >> 5) | (((srccolor) & 0x00f80000) >> 8) | 0x20)
| Converts from 32bit x:8:8:8 to 16bit 5:5:1:5 format.
#define | XFCPC_X888_TO_PREMUL8888(srccolor) (((srccolor) | 0xff000000))
| Converts from 32bit x:8:8:8 to 32bit premultiplied 8:8:8:8 format.
#define | XFCPC_1555_TO_565(srccolor) ((((srccolor) & 0x001f)) | (((srccolor) & 0x03e0) << 1) | (((srccolor) & 0x0200) >> 4) | (((srccolor) & 0x7c00) << 1))
| Converts from 16bit 1:5:5:5 to 16bit 5:6:5 format.
#define | XFCPC_1555_TO_X888(srccolor) ((((srccolor) & 0x001f) << 3) | (((srccolor) & 0x001c) >> 2) | (((srccolor) & 0x03e0) << 6) | (((srccolor) & 0x0380) << 1) | (((srccolor) & 0x7c00) << 9) | (((srccolor) & 0x7000) << 4))
| Converts from 16bit 1:5:5:5 to 32bit x:8:8:8 format.
#define | XFCPC_1555_TO_8888(srccolor) ((((srccolor) & 0x001f) << 3) | (((srccolor) & 0x001c) >> 2) | (((srccolor) & 0x03e0) << 6) | (((srccolor) & 0x0380) << 1) | (((srccolor) & 0x7c00) << 9) | (((srccolor) & 0x7000) << 4) | ((srccolor & 0x8000) ? 0xff000000 : 0))
| Converts from 16bit 1:5:5:5 to 32bit 8:8:8:8 format.
#define | XFCPC_1555_TO_X6X5X5(srccolor) ((((srccolor) & 0x0000001f)) | (((srccolor) & 0x000003e0) << 17) | (((srccolor) & 0x00000200) << 12) | (((srccolor) & 0x00007c00) << 1))
| Converts from 16bit 1:5:5:5 to 32bit x:5:x:6:x:5 format.
#define | XFCPC_1555_TO_1X5X5X5(srccolor) ((((srccolor) & 0x7c1f)) | (((srccolor) & 0x83e0) << 16))
| Converts from 16bit 1:5:5:5 to 32bit 1:x:5:x:5:x:5 format.
#define | XFCPC_1555_TO_55X5(srccolor) ((((srccolor) & 0x001f)) | (((srccolor) & 0x7fe0) << 1))
| Converts from 16bit 1:5:5:5 to 16bit 5:5:x:5 format.
#define | XFCPC_1555_TO_5515(srccolor) ((((srccolor) & 0x001f)) | (((srccolor) & 0x7fe0) << 1) | (((srccolor) & 0x8000) >> 10))
| Converts from 16bit 1:5:5:5 to 16bit 5:5:1:5 format.
#define | XFCPC_1555_TO_PREMUL8888(srccolor) (((srccolor) & 0x8000) ? ((((srccolor) & 0x001f) << 3) | (((srccolor) & 0x001c) >> 2) | (((srccolor) & 0x03e0) << 6) | (((srccolor) & 0x0380) << 1) | (((srccolor) & 0x7c00) << 9) | (((srccolor) & 0x7000) << 4) | 0xff000000) : 0)
| Converts from 16bit 1:5:5:5 to 32bit premultiplied 8:8:8:8 format.
#define | XFCPC_8888_TO_X888(srccolor) (((srccolor) & 0x00ffffff))
| Converts from 32bit 8:8:8:8 to 32bit x:8:8:8 format.
#define | XFCPC_8888_TO_1555(srccolor) ((((srccolor) & 0x000000f8) >> 3) | (((srccolor) & 0x0000f800) >> 6) | (((srccolor) & 0x00f80000) >> 9) | (((srccolor) & 0x80000000) >> 16))
| Converts from 32bit 8:8:8:8 to 16bit 1:5:5:5 format.
#define | XFCPC_8888_TO_1X5X5X5(srccolor) ((((srccolor) & 0x000000f8) >> 3) | (((srccolor) & 0x0000f800) << 10) | (((srccolor) & 0x00f80000) >> 9) | (((srccolor) & 0x80000000)))
| Converts from 32bit 8:8:8:8 to 32bit 1:x:5:x:5:x:5 format.
#define | XFCPC_8888_TO_5515(srccolor) ((((srccolor) & 0x000000f8) >> 3) | (((srccolor) & 0x0000f800) >> 5) | (((srccolor) & 0x00f80000) >> 8) | (((srccolor) & 0x80000000) >> 26))
| Converts from 32bit 8:8:8:8 to 16bit 5:5:1:5 format.
#define | XFCPC_8888_TO_PREMUL8888(srccolor, resultcolor)
| Converts from 32bit 8:8:8:8 to 32bit premultipled x:8:8:8 format.
#define | XFCPC_X6X5X5_TO_565(srccolor) ((((srccolor) & 0x07e00000) >> 16) | (((srccolor) & 0x0000f81f)))
| Converts from 32bit x:6:x:5:x:5 to 16bit 5:6:5 format.
#define | XFCPC_X6X5X5_TO_X888(srccolor) ((((srccolor) & 0x0000001f) << 3) | (((srccolor) & 0x0000001c) >> 2) | (((srccolor) & 0x07e00000) >> 11) | (((srccolor) & 0x06000000) >> 17) | (((srccolor) & 0x0000f800) << 8) | (((srccolor) & 0x0000e000) << 3))
| Converts from 32bit x:6:x:5:x:5 to 32bit x:8:8:8 format.
#define | XFCPC_X6X5X5_TO_1555(srccolor) ((((srccolor) & 0x0000001f)) | (((srccolor) & 0x07c00000) >> 17) | (((srccolor) & 0x0000f800) >> 1) | 0x8000)
| Converts from 32bit x:6:x:5:x:5 to 16bit 1:5:5:5 format.
#define | XFCPC_X6X5X5_TO_8888(srccolor) ((((srccolor) & 0x0000001f) << 3) | (((srccolor) & 0x07e00000) >> 11) | (((srccolor) & 0x0000f800) << 8) | 0xff000000)
| Converts from 32bit x:6:x:5:x:5 to 32bit 8:8:8:8 format.
#define | XFCPC_X6X5X5_TO_1X5X5X5(srccolor) ((((srccolor) & 0x0000001f)) | (((srccolor) & 0x07e00000) >> 1) | (((srccolor) & 0x00007c00) >> 1) | 0x8000)
| Converts from 32bit x:6:x:5:x:5 to 32bit 1:x:5:x:5:x:5 format.
#define | XFCPC_X6X5X5_TO_55X5(srccolor) ((((srccolor) & 0x07c00000) >> 16) | (((srccolor) & 0x0000f81f)))
| Converts from 32bit x:6:x:5:x:5 to 16bit 5:5:x:5 format.
#define | XFCPC_X6X5X5_TO_5515(srccolor) ((((srccolor) & 0x0000001f)) | (((srccolor) & 0x07c00000) >> 16) | (((srccolor) & 0x0000f800)) | 0x20)
| Converts from 32bit x:6:x:5:x:5 to 16bit 1:5:5:5 format.
#define | XFCPC_X6X5X5_TO_PREMUL8888(srccolor) ((((srccolor) & 0x0000001f) << 3) | (((srccolor) & 0x07e00000) >> 11) | (((srccolor) & 0x0000f800) << 8) | 0xff000000)
| Converts from 32bit x:6:x:5:x:5 to 32bit premultiplied 8:8:8:8 format.
#define | XFCPC_1X5X5X5_TO_565(srccolor) ((((srccolor) & 0x0000001f)) | (((srccolor) & 0x03e00000) >> 15) | (((srccolor) & 0x02000000) >> 21) | (((srccolor) & 0x00007c00) << 1))
| Converts from 32bit 1:x:5:x:5:x:5 to 16bit 5:6:5 format.
#define | XFCPC_1X5X5X5_TO_X888(srccolor) ((((srccolor) & 0x0000001f) << 3) | (((srccolor) & 0x0000001c) >> 2) | (((srccolor) & 0x03e00000) >> 10) | (((srccolor) & 0x03800000) >> 15) | (((srccolor) & 0x00007c00) << 9) | (((srccolor) & 0x00007000) << 4))
| Converts from 32bit 1:x:5:x:5:x:5 to 32bit x:8:8:8 format.
#define | XFCPC_1X5X5X5_TO_1555(srccolor) ((((srccolor) & 0x00007c1f)) | (((srccolor) & 0x83e00000) >> 16))
| Converts from 32bit 1:x:5:x:5:x:5 to 16bit 1:5:5:5 format.
#define | XFCPC_1X5X5X5_TO_8888(srccolor) ((((srccolor) & 0x0000001f) << 3) | (((srccolor) & 0x0000001c) >> 2) | (((srccolor) & 0x03e00000) >> 10) | (((srccolor) & 0x03800000) >> 15) | (((srccolor) & 0x00007c00) << 9) | (((srccolor) & 0x00007000) << 4) | (((srccolor) & 0x80000000) ? 0xff000000 : 0))
| Converts from 32bit 1:x:5:x:5:x:5 to 32bit 8:8:8:8 format.
#define | XFCPC_1X5X5X5_TO_X6X5X5(srccolor) ((((srccolor) & 0x0000001f)) | (((srccolor) & 0x03e00000) << 1) | (((srccolor) & 0x02000000) >> 4) | (((srccolor) & 0x00007c00) << 1))
| Converts from 32bit 1:x:5:x:5:x:5 to 32bit x:6:x:5:x:5 format.
#define | XFCPC_1X5X5X5_TO_55X5(srccolor) ((((srccolor) & 0x0000001f)) | (((srccolor) & 0x03e00000) >> 15) | (((srccolor) & 0x00007c00) << 1))
| Converts from 32bit 1:x:5:x:5:x:5 to 16bit 5:5:x:5 format.
#define | XFCPC_1X5X5X5_TO_5515(srccolor) ((((srccolor) & 0x07c00000) >> 16) | (((srccolor) & 0xf81f)) | (((srccolor) & 0x80000000) >> 26));
| Converts from 16bit 1:x:5:x:5:x:5 to 32bit 5:5:1:5 format.
#define | XFCPC_1X5X5X5_TO_PREMUL8888(srccolor) (((srccolor) & 0x80000000) ? ((((srccolor) & 0x0000001f) << 3) | (((srccolor) & 0x0000001c) >> 2) | (((srccolor) & 0x03e00000) >> 10) | (((srccolor) & 0x03800000) >> 15) | (((srccolor) & 0x00007c00) << 9) | (((srccolor) & 0x00007000) << 4) | 0xff000000) : 0)
| Converts from 32bit 1:x:5:x:5:x:5 to 32bit premultiplied 8:8:8:8 format.
#define | XFCPC_55X5_TO_565(srccolor) (srccolor | (((srccolor) & 0x0400) >> 5))
| Converts from 16bit 5:5:x:5 to 16bit 5:6:5 format.
#define | XFCPC_55X5_TO_X888(srccolor) ((((srccolor) & 0x001f) << 3) | (((srccolor) & 0x001c) >> 2) | (((srccolor) & 0x07c0) << 5) | ((srccolor) & 0x0700) | (((srccolor) & 0xf800) << 8) | (((srccolor) & 0xe000) << 3))
| Converts from 16bit 5:5:x:5 to 32bit x:8:8:8 format.
#define | XFCPC_55X5_TO_1555(srccolor) ((((srccolor) & 0x001f)) | (((srccolor) & 0x07c0) >> 1) | (((srccolor) & 0xf800) >> 1) | 0x8000)
| Converts from 16bit 5:5:x:5 to 16bit 1:5:5:5 format.
#define | XFCPC_55X5_TO_8888(srccolor) ((((srccolor) & 0x001f) << 3) | (((srccolor) & 0x001c) >> 2) | (((srccolor) & 0x07c0) << 5) | ((srccolor) & 0x0700) | (((srccolor) & 0xf800) << 8) | (((srccolor) & 0xe000) << 3) | 0xff000000)
| Converts from 16bit 5:5:x:5 to 32bit 8:8:8:8 format.
#define | XFCPC_55X5_TO_X6X5X5(srccolor) ((((srccolor) & 0x07c0) << 16) | (((srccolor) & 0x0400) << 11) | (((srccolor) & 0xf81f)))
| Converts from 16bit 5:5:x:5 to 32bit x:6:x:5:x:5 format.
#define | XFCPC_55X5_TO_1X5X5X5(srccolor) ((((srccolor) & 0x001f)) | (((srccolor) & 0x07c0) << 15) | (((srccolor) & 0xf800) >> 1) | 0x80000000)
| Converts from 16bit 5:5:x:5 to 32bit 1:x:5:x:5:x:5 format.
#define | XFCPC_55X5_TO_5515(srccolor) (srccolor | 0x20)
| Converts from 16bit 5:5:x:5 to 16bit 5:5:1:5 format.
#define | XFCPC_55X5_TO_PREMUL8888(srccolor) ((((srccolor) & 0x001f) << 3) | (((srccolor) & 0x001c) >> 2) | (((srccolor) & 0x07c0) << 5) | ((srccolor) & 0x0700) | (((srccolor) & 0xf800) << 8) | (((srccolor) & 0xe000) << 3) | 0xff000000)
| Converts from 16bit 5:5:x:5 to 32bit premultiplied 8:8:8:8 format.
#define | XFCPC_5515_TO_565(srccolor) (((srccolor) & 0xffdf) | (((srccolor) & 0x400) >> 5))
| Converts from 16bit 5:5:1:5 to 16bit 5:6:5 format.
#define | XFCPC_5515_TO_X888(srccolor) ((((srccolor) & 0x001f) << 3) | (((srccolor) & 0x001c) >> 2) | (((srccolor) & 0x07c0) << 5) | (((srccolor) & 0x0700)) | (((srccolor) & 0xf800) << 8) | (((srccolor) & 0xe000) << 3))
| Converts from 16bit 5:5:1:5 to 32bit x:8:8:8 format.
#define | XFCPC_5515_TO_1555(srccolor) (((srccolor) & 0x001f) | (((srccolor) & 0x20) << 10) | (((srccolor) & 0xffc0) >> 1))
| Converts from 16bit 5:5:1:5 to 16bit 1:5:5:5 format.
#define | XFCPC_5515_TO_8888(srccolor) ((((srccolor) & 0x001f) << 3) | (((srccolor) & 0x001c) >> 2) | (((srccolor) & 0x07c0) << 5) | (((srccolor) & 0x0700)) | (((srccolor) & 0xf800) << 8) | (((srccolor) & 0xe000) << 3) | ((srccolor & 0x20) ? 0xff000000 : 0))
| Converts from 16bit 5:5:1:5 to 32bit 8:8:8:8 format.
#define | XFCPC_5515_TO_X6X5X5(srccolor) ((((srccolor) & 0x0000f81f)) | (((srccolor) & 0x000007c0) << 16) | (((srccolor) & 0x00000400) << 11))
| Converts from 16bit 5:5:1:5 to 32bit x:5:x:6:x:5 format.
#define | XFCPC_5515_TO_1X5X5X5(srccolor) ((((srccolor) & 0x07c0) << 16) | (((srccolor) & 0xf81f)) | (((srccolor) & 0x0020) << 26));
| Converts from 16bit 1:5:5:5 to 32bit 1:x:5:x:5:x:5 format.
#define | XFCPC_5515_TO_55X5(srccolor) (srccolor & 0xffdf)
| Converts from 16bit 5:5:1:5 to 16bit 5:5:x:5 format.
#define | XFCPC_5515_TO_PREMUL8888(srccolor) (((srccolor) & 0x20) ? ((((srccolor) & 0x001f) << 3) | (((srccolor) & 0x001c) >> 2) | (((srccolor) & 0x07c0) << 5) | (((srccolor) & 0x0700)) | (((srccolor) & 0xf800) << 8) | (((srccolor) & 0xe000) << 3) | 0xff000000) : 0)
| Converts from 16bit 5:5:1:5 to 32bit premultiplied 8:8:8:8 format.
#define | XFCPC_PREMUL8888_TO_8888(srccolor, resultcolor)
| Converts from 32bit premultiplied 8:8:8:8 to 32bit 8:8:8:8 format.
#define | XFCPC_PREMUL8888_TO_8888_TABLELOOKUP(srccolor, resultcolor, invtable)
| Converts from 32bit premultiplied 8:8:8:8 to 32bit 8:8:8:8 format, using an inversion table instead of division.

## Typedefs

typedef UINT32(* | xfcPixelConversionFunction )(UINT32)
| Utility for pixel format conversions.
typedef void(* | xfcPixelBufferConversionFunction )(void *, void *, INT32)

## Detailed Description

Pixel format conversion functions/macros.

X-Forge Core
Copyright 2000-2003 Fathammer Ltd

Id
  XFcPixelConverter.h,v 1.24 2003/08/12 13:33:48 lars Exp

Date
  2003/08/12 13:33:48

Revision
  1.24

## Define Documentation

#define XFCPC_1555_TO_1X5X5X5 | ( | srccolor |  | ) | ((((srccolor) & 0x7c1f)) | (((srccolor) & 0x83e0) << 16))

| Converts from 16bit 1:5:5:5 to 32bit 1:x:5:x:5:x:5 format.

#define XFCPC_1555_TO_5515 | ( | srccolor |  | ) | ((((srccolor) & 0x001f)) | (((srccolor) & 0x7fe0) << 1) | (((srccolor) & 0x8000) >> 10))

| Converts from 16bit 1:5:5:5 to 16bit 5:5:1:5 format.

#define XFCPC_1555_TO_55X5 | ( | srccolor |  | ) | ((((srccolor) & 0x001f)) | (((srccolor) & 0x7fe0) << 1))

| Converts from 16bit 1:5:5:5 to 16bit 5:5:x:5 format.

#define XFCPC_1555_TO_565 | ( | srccolor |  | ) | ((((srccolor) & 0x001f)) | (((srccolor) & 0x03e0) << 1) | (((srccolor) & 0x0200) >> 4) | (((srccolor) & 0x7c00) << 1))

| Converts from 16bit 1:5:5:5 to 16bit 5:6:5 format.

#define XFCPC_1555_TO_8888 | ( | srccolor |  | ) | ((((srccolor) & 0x001f) << 3) | (((srccolor) & 0x001c) >> 2) | (((srccolor) & 0x03e0) << 6) | (((srccolor) & 0x0380) << 1) | (((srccolor) & 0x7c00) << 9) | (((srccolor) & 0x7000) << 4) | ((srccolor & 0x8000) ? 0xff000000 : 0))

| Converts from 16bit 1:5:5:5 to 32bit 8:8:8:8 format.

#define XFCPC_1555_TO_PREMUL8888 | ( | srccolor |  | ) | (((srccolor) & 0x8000) ? ((((srccolor) & 0x001f) << 3) | (((srccolor) & 0x001c) >> 2) | (((srccolor) & 0x03e0) << 6) | (((srccolor) & 0x0380) << 1) | (((srccolor) & 0x7c00) << 9) | (((srccolor) & 0x7000) << 4) | 0xff000000) : 0)

| Converts from 16bit 1:5:5:5 to 32bit premultiplied 8:8:8:8 format.

#define XFCPC_1555_TO_X6X5X5 | ( | srccolor |  | ) | ((((srccolor) & 0x0000001f)) | (((srccolor) & 0x000003e0) << 17) | (((srccolor) & 0x00000200) << 12) | (((srccolor) & 0x00007c00) << 1))

| Converts from 16bit 1:5:5:5 to 32bit x:5:x:6:x:5 format.

#define XFCPC_1555_TO_X888 | ( | srccolor |  | ) | ((((srccolor) & 0x001f) << 3) | (((srccolor) & 0x001c) >> 2) | (((srccolor) & 0x03e0) << 6) | (((srccolor) & 0x0380) << 1) | (((srccolor) & 0x7c00) << 9) | (((srccolor) & 0x7000) << 4))

| Converts from 16bit 1:5:5:5 to 32bit x:8:8:8 format.

#define XFCPC_1X5X5X5_TO_1555 | ( | srccolor |  | ) | ((((srccolor) & 0x00007c1f)) | (((srccolor) & 0x83e00000) >> 16))

| Converts from 32bit 1:x:5:x:5:x:5 to 16bit 1:5:5:5 format.

#define XFCPC_1X5X5X5_TO_5515 | ( | srccolor |  | ) | ((((srccolor) & 0x07c00000) >> 16) | (((srccolor) & 0xf81f)) | (((srccolor) & 0x80000000) >> 26));

| Converts from 16bit 1:x:5:x:5:x:5 to 32bit 5:5:1:5 format.

#define XFCPC_1X5X5X5_TO_55X5 | ( | srccolor |  | ) | ((((srccolor) & 0x0000001f)) | (((srccolor) & 0x03e00000) >> 15) | (((srccolor) & 0x00007c00) << 1))

| Converts from 32bit 1:x:5:x:5:x:5 to 16bit 5:5:x:5 format.

#define XFCPC_1X5X5X5_TO_565 | ( | srccolor |  | ) | ((((srccolor) & 0x0000001f)) | (((srccolor) & 0x03e00000) >> 15) | (((srccolor) & 0x02000000) >> 21) | (((srccolor) & 0x00007c00) << 1))

| Converts from 32bit 1:x:5:x:5:x:5 to 16bit 5:6:5 format.

#define XFCPC_1X5X5X5_TO_8888 | ( | srccolor |  | ) | ((((srccolor) & 0x0000001f) << 3) | (((srccolor) & 0x0000001c) >> 2) | (((srccolor) & 0x03e00000) >> 10) | (((srccolor) & 0x03800000) >> 15) | (((srccolor) & 0x00007c00) << 9) | (((srccolor) & 0x00007000) << 4) | (((srccolor) & 0x80000000) ? 0xff000000 : 0))

| Converts from 32bit 1:x:5:x:5:x:5 to 32bit 8:8:8:8 format.

#define XFCPC_1X5X5X5_TO_PREMUL8888 | ( | srccolor |  | ) | (((srccolor) & 0x80000000) ? ((((srccolor) & 0x0000001f) << 3) | (((srccolor) & 0x0000001c) >> 2) | (((srccolor) & 0x03e00000) >> 10) | (((srccolor) & 0x03800000) >> 15) | (((srccolor) & 0x00007c00) << 9) | (((srccolor) & 0x00007000) << 4) | 0xff000000) : 0)

| Converts from 32bit 1:x:5:x:5:x:5 to 32bit premultiplied 8:8:8:8 format.

#define XFCPC_1X5X5X5_TO_X6X5X5 | ( | srccolor |  | ) | ((((srccolor) & 0x0000001f)) | (((srccolor) & 0x03e00000) << 1) | (((srccolor) & 0x02000000) >> 4) | (((srccolor) & 0x00007c00) << 1))

| Converts from 32bit 1:x:5:x:5:x:5 to 32bit x:6:x:5:x:5 format.

#define XFCPC_1X5X5X5_TO_X888 | ( | srccolor |  | ) | ((((srccolor) & 0x0000001f) << 3) | (((srccolor) & 0x0000001c) >> 2) | (((srccolor) & 0x03e00000) >> 10) | (((srccolor) & 0x03800000) >> 15) | (((srccolor) & 0x00007c00) << 9) | (((srccolor) & 0x00007000) << 4))

| Converts from 32bit 1:x:5:x:5:x:5 to 32bit x:8:8:8 format.

#define XFCPC_5515_TO_1555 | ( | srccolor |  | ) | (((srccolor) & 0x001f) | (((srccolor) & 0x20) << 10) | (((srccolor) & 0xffc0) >> 1))

| Converts from 16bit 5:5:1:5 to 16bit 1:5:5:5 format.

#define XFCPC_5515_TO_1X5X5X5 | ( | srccolor |  | ) | ((((srccolor) & 0x07c0) << 16) | (((srccolor) & 0xf81f)) | (((srccolor) & 0x0020) << 26));

| Converts from 16bit 1:5:5:5 to 32bit 1:x:5:x:5:x:5 format.

#define XFCPC_5515_TO_55X5 | ( | srccolor |  | ) | (srccolor & 0xffdf)

| Converts from 16bit 5:5:1:5 to 16bit 5:5:x:5 format.

#define XFCPC_5515_TO_565 | ( | srccolor |  | ) | (((srccolor) & 0xffdf) | (((srccolor) & 0x400) >> 5))

| Converts from 16bit 5:5:1:5 to 16bit 5:6:5 format.

#define XFCPC_5515_TO_8888 | ( | srccolor |  | ) | ((((srccolor) & 0x001f) << 3) | (((srccolor) & 0x001c) >> 2) | (((srccolor) & 0x07c0) << 5) | (((srccolor) & 0x0700)) | (((srccolor) & 0xf800) << 8) | (((srccolor) & 0xe000) << 3) | ((srccolor & 0x20) ? 0xff000000 : 0))

| Converts from 16bit 5:5:1:5 to 32bit 8:8:8:8 format.

#define XFCPC_5515_TO_PREMUL8888 | ( | srccolor |  | ) | (((srccolor) & 0x20) ? ((((srccolor) & 0x001f) << 3) | (((srccolor) & 0x001c) >> 2) | (((srccolor) & 0x07c0) << 5) | (((srccolor) & 0x0700)) | (((srccolor) & 0xf800) << 8) | (((srccolor) & 0xe000) << 3) | 0xff000000) : 0)

| Converts from 16bit 5:5:1:5 to 32bit premultiplied 8:8:8:8 format.

#define XFCPC_5515_TO_X6X5X5 | ( | srccolor |  | ) | ((((srccolor) & 0x0000f81f)) | (((srccolor) & 0x000007c0) << 16) | (((srccolor) & 0x00000400) << 11))

| Converts from 16bit 5:5:1:5 to 32bit x:5:x:6:x:5 format.

#define XFCPC_5515_TO_X888 | ( | srccolor |  | ) | ((((srccolor) & 0x001f) << 3) | (((srccolor) & 0x001c) >> 2) | (((srccolor) & 0x07c0) << 5) | (((srccolor) & 0x0700)) | (((srccolor) & 0xf800) << 8) | (((srccolor) & 0xe000) << 3))

| Converts from 16bit 5:5:1:5 to 32bit x:8:8:8 format.

#define XFCPC_55X5_TO_1555 | ( | srccolor |  | ) | ((((srccolor) & 0x001f)) | (((srccolor) & 0x07c0) >> 1) | (((srccolor) & 0xf800) >> 1) | 0x8000)

| Converts from 16bit 5:5:x:5 to 16bit 1:5:5:5 format.

#define XFCPC_55X5_TO_1X5X5X5 | ( | srccolor |  | ) | ((((srccolor) & 0x001f)) | (((srccolor) & 0x07c0) << 15) | (((srccolor) & 0xf800) >> 1) | 0x80000000)

| Converts from 16bit 5:5:x:5 to 32bit 1:x:5:x:5:x:5 format.

#define XFCPC_55X5_TO_5515 | ( | srccolor |  | ) | (srccolor | 0x20)

| Converts from 16bit 5:5:x:5 to 16bit 5:5:1:5 format.

#define XFCPC_55X5_TO_565 | ( | srccolor |  | ) | (srccolor | (((srccolor) & 0x0400) >> 5))

| Converts from 16bit 5:5:x:5 to 16bit 5:6:5 format.

#define XFCPC_55X5_TO_8888 | ( | srccolor |  | ) | ((((srccolor) & 0x001f) << 3) | (((srccolor) & 0x001c) >> 2) | (((srccolor) & 0x07c0) << 5) | ((srccolor) & 0x0700) | (((srccolor) & 0xf800) << 8) | (((srccolor) & 0xe000) << 3) | 0xff000000)

| Converts from 16bit 5:5:x:5 to 32bit 8:8:8:8 format.

#define XFCPC_55X5_TO_PREMUL8888 | ( | srccolor |  | ) | ((((srccolor) & 0x001f) << 3) | (((srccolor) & 0x001c) >> 2) | (((srccolor) & 0x07c0) << 5) | ((srccolor) & 0x0700) | (((srccolor) & 0xf800) << 8) | (((srccolor) & 0xe000) << 3) | 0xff000000)

| Converts from 16bit 5:5:x:5 to 32bit premultiplied 8:8:8:8 format.

#define XFCPC_55X5_TO_X6X5X5 | ( | srccolor |  | ) | ((((srccolor) & 0x07c0) << 16) | (((srccolor) & 0x0400) << 11) | (((srccolor) & 0xf81f)))

| Converts from 16bit 5:5:x:5 to 32bit x:6:x:5:x:5 format.

#define XFCPC_55X5_TO_X888 | ( | srccolor |  | ) | ((((srccolor) & 0x001f) << 3) | (((srccolor) & 0x001c) >> 2) | (((srccolor) & 0x07c0) << 5) | ((srccolor) & 0x0700) | (((srccolor) & 0xf800) << 8) | (((srccolor) & 0xe000) << 3))

| Converts from 16bit 5:5:x:5 to 32bit x:8:8:8 format.

#define XFCPC_565_TO_1555 | ( | srccolor |  | ) | ((((srccolor) & 0x001f)) | (((srccolor) & 0x07c0) >> 1) | (((srccolor) & 0xf800) >> 1) | 0x8000)

| Converts from 16bit 5:6:5 to 16bit 1:5:5:5 format.

#define XFCPC_565_TO_1X5X5X5 | ( | srccolor |  | ) | ((((srccolor) & 0x001f)) | (((srccolor) & 0x07c0) << 15) | (((srccolor) & 0xf800) >> 1) | 0x80000000)

| Converts from 16bit 5:6:5 to 32bit 1:x:5:x:5:x:5 format.

#define XFCPC_565_TO_5515 | ( | srccolor |  | ) | ((((srccolor) & 0x001f)) | (((srccolor) & 0x07c0)) | (((srccolor) & 0xf800)) | 0x20)

| Converts from 16bit 5:6:5 to 16bit 5:5:1:5 format.

#define XFCPC_565_TO_55X5 | ( | srccolor |  | ) | (srccolor & 0xffdf)

| Converts from 16bit 5:6:5 to 16bit 5:5:x:5 format.

#define XFCPC_565_TO_8888 | ( | srccolor |  | ) | ((((srccolor) & 0x001f) << 3) | (((srccolor) & 0x001c) >> 2) | (((srccolor) & 0x07e0) << 5) | (((srccolor) & 0x0600) >> 1) | (((srccolor) & 0xf800) << 8) | (((srccolor) & 0xe000) << 3) | 0xff000000)

| Converts from 16bit 5:6:5 to 32bit 8:8:8:8 format.

#define XFCPC_565_TO_PREMUL8888 | ( | srccolor |  | ) | ((((srccolor) & 0x001f) << 3) | (((srccolor) & 0x001c) >> 2) | (((srccolor) & 0x07e0) << 5) | (((srccolor) & 0x0600) >> 1) | (((srccolor) & 0xf800) << 8) | (((srccolor) & 0xe000) << 3) | 0xff000000)

| Converts from 16bit 5:6:5 to 32bit premultiplied 8:8:8:8 format.

#define XFCPC_565_TO_X6X5X5 | ( | srccolor |  | ) | ((((srccolor) & 0x07e0) << 16) | (((srccolor) & 0xf81f)))

| Converts from 16bit 5:6:5 to 32bit x:6:x:5:x:5 format.

#define XFCPC_565_TO_X888 | ( | srccolor |  | ) | ((((srccolor) & 0x001f) << 3) | (((srccolor) & 0x001c) >> 2) | (((srccolor) & 0x07e0) << 5) | (((srccolor) & 0x0600) >> 1) | (((srccolor) & 0xf800) << 8) | (((srccolor) & 0xe000) << 3))

| Converts from 16bit 5:6:5 to 32bit x:8:8:8 format.

#define XFCPC_8888_TO_1555 | ( | srccolor |  | ) | ((((srccolor) & 0x000000f8) >> 3) | (((srccolor) & 0x0000f800) >> 6) | (((srccolor) & 0x00f80000) >> 9) | (((srccolor) & 0x80000000) >> 16))

| Converts from 32bit 8:8:8:8 to 16bit 1:5:5:5 format.

#define XFCPC_8888_TO_1X5X5X5 | ( | srccolor |  | ) | ((((srccolor) & 0x000000f8) >> 3) | (((srccolor) & 0x0000f800) << 10) | (((srccolor) & 0x00f80000) >> 9) | (((srccolor) & 0x80000000)))

| Converts from 32bit 8:8:8:8 to 32bit 1:x:5:x:5:x:5 format.

#define XFCPC_8888_TO_5515 | ( | srccolor |  | ) | ((((srccolor) & 0x000000f8) >> 3) | (((srccolor) & 0x0000f800) >> 5) | (((srccolor) & 0x00f80000) >> 8) | (((srccolor) & 0x80000000) >> 26))

| Converts from 32bit 8:8:8:8 to 16bit 5:5:1:5 format.

#define XFCPC_8888_TO_PREMUL8888 | ( | srccolor,
|  | resultcolor |  | ) |

Value:

    { \
        UINT32 __a = (srccolor) & 0xff000000; \
        UINT32 __alpha = __a >> 24; \
        UINT32 __rb = (srccolor) & 0x00ff00ff; \
        UINT32 __g = (srccolor) & 0x0000ff00; \
     \
        UINT32 __i = __alpha * __rb + ((128 << 16) + 128); \
        __rb = (( __i + ((__i >> 8) & 0x00ff00ff) ) >> 8) & 0x00ff00ff; \
     \
        __i = __alpha * __g + (128 << 8); \
        __g = (( __i + ((__i >> 8) & 0x0000ff00) ) >> 8) & 0x0000ff00; \
     \
        resultcolor = __a | __rb | __g; \
    }

Converts from 32bit 8:8:8:8 to 32bit premultipled x:8:8:8 format.

#define XFCPC_8888_TO_X888 | ( | srccolor |  | ) | (((srccolor) & 0x00ffffff))

| Converts from 32bit 8:8:8:8 to 32bit x:8:8:8 format.

#define XFCPC_PREMUL8888_TO_8888 | ( | srccolor,
|  | resultcolor |  | ) |

Value:

    { \
        UINT32 __a = srccolor & 0xff000000; \
     \
        if (__a == 0) \
            resultcolor = 0x00ffffff; \
        else if (__a == 0xff000000) \
            resultcolor = srccolor; \
        else \
        { \
            XFcFixed __invAlpha; \
            __invAlpha.mValue = 0xff0000; \
            __invAlpha = __invAlpha / (INT32)(__a >> 24); \
     \
            XFcFixed __r,__g,__b; \
            __r.mValue = (srccolor) & 0x00ff0000; \
            __g.mValue = ((srccolor) & 0x0000ff00) << 8; \
            __b.mValue = ((srccolor) & 0x000000ff) << 16; \
     \
            __r *= __invAlpha; \
            __g *= __invAlpha; \
            __b *= __invAlpha; \
     \
            resultcolor = __a | (__r.mValue & 0x00ff0000) | ((__g.mValue & 0x00ff0000) >> 8) | ((__b.mValue & 0x00ff0000) >> 16);\
        } \
     \
    }

Converts from 32bit premultiplied 8:8:8:8 to 32bit 8:8:8:8 format.

Conversions to other formats can be either done using XFCPC_8888_TO_* or XFCPC_X888_TO_* macros, or first converting to 8:8:8:8 format with this and then to correct target format.

#define XFCPC_PREMUL8888_TO_8888_TABLELOOKUP | ( | srccolor,
|  | resultcolor,
|  | invtable |  | ) |

Value:

    { \
        UINT32 __a = srccolor & 0xff000000; \
     \
        if (__a == 0) \
            resultcolor = 0x00ffffff; \
        else if (__a == 0xff000000) \
            resultcolor = srccolor; \
        else \
        { \
            XFcFixed __invAlpha; \
            __invAlpha = invtable[(INT32)(__a >> 24)]; \
     \
            XFcFixed __r,__g,__b; \
            __r.mValue = (srccolor) & 0x00ff0000; \
            __g.mValue = ((srccolor) & 0x0000ff00) << 8; \
            __b.mValue = ((srccolor) & 0x000000ff) << 16; \
     \
            __r *= __invAlpha; \
            __g *= __invAlpha; \
            __b *= __invAlpha; \
     \
            resultcolor = __a | (__r.mValue & 0x00ff0000) | ((__g.mValue & 0x00ff0000) >> 8) | ((__b.mValue & 0x00ff0000) >> 16);\
        } \
     \
    }

Converts from 32bit premultiplied 8:8:8:8 to 32bit 8:8:8:8 format, using an inversion table instead of division.

Inversion table should be a table of 256 XFcFixed's, defined as division between 255 and n (ranging from 0 to 255).

#define XFCPC_X6X5X5_TO_1555 | ( | srccolor |  | ) | ((((srccolor) & 0x0000001f)) | (((srccolor) & 0x07c00000) >> 17) | (((srccolor) & 0x0000f800) >> 1) | 0x8000)

| Converts from 32bit x:6:x:5:x:5 to 16bit 1:5:5:5 format.

#define XFCPC_X6X5X5_TO_1X5X5X5 | ( | srccolor |  | ) | ((((srccolor) & 0x0000001f)) | (((srccolor) & 0x07e00000) >> 1) | (((srccolor) & 0x00007c00) >> 1) | 0x8000)

| Converts from 32bit x:6:x:5:x:5 to 32bit 1:x:5:x:5:x:5 format.

#define XFCPC_X6X5X5_TO_5515 | ( | srccolor |  | ) | ((((srccolor) & 0x0000001f)) | (((srccolor) & 0x07c00000) >> 16) | (((srccolor) & 0x0000f800)) | 0x20)

| Converts from 32bit x:6:x:5:x:5 to 16bit 1:5:5:5 format.

#define XFCPC_X6X5X5_TO_55X5 | ( | srccolor |  | ) | ((((srccolor) & 0x07c00000) >> 16) | (((srccolor) & 0x0000f81f)))

| Converts from 32bit x:6:x:5:x:5 to 16bit 5:5:x:5 format.

#define XFCPC_X6X5X5_TO_565 | ( | srccolor |  | ) | ((((srccolor) & 0x07e00000) >> 16) | (((srccolor) & 0x0000f81f)))

| Converts from 32bit x:6:x:5:x:5 to 16bit 5:6:5 format.

#define XFCPC_X6X5X5_TO_8888 | ( | srccolor |  | ) | ((((srccolor) & 0x0000001f) << 3) | (((srccolor) & 0x07e00000) >> 11) | (((srccolor) & 0x0000f800) << 8) | 0xff000000)

| Converts from 32bit x:6:x:5:x:5 to 32bit 8:8:8:8 format.

#define XFCPC_X6X5X5_TO_PREMUL8888 | ( | srccolor |  | ) | ((((srccolor) & 0x0000001f) << 3) | (((srccolor) & 0x07e00000) >> 11) | (((srccolor) & 0x0000f800) << 8) | 0xff000000)

| Converts from 32bit x:6:x:5:x:5 to 32bit premultiplied 8:8:8:8 format.

#define XFCPC_X6X5X5_TO_X888 | ( | srccolor |  | ) | ((((srccolor) & 0x0000001f) << 3) | (((srccolor) & 0x0000001c) >> 2) | (((srccolor) & 0x07e00000) >> 11) | (((srccolor) & 0x06000000) >> 17) | (((srccolor) & 0x0000f800) << 8) | (((srccolor) & 0x0000e000) << 3))

| Converts from 32bit x:6:x:5:x:5 to 32bit x:8:8:8 format.

#define XFCPC_X888_TO_1555 | ( | srccolor |  | ) | ((((srccolor) & 0x000000f8) >> 3) | (((srccolor) & 0x0000f800) >> 6) | (((srccolor) & 0x00f80000) >> 9) | 0x8000)

| Converts from 32bit x:8:8:8 to 16bit 1:5:5:5 format.

#define XFCPC_X888_TO_1X5X5X5 | ( | srccolor |  | ) | ((((srccolor) & 0x000000f8) >> 3) | (((srccolor) & 0x0000f800) << 10) | (((srccolor) & 0x00f80000) >> 9) | ((0x80000000)))

| Converts from 32bit 8:8:8:8 to 32bit 1:x:5:x:5:x:5 format.

#define XFCPC_X888_TO_5515 | ( | srccolor |  | ) | ((((srccolor) & 0x000000f8) >> 3) | (((srccolor) & 0x0000f800) >> 5) | (((srccolor) & 0x00f80000) >> 8) | 0x20)

| Converts from 32bit x:8:8:8 to 16bit 5:5:1:5 format.

#define XFCPC_X888_TO_55X5 | ( | srccolor |  | ) | ((((srccolor) & 0x0000f8) >> 3) | (((srccolor) & 0x00f800) >> 5) | (((srccolor) & 0xf80000) >> 8))

| Converts from 32bit x:8:8:8 to 16bit 5:5:x:5 format.

#define XFCPC_X888_TO_565 | ( | srccolor |  | ) | ((((srccolor) & 0x0000f8) >> 3) | (((srccolor) & 0x00fc00) >> 5) | (((srccolor) & 0xf80000) >> 8))

| Converts from 32bit x:8:8:8 to 16bit 5:6:5 format.

#define XFCPC_X888_TO_8888 | ( | srccolor |  | ) | (((srccolor) | 0xff000000))

| Converts from 32bit x:8:8:8 to 32bit 8:8:8:8 format.

#define XFCPC_X888_TO_PREMUL8888 | ( | srccolor |  | ) | (((srccolor) | 0xff000000))

| Converts from 32bit x:8:8:8 to 32bit premultiplied 8:8:8:8 format.

#define XFCPC_X888_TO_X6X5X5 | ( | srccolor |  | ) | ((((srccolor) & 0x0000f8) >> 3) | (((srccolor) & 0x00fc00) << 11) | (((srccolor) & 0xf80000) >> 8))

| Converts from 32bit x:8:8:8 to 32bit x:6:x:5:x:5 format.

## Typedef Documentation

typedef void(* xfcPixelBufferConversionFunction)(void *, void *, INT32)

typedef UINT32(* xfcPixelConversionFunction)(UINT32)

Utility for pixel format conversions.

Due to the obvious overhead this is mostly for convenience class, and not meant for heavy realtime use.

Note:
  Pixel format conversions tend to cause loss of information, especially for the alpha values.

  Pixel format explanation:

              565 - 16bit r:g:b format
             55X5 - 16bit r:g:x:b format
             X888 - 32bit x:r:g:b format (alpha ignored)
           X6X5X5 - 32bit 565565 bit format that's handy for fast 16bit image manipulation (XGXRXB)

             8888 - 32bit a:r:g:b format
             1555 - 16bit a:r:g:b format
             5515 - 16bit r:g:a:b format
          1X5X5X5 - 32bit 1556555 bit format, same as above, but with alpha on topmost bit (AXGXRXB)
       Premul8888 - 32bit a:r:g:b format, color values are premultiplied with alpha

  See the XFCGFXFORMAT enumeration for graphics format constants.

See also:
  XFCGFXFORMAT

|  | X-Forge Documentation Confidential Copyright © 2002-2003 Fathammer |  | Documentation generated with doxygen by Dimitri van Heesch