Main Page | Alphabetical List | Compound List | File List | Compound Members | File Members

pixelformat.h File Reference

#include "basetype.h"

Go to the source code of this file.

Compounds

struct  gePixelFormat_Operations

Defines

#define GE_PIXELFORMAT_8BIT_PAL   GE_PIXELFORMAT_8BIT

Typedefs

typedef uint32(* gePixelFormat_Composer )(int R, int G, int B, int A)
typedef void(* gePixelFormat_Decomposer )(uint32 Pixel, int *R, int *G, int *B, int *A)
typedef void(* gePixelFormat_ColorGetter )(uint8 **ppData, int *R, int *G, int *B, int *A)
typedef void(* gePixelFormat_ColorPutter )(uint8 **ppData, int R, int G, int B, int A)
typedef uint32(* gePixelFormat_PixelGetter )(uint8 **ppData)
typedef void(* gePixelFormat_PixelPutter )(uint8 **ppData, uint32 Pixel)
typedef gePixelFormat_Operations gePixelFormat_Operations

Enumerations

enum  gePixelFormat {
  GE_PIXELFORMAT_NO_DATA = 0, GE_PIXELFORMAT_8BIT, GE_PIXELFORMAT_8BIT_GRAY, GE_PIXELFORMAT_16BIT_555_RGB,
  GE_PIXELFORMAT_16BIT_555_BGR, GE_PIXELFORMAT_16BIT_565_RGB, GE_PIXELFORMAT_16BIT_565_BGR, GE_PIXELFORMAT_16BIT_4444_ARGB,
  GE_PIXELFORMAT_16BIT_1555_ARGB, GE_PIXELFORMAT_24BIT_RGB, GE_PIXELFORMAT_24BIT_BGR, GE_PIXELFORMAT_24BIT_YUV,
  GE_PIXELFORMAT_32BIT_RGBX, GE_PIXELFORMAT_32BIT_XRGB, GE_PIXELFORMAT_32BIT_BGRX, GE_PIXELFORMAT_32BIT_XBGR,
  GE_PIXELFORMAT_32BIT_RGBA, GE_PIXELFORMAT_32BIT_ARGB, GE_PIXELFORMAT_32BIT_BGRA, GE_PIXELFORMAT_32BIT_ABGR,
  GE_PIXELFORMAT_WAVELET, GE_PIXELFORMAT_COUNT
}

Functions

GENESISAPI const gePixelFormat_Operations
*GENESISCC 
gePixelFormat_GetOperations (gePixelFormat Format)
GENESISAPI geBoolean GENESISCC gePixelFormat_IsValid (gePixelFormat Format)
GENESISAPI unsigned int GENESISCC gePixelFormat_BytesPerPel (gePixelFormat Format)
GENESISAPI geBoolean GENESISCC gePixelFormat_HasPalette (gePixelFormat Format)
GENESISAPI geBoolean GENESISCC gePixelFormat_HasAlpha (gePixelFormat Format)
GENESISAPI geBoolean GENESISCC gePixelFormat_HasGoodAlpha (gePixelFormat Format)
GENESISAPI const char *GENESISCC gePixelFormat_Description (gePixelFormat Format)
GENESISAPI geBoolean GENESISCC gePixelFormat_IsRaw (gePixelFormat Format)
GENESISAPI uint32 GENESISCC gePixelFormat_ComposePixel (gePixelFormat Format, int R, int G, int B, int A)
GENESISAPI void GENESISCC gePixelFormat_DecomposePixel (gePixelFormat Format, uint32 Pixel, int *R, int *G, int *B, int *A)
GENESISAPI void GENESISCC gePixelFormat_GetColor (gePixelFormat Format, uint8 **ppData, int *R, int *G, int *B, int *A)
GENESISAPI void GENESISCC gePixelFormat_PutColor (gePixelFormat Format, uint8 **ppData, int R, int G, int B, int A)
GENESISAPI uint32 GENESISCC gePixelFormat_GetPixel (gePixelFormat Format, uint8 **ppData)
GENESISAPI void GENESISCC gePixelFormat_PutPixel (gePixelFormat Format, uint8 **ppData, uint32 Pixel)
GENESISAPI uint32 GENESISCC gePixelFormat_ConvertPixel (gePixelFormat Format, uint32 Pixel, gePixelFormat ToFormat)


Define Documentation

#define GE_PIXELFORMAT_8BIT_PAL   GE_PIXELFORMAT_8BIT
 

Definition at line 77 of file pixelformat.h.

Referenced by BumpMap_CreateFromHeightMap(), createPalette(), ElectricFx_InitBitmap(), ElectricFx_InitPalette(), ElectricFx_Shade(), Fire_Create(), FireAnimator_CreateFire(), geBitmap_AllocPalette(), geBitmap_ReadFromBMP(), geBitmap_ReadFromTGA(), palettizePlane(), Particles_Draw(), Particles_InitBitmap(), Particles_InitPalette(), Plasma_Create(), PlasmaAnimator_CreatePlasma(), Smoke_InitBitmap(), Smoke_InitPalette(), and Smoke_Shade().


Typedef Documentation

typedef void(* gePixelFormat_ColorGetter)(uint8 **ppData,int *R,int *G,int *B,int *A)
 

Definition at line 82 of file pixelformat.h.

Referenced by geBitmap_GammaCorrect_Data(), geBitmap_GetAverageColor(), geBitmap_UpdateMips_Data(), paletteOptimize(), and palettizePlane().

typedef void(* gePixelFormat_ColorPutter)(uint8 **ppData,int R,int G,int B,int A)
 

Definition at line 83 of file pixelformat.h.

Referenced by geBitmap_GammaCorrect_Data(), and geBitmap_UpdateMips_Data().

typedef uint32(* gePixelFormat_Composer)(int R,int G,int B,int A)
 

Definition at line 79 of file pixelformat.h.

Referenced by geBitmap_GammaCorrect_Data(), and geBitmap_Palette_BlitData().

typedef void(* gePixelFormat_Decomposer)(uint32 Pixel,int *R,int *G,int *B,int *A)
 

Definition at line 80 of file pixelformat.h.

Referenced by createOctTree(), geBitmap_GammaCorrect_Data(), geBitmap_GetAverageColor(), geBitmap_Palette_BlitData(), geBitmap_UpdateMips_Data(), and palettizePlane().

typedef struct gePixelFormat_Operations gePixelFormat_Operations
 

typedef uint32(* gePixelFormat_PixelGetter)(uint8 **ppData)
 

Definition at line 85 of file pixelformat.h.

Referenced by geBitmap_GetAverageColor(), geBitmap_Palette_BlitData(), geBitmap_Palette_UnLock(), geBitmap_UpdateMips_Data(), and palettizePlane().

typedef void(* gePixelFormat_PixelPutter)(uint8 **ppData,uint32 Pixel)
 

Definition at line 86 of file pixelformat.h.

Referenced by geBitmap_Palette_BlitData(), geBitmap_Palette_UnLock(), and geBitmap_UpdateMips_Data().


Enumeration Type Documentation

enum gePixelFormat
 

Enumeration values:
GE_PIXELFORMAT_NO_DATA 
GE_PIXELFORMAT_8BIT 
GE_PIXELFORMAT_8BIT_GRAY 
GE_PIXELFORMAT_16BIT_555_RGB 
GE_PIXELFORMAT_16BIT_555_BGR 
GE_PIXELFORMAT_16BIT_565_RGB 
GE_PIXELFORMAT_16BIT_565_BGR 
GE_PIXELFORMAT_16BIT_4444_ARGB 
GE_PIXELFORMAT_16BIT_1555_ARGB 
GE_PIXELFORMAT_24BIT_RGB 
GE_PIXELFORMAT_24BIT_BGR 
GE_PIXELFORMAT_24BIT_YUV 
GE_PIXELFORMAT_32BIT_RGBX 
GE_PIXELFORMAT_32BIT_XRGB 
GE_PIXELFORMAT_32BIT_BGRX 
GE_PIXELFORMAT_32BIT_XBGR 
GE_PIXELFORMAT_32BIT_RGBA 
GE_PIXELFORMAT_32BIT_ARGB 
GE_PIXELFORMAT_32BIT_BGRA 
GE_PIXELFORMAT_32BIT_ABGR 
GE_PIXELFORMAT_WAVELET 
GE_PIXELFORMAT_COUNT 

Definition at line 32 of file pixelformat.h.

Referenced by BlitData_SameFormat(), BumpMap_ComputePalette(), createOctTree(), ElectricFx_InitPalette(), EnumPixelFormats(), geBitmap_BlitData_Sub(), geBitmap_DetachDriver(), geBitmap_Gamma_Apply(), geBitmap_GammaCorrect_Data(), geBitmap_GetAverageColor(), geBitmap_GetPreferredFormat(), geBitmap_Palette_Copy(), geBitmap_Palette_CreateFromFile(), geBitmap_Palette_GetData(), geBitmap_Palette_GetEntry(), geBitmap_Palette_SetData(), geBitmap_Palette_SetEntry(), geBitmap_Palette_WriteToFile(), geBitmapUtil_CreateHBITMAP(), geWBitmap_Pool_CreateAllWBitmaps(), palettizePlane(), Particles_InitPalette(), PlasmaAnimator_CreatePalette(), ProcUtil_SetPaletteFromString(), SetFormat_Create(), Smoke_InitPalette(), and Water_Create().


Function Documentation

GENESISAPI unsigned int GENESISCC gePixelFormat_BytesPerPel gePixelFormat  Format  ) 
 

Definition at line 124 of file pixelformat.c.

References gePixelFormat_Operations::BytesPerPel, GENESISAPI, GENESISCC, gePixelFormat_IsValid(), and gePixelFormat_Operations_Array.

Referenced by BlitData_DePalettize(), BumpMap_ComputePalette(), createOctTree(), ElectricFx_InitPalette(), geBitmap_BlitMipRect(), geBitmap_CreateLockFromMip(), geBitmap_CreateLockFromMipOnDriver(), geBitmap_CreateLockFromMipSystem(), geBitmap_GetAverageColor(), geBitmap_MakeSystemMips(), geBitmap_MipBytes(), geBitmap_Palette_Create(), geBitmap_Palette_CreateFromFile(), geBitmap_Palette_GetEntry(), geBitmap_Palette_SetEntry(), geBitmap_Palette_SetFormat(), geBitmap_Palette_WriteToFile(), geBitmap_ReadInfo(), geBitmap_SetColorKey(), geBitmap_SetFormat(), geBitmap_SetGammaCorrection(), geBitmap_UpdateMips_Data(), geBitmap_UpdateMips_System(), geBitmap_WriteInfo(), geBitmap_WriteToFile(), geBitmapUtil_CreateHBITMAP(), geBitmapUtil_SetColor(), geBitmapUtil_SmoothBits(), geFont_DrawUsingDIB(), palettizePlane(), Particles_InitPalette(), and Smoke_InitPalette().

00125 {
00126         assert( gePixelFormat_IsValid(Format) );
00127 return gePixelFormat_Operations_Array[Format].BytesPerPel;
00128 }

GENESISAPI uint32 GENESISCC gePixelFormat_ComposePixel gePixelFormat  Format,
int  R,
int  G,
int  B,
int  A
 

Definition at line 52 of file pixelformat.c.

References A, B, gePixelFormat_Operations::ComposePixel, G, GENESISAPI, GENESISCC, gePixelFormat_Operations_Array, R, and uint32.

Referenced by geBitmap_Palette_SetEntryColor(), geBitmapUtil_SetColor(), geFont_DrawText(), geFont_DrawTextToBitmap(), and gePixelFormat_ConvertPixel().

00053 {
00054 const gePixelFormat_Operations * ops;
00055         ops = &gePixelFormat_Operations_Array[Format];
00056         assert(ops);
00057         assert(ops->ComposePixel);
00058         return ops->ComposePixel(R,G,B,A);
00059 }

GENESISAPI uint32 GENESISCC gePixelFormat_ConvertPixel gePixelFormat  Format,
uint32  Pixel,
gePixelFormat  ToFormat
 

Definition at line 107 of file pixelformat.c.

References A, B, G, GENESISAPI, GENESISCC, gePixelFormat_ComposePixel(), gePixelFormat_DecomposePixel(), R, and uint32.

Referenced by geBitmap_SetFormatMin().

00108 {
00109 int R,G,B,A;
00110                 gePixelFormat_DecomposePixel(Format,Pixel,&R,&G,&B,&A);
00111 return  gePixelFormat_ComposePixel(ToFormat,R,G,B,A);
00112 }

GENESISAPI void GENESISCC gePixelFormat_DecomposePixel gePixelFormat  Format,
uint32  Pixel,
int *  R,
int *  G,
int *  B,
int *  A
 

Definition at line 61 of file pixelformat.c.

References A, B, gePixelFormat_Operations::DecomposePixel, G, GENESISAPI, GENESISCC, gePixelFormat_Operations_Array, and R.

Referenced by BlitData_DePalettize(), geBitmap_Palette_GetEntryColor(), and gePixelFormat_ConvertPixel().

00062 {
00063 const gePixelFormat_Operations * ops;
00064         ops = &gePixelFormat_Operations_Array[Format];
00065         assert(ops);
00066         assert(ops->DecomposePixel);
00067         ops->DecomposePixel(Pixel,R,G,B,A);
00068 }

GENESISAPI const char* GENESISCC gePixelFormat_Description gePixelFormat  Format  ) 
 

Definition at line 174 of file pixelformat.c.

References gePixelFormat_Operations::Description, GENESISAPI, GENESISCC, gePixelFormat_IsValid(), and gePixelFormat_Operations_Array.

Referenced by geBitmap_CreateTHandle().

00175 {
00176         assert( gePixelFormat_IsValid(Format) );
00177 return gePixelFormat_Operations_Array[Format].Description;
00178 }

GENESISAPI void GENESISCC gePixelFormat_GetColor gePixelFormat  Format,
uint8 **  ppData,
int *  R,
int *  G,
int *  B,
int *  A
 

Definition at line 88 of file pixelformat.c.

References A, B, G, GENESISAPI, GENESISCC, gePixelFormat_Operations_Array, gePixelFormat_Operations::GetColor, and R.

00089 {
00090 const gePixelFormat_Operations * ops;
00091         ops = &gePixelFormat_Operations_Array[Format];
00092         assert(ops);
00093         assert(ops->GetColor);
00094         ops->GetColor(ppData,R,G,B,A);
00095 }

GENESISAPI const gePixelFormat_Operations* GENESISCC gePixelFormat_GetOperations gePixelFormat  Format  ) 
 

Definition at line 114 of file pixelformat.c.

References GENESISAPI, GENESISCC, gePixelFormat_IsValid(), gePixelFormat_Operations_Array, and NULL.

Referenced by BlitData_DePalettize(), createOctTree(), geBitmap_BlitData_Sub(), geBitmap_ChooseDriverFormat(), geBitmap_GammaCorrect_Data(), geBitmap_GetAverageColor(), geBitmap_Palette_BlitData(), geBitmap_Palette_Create(), geBitmap_Palette_UnLock(), geBitmap_UpdateMips_Data(), geBitmap_UsesColorKey(), paletteOptimize(), and palettizePlane().

00115 {
00116         if ( ! gePixelFormat_IsValid(Format) )
00117                 return NULL;
00118         else
00119                 return & gePixelFormat_Operations_Array[Format];
00120 }

GENESISAPI uint32 GENESISCC gePixelFormat_GetPixel gePixelFormat  Format,
uint8 **  ppData
 

Definition at line 70 of file pixelformat.c.

References GENESISAPI, GENESISCC, gePixelFormat_Operations_Array, gePixelFormat_Operations::GetPixel, and uint32.

Referenced by geBitmap_Palette_GetEntry(), and geBitmap_ReadInfo().

00071 {
00072 const gePixelFormat_Operations * ops;
00073         ops = &gePixelFormat_Operations_Array[Format];
00074         assert(ops);
00075         assert(ops->GetPixel);
00076         return ops->GetPixel(ppData);
00077 }

GENESISAPI geBoolean GENESISCC gePixelFormat_HasAlpha gePixelFormat  Format  ) 
 

Definition at line 136 of file pixelformat.c.

References gePixelFormat_Operations::AMask, geBoolean, GENESISAPI, GENESISCC, gePixelFormat_IsValid(), and gePixelFormat_Operations_Array.

Referenced by BlitData_FromSeparateAlpha(), geBitmap_BlitData_Sub(), geBitmap_Palette_CreateFromDriver(), geBitmap_Palette_SetEntryColor(), geBitmap_SetColorKey(), Hack_FindPixelFormat(), palettizePlane(), and SetFormat_Create().

00137 {
00138         assert( gePixelFormat_IsValid(Format) );
00139 //      if ( Format == GE_PIXELFORMAT_16BIT_1555_ARGB ) @@
00140 //              return 0;
00141 return gePixelFormat_Operations_Array[Format].AMask;
00142 }

GENESISAPI geBoolean GENESISCC gePixelFormat_HasGoodAlpha gePixelFormat  Format  ) 
 

Definition at line 155 of file pixelformat.c.

References GE_FALSE, GE_TRUE, geBoolean, GENESISAPI, GENESISCC, gePixelFormat_IsValid(), gePixelFormat_Operations_Array, and NumBitsOn().

Referenced by geBitmap_AllocPalette(), geBitmap_AttachToDriver(), geBitmap_ChooseDriverFormat(), geBitmap_CreateLockFromMip(), geBitmap_CreateLockFromMipSystem(), geBitmap_HasAlpha(), geBitmap_SetFormat(), and geBitmap_Update_SystemToDriver().

00156 {
00157         assert( gePixelFormat_IsValid(Format) );
00158         
00159         if ( NumBitsOn(gePixelFormat_Operations_Array[Format].AMask) > 1 )
00160                 return GE_TRUE;
00161         else
00162                 return GE_FALSE;
00163 }

GENESISAPI geBoolean GENESISCC gePixelFormat_HasPalette gePixelFormat  Format  ) 
 

Definition at line 130 of file pixelformat.c.

References geBoolean, GENESISAPI, GENESISCC, gePixelFormat_IsValid(), gePixelFormat_Operations_Array, and gePixelFormat_Operations::HasPalette.

Referenced by BlitData_FromSeparateAlpha(), BlitData_ToSeparateAlpha(), Engine_CreateTHandle(), geBitmap_BlitData_Sub(), geBitmap_ChooseDriverFormat(), geBitmap_CreateLockFromMip(), geBitmap_Gamma_Apply(), geBitmap_GetAverageColor(), geBitmap_HasAlpha(), geBitmap_MakeDriverLockInfo(), geBitmap_SetFormat(), geBitmap_SetFormatMin(), geBitmap_SetPalette(), and geBitmap_UpdateMips_Data().

00131 {
00132         assert( gePixelFormat_IsValid(Format) );
00133 return gePixelFormat_Operations_Array[Format].HasPalette;
00134 }

GENESISAPI geBoolean GENESISCC gePixelFormat_IsRaw gePixelFormat  Format  ) 
 

Definition at line 165 of file pixelformat.c.

References gePixelFormat_Operations::ComposePixel, GE_FALSE, GE_TRUE, geBoolean, GENESISAPI, GENESISCC, gePixelFormat_IsValid(), and gePixelFormat_Operations_Array.

Referenced by geBitmap_AllocPalette(), geBitmap_ChooseDriverFormat(), geBitmap_GetAverageColor(), geBitmap_Palette_BlitData(), geBitmap_Palette_CreateFromDriver(), geBitmap_SetFormatMin(), geFont_DrawUsingDIB(), and palettizePlane().

00166 {
00167         assert( gePixelFormat_IsValid(Format) );
00168         if ( gePixelFormat_Operations_Array[Format].ComposePixel )
00169                 return GE_TRUE;
00170         else
00171                 return GE_FALSE;
00172 }

GENESISAPI geBoolean GENESISCC gePixelFormat_IsValid gePixelFormat  Format  ) 
 

Definition at line 180 of file pixelformat.c.

References GE_FALSE, GE_PIXELFORMAT_COUNT, GE_TRUE, geBoolean, GENESISAPI, and GENESISCC.

Referenced by geBitmap_CreateTHandle(), geBitmap_WriteInfo(), gePixelFormat_BytesPerPel(), gePixelFormat_Description(), gePixelFormat_GetOperations(), gePixelFormat_HasAlpha(), gePixelFormat_HasGoodAlpha(), gePixelFormat_HasPalette(), gePixelFormat_IsRaw(), and SetFormat_Create().

00181 {
00182         if ( (int)Format < 0 || (int)Format >= GE_PIXELFORMAT_COUNT )
00183                 return GE_FALSE;
00184         return GE_TRUE;
00185 }

GENESISAPI void GENESISCC gePixelFormat_PutColor gePixelFormat  Format,
uint8 **  ppData,
int  R,
int  G,
int  B,
int  A
 

Definition at line 96 of file pixelformat.c.

References A, B, G, GENESISAPI, GENESISCC, gePixelFormat_Operations_Array, gePixelFormat_Operations::PutColor, and R.

Referenced by BumpMap_ComputePalette(), ElectricFx_InitPalette(), geFont_DrawUsingDIB(), Particles_InitPalette(), PlasmaAnimator_CreatePalette(), ProcUtil_SetPaletteFromString(), and Smoke_InitPalette().

00097 {
00098 const gePixelFormat_Operations * ops;
00099         ops = &gePixelFormat_Operations_Array[Format];
00100         assert(ops);
00101         assert(ops->PutColor);
00102         ops->PutColor(ppData,R,G,B,A);
00103 }

GENESISAPI void GENESISCC gePixelFormat_PutPixel gePixelFormat  Format,
uint8 **  ppData,
uint32  Pixel
 

Definition at line 79 of file pixelformat.c.

References GENESISAPI, GENESISCC, gePixelFormat_Operations_Array, and gePixelFormat_Operations::PutPixel.

Referenced by geBitmap_Palette_SetEntry(), and geBitmap_WriteInfo().

00080 {
00081 const gePixelFormat_Operations * ops;
00082         ops = &gePixelFormat_Operations_Array[Format];
00083         assert(ops);
00084         assert(ops->PutPixel);
00085         ops->PutPixel(ppData,Pixel);
00086 }


Generated on Tue Sep 30 12:37:55 2003 for GTestAndEngine by doxygen 1.3.2