mi32/cpuext.h File Reference

#include <mi32/stddefns.h>
#include <stddef.h>
Include dependency graph for cpuext.h:

Go to the source code of this file.

Defines

#define amemcpy   memcpy
#define CPUEXT_3DNOW   0x00010000
#define CPUEXT_3DNOWEX   0x00020000
#define CPUEXT_AMDMMX   0x00040000
#define CPUEXT_CMOV   0x00000010
#define CPUEXT_MMX   0x00000001
#define CPUEXT_PREFETCHNTA   0x00000004
#define CPUEXT_SIMD   0x00000002
#define CPUEXT_SSE   0x00000002
#define CPUEXT_SSE2   0x00000008
#define CPUEXT_TSC   0x00000020
#define GetCPUExtension()   (0)
#define HasMMX()   (GetCPUExtension() & CPUEXT_MMX)
#define LIBEXPORT   MI_DLLIMPORT

Functions

void AlphaBlend24 (UINT8 *dest, const UINT8 *src, UINT8 alpha, int n)
void AlphaBlend32 (UINT32 *dest, const UINT32 *src, UINT8 alpha, int n)
void AlphaBlendColor24 (UINT8 *dest, UINT8 r, UINT8 g, UINT8 b, UINT8 alpha, int n)
void AlphaBlendColor32 (UINT32 *dest, UINT32 pix, UINT8 alpha, int n)
void AlphaBlendColor32ABGR (UINT32 *dest, UINT32 pix, int n)
void AlphaBlendColor32RGBA (UINT32 *dest, UINT32 pix, int n)
void AlphaBlendVarAlpha24 (UINT8 *dest, const UINT8 *src, const UINT8 *alpha, int n)
void AlphaBlendVarAlpha32 (UINT32 *dest, const UINT32 *src, const UINT8 *alpha, int n)

Define Documentation

#define amemcpy   memcpy

Intel.

#define CPUEXT_3DNOW   0x00010000

AMD 3DNow.

#define CPUEXT_3DNOWEX   0x00020000

AMD 3DNow extensions.

#define CPUEXT_AMDMMX   0x00040000

AMD's MMX extensions.

#define CPUEXT_CMOV   0x00000010
#define CPUEXT_MMX   0x00000001

Basic MMX support.

#define CPUEXT_PREFETCHNTA   0x00000004

Intel cashability instructions.

#define CPUEXT_SIMD   0x00000002

Old name for SSE.

#define CPUEXT_SSE   0x00000002

Old name for SSE.

#define CPUEXT_SSE2   0x00000008
#define CPUEXT_TSC   0x00000020
 
#define GetCPUExtension (  )     (0)

< Not a chance!

 
#define HasMMX (  )     (GetCPUExtension() & CPUEXT_MMX)
#define LIBEXPORT   MI_DLLIMPORT

Function Documentation

void AlphaBlend24 ( UINT8 dest,
const UINT8 src,
UINT8  alpha,
int  n 
)

< End of fake functions

Do alpha blending of a source buffer into a dest buffer. This version is for 24-bit source onto 24-bit dest. n is number of pixels. alpha is in the range 0-255 (although the extremes are rather pointless, as 0 would leave the dest untouched and 255 is an expensive way to do a memcpy)

On platforms where it's possible, this function checks for the availability of MMX and uses it if it's there

void AlphaBlend32 ( UINT32 dest,
const UINT32 src,
UINT8  alpha,
int  n 
)

Do alpha blending of a source buffer into a dest buffer.

This version is for 32-bit source onto 32-bit dest. n is number of pixels. alpha is in the range 0-255 (although the extremes are rather pointless, as 0 would leave the dest untouched and 255 is an expensive way to do a memcpy)

This version assumes a constant alpha. Note that all 4 color componants are blended because it's faster to do that (4 bytes at a time) than doing 3 individual componants and skipping the 4th. It also means this function doesn't have to care what the RGB order is and which byte to skip.

On platforms where it's possible, this function checks for the availability of MMX and uses it if it's there

void AlphaBlendColor24 ( UINT8 dest,
UINT8  r,
UINT8  g,
UINT8  b,
UINT8  alpha,
int  n 
)

Do alpha blending of a solid color onto a destination buffer.

The color is broken up into 3 componants because the places where this will be the most useful, we already have them like this. implemented in aalphab.c Dest is assumed to be 24-bit RGB data. If it's really BGR, pass your color componants backwards.

On platforms where it's possible, this function checks for the availability of MMX and uses it if it's there

void AlphaBlendColor32 ( UINT32 dest,
UINT32  pix,
UINT8  alpha,
int  n 
)

Do alpha blending of a solid color onto a destination buffer.

implemented in aalphab.c

Note that all 4 color componants are blended because it's faster to do that (4 bytes at a time) than doing 3 individual componants and skipping the 4th. It also means this function doesn't have to care what the RGB order is and which byte to skip.

On platforms where it's possible, this function checks for the availability of MMX and uses it if it's there

void AlphaBlendColor32ABGR ( UINT32 dest,
UINT32  pix,
int  n 
)

Do alpha blending of a solid color onto a destination buffer.

implemented in aalphab.c

This is similar to AlphaBlendColor24() but the dest buffer is assumed to be made up of 32-bit pixels in which the highet 8 bits are "alpha". Note that this is not based on the order of the bytes in the buffer, but on bits in a 32-bit integer. It will work for 0xAABBGGRR or 0xAARRGGBB. Also note that for this one, the "alpha" value is part of the pixel passed in.

void AlphaBlendColor32RGBA ( UINT32 dest,
UINT32  pix,
int  n 
)

Do alpha blending of a solid color onto a destination buffer.

implemented in aalphab.c

This is similar to AlphaBlendColor24() but the dest buffer is assumed to be made up of 32-bit pixels in which the lowest 8 bits are "alpha". Note that this is not based on the order of the bytes in the buffer, but on bits in a 32-bit integer. It will work for 0xRRGGBBAA or 0xBBGGRRAA. Also note that for this one, the "alpha" value is part of the pixel passed in.

void AlphaBlendVarAlpha24 ( UINT8 dest,
const UINT8 src,
const UINT8 alpha,
int  n 
)

Do alpha blending of a source buffer into a dest buffer.

This version is for 24-bit source onto 24-bit dest. n is number of pixels. alpha is in the range 0-255

On platforms where it's possible, this function checks for the availability of MMX and uses it if it's there

Parameters:
alpha Alphas for each pixel.
void AlphaBlendVarAlpha32 ( UINT32 dest,
const UINT32 src,
const UINT8 alpha,
int  n 
)

Do alpha blending of a source buffer into a dest buffer.

This version is for 32-bit source onto 32-bit dest. n is number of pixels. alpha is in the range 0-255

Note that all 4 color componants are blended because it's faster to do that (4 bytes at a time) than doing 3 individual componants and skipping the 4th. It also means this function doesn't have to care what the RGB order is and which byte to skip.

On platforms where it's possible, this function checks for the availability of MMX and uses it if it's there


Generated on Sun Oct 7 21:25:54 2012 for TNTsdk 2012 by  doxygen 1.6.1