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

pixelformat.c File Reference

#include <stdlib.h>
#include <assert.h>
#include "pixelformat.h"

Go to the source code of this file.

Defines

#define isinrange(x, lo, hi)   ( (x)>=(lo) && (x)<=(hi) )
#define SHIFTL(val, shift)   ( (shift) >= 0 ? ((val)<<(shift)) : ((val)>>(-(shift))) )
#define SHIFTR(val, shift)   ( (shift) >= 0 ? ((val)>>(shift)) : ((val)<<(-(shift))) )
#define RGB_to_Gray(R, G, B)   max(max(R,G),B)

Functions

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 uint32 GENESISCC gePixelFormat_GetPixel (gePixelFormat Format, uint8 **ppData)
GENESISAPI void GENESISCC gePixelFormat_PutPixel (gePixelFormat Format, uint8 **ppData, uint32 Pixel)
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_ConvertPixel (gePixelFormat Format, uint32 Pixel, gePixelFormat ToFormat)
GENESISAPI const gePixelFormat_Operations
*GENESISCC 
gePixelFormat_GetOperations (gePixelFormat Format)
GENESISAPI unsigned int GENESISCC gePixelFormat_BytesPerPel (gePixelFormat Format)
GENESISAPI geBoolean GENESISCC gePixelFormat_HasPalette (gePixelFormat Format)
GENESISAPI geBoolean GENESISCC gePixelFormat_HasAlpha (gePixelFormat Format)
int NumBitsOn (uint32 val)
GENESISAPI geBoolean GENESISCC gePixelFormat_HasGoodAlpha (gePixelFormat Format)
GENESISAPI geBoolean GENESISCC gePixelFormat_IsRaw (gePixelFormat Format)
GENESISAPI const char *GENESISCC gePixelFormat_Description (gePixelFormat Format)
GENESISAPI geBoolean GENESISCC gePixelFormat_IsValid (gePixelFormat Format)
uint32 GetPixel_8bit (uint8 **ppData)
void PutPixel_8bit (uint8 **ppData, uint32 Pixel)
uint32 GetPixel_16bit (uint8 **ppData)
void PutPixel_16bit (uint8 **ppData, uint32 Pixel)
uint32 GetPixel_24bit (uint8 **ppData)
void PutPixel_24bit (uint8 **ppData, uint32 Pixel)
uint32 GetPixel_32bit (uint8 **ppData)
void PutPixel_32bit (uint8 **ppData, uint32 Pixel)
uint32 Compose_8bitGray (int R, int G, int B, int A)
void Decompose_8bitGray (uint32 Pixel, int *R, int *G, int *B, int *A)
void Get_8bitGray (uint8 **ppData, int *R, int *G, int *B, int *A)
void Put_8bitGray (uint8 **ppData, int R, int G, int B, int A)
uint32 Compose_nada (int R, int G, int B, int A)
void Decompose_nada (uint32 Pixel, int *R, int *G, int *B, int *A)
void Get_nada (uint8 **ppData, int *R, int *G, int *B, int *A)
void Put_nada (uint8 **ppData, int R, int G, int B, int A)
uint32 Compose_555rgb (int R, int G, int B, int A)
void Decompose_555rgb (uint32 Pixel, int *R, int *G, int *B, int *A)
void Get_555rgb (uint8 **ppData, int *R, int *G, int *B, int *A)
void Put_555rgb (uint8 **ppData, int R, int G, int B, int A)
uint32 Compose_555bgr (int R, int G, int B, int A)
void Decompose_555bgr (uint32 Pixel, int *R, int *G, int *B, int *A)
void Get_555bgr (uint8 **ppData, int *R, int *G, int *B, int *A)
void Put_555bgr (uint8 **ppData, int R, int G, int B, int A)
uint32 Compose_565rgb (int R, int G, int B, int A)
void Decompose_565rgb (uint32 Pixel, int *R, int *G, int *B, int *A)
void Get_565rgb (uint8 **ppData, int *R, int *G, int *B, int *A)
void Put_565rgb (uint8 **ppData, int R, int G, int B, int A)
uint32 Compose_565bgr (int R, int G, int B, int A)
void Decompose_565bgr (uint32 Pixel, int *R, int *G, int *B, int *A)
void Get_565bgr (uint8 **ppData, int *R, int *G, int *B, int *A)
void Put_565bgr (uint8 **ppData, int R, int G, int B, int A)
uint32 Compose_4444 (int R, int G, int B, int A)
void Decompose_4444 (uint32 Pixel, int *R, int *G, int *B, int *A)
void Get_4444 (uint8 **ppData, int *R, int *G, int *B, int *A)
void Put_4444 (uint8 **ppData, int R, int G, int B, int A)
uint32 Compose_1555 (int R, int G, int B, int A)
void Decompose_1555 (uint32 Pixel, int *R, int *G, int *B, int *A)
void Get_1555 (uint8 **ppData, int *R, int *G, int *B, int *A)
void Put_1555 (uint8 **ppData, int R, int G, int B, int A)
uint32 Compose_24rgb (int R, int G, int B, int A)
void Decompose_24rgb (uint32 Pixel, int *R, int *G, int *B, int *A)
void Get_24rgb (uint8 **ppData, int *R, int *G, int *B, int *A)
void Put_24rgb (uint8 **ppData, int R, int G, int B, int A)
uint32 Compose_24bgr (int R, int G, int B, int A)
void Decompose_24bgr (uint32 Pixel, int *R, int *G, int *B, int *A)
void Get_24bgr (uint8 **ppData, int *R, int *G, int *B, int *A)
void Put_24bgr (uint8 **ppData, int R, int G, int B, int A)
uint32 Compose_32rgbx (int R, int G, int B, int A)
void Decompose_32rgbx (uint32 Pixel, int *R, int *G, int *B, int *A)
void Get_32rgbx (uint8 **ppData, int *R, int *G, int *B, int *A)
void Put_32rgbx (uint8 **ppData, int R, int G, int B, int A)
uint32 Compose_32xrgb (int R, int G, int B, int A)
void Decompose_32xrgb (uint32 Pixel, int *R, int *G, int *B, int *A)
void Get_32xrgb (uint8 **ppData, int *R, int *G, int *B, int *A)
void Put_32xrgb (uint8 **ppData, int R, int G, int B, int A)
uint32 Compose_32bgrx (int R, int G, int B, int A)
void Decompose_32bgrx (uint32 Pixel, int *R, int *G, int *B, int *A)
void Get_32bgrx (uint8 **ppData, int *R, int *G, int *B, int *A)
void Put_32bgrx (uint8 **ppData, int R, int G, int B, int A)
uint32 Compose_32xbgr (int R, int G, int B, int A)
void Decompose_32xbgr (uint32 Pixel, int *R, int *G, int *B, int *A)
void Get_32xbgr (uint8 **ppData, int *R, int *G, int *B, int *A)
void Put_32xbgr (uint8 **ppData, int R, int G, int B, int A)
uint32 Compose_32rgba (int R, int G, int B, int A)
void Decompose_32rgba (uint32 pixel, int *R, int *G, int *B, int *A)
void Get_32rgba (uint8 **ppData, int *R, int *G, int *B, int *A)
void Put_32rgba (uint8 **ppData, int R, int G, int B, int A)
uint32 Compose_32argb (int R, int G, int B, int A)
void Decompose_32argb (uint32 pixel, int *R, int *G, int *B, int *A)
void Get_32argb (uint8 **ppData, int *R, int *G, int *B, int *A)
void Put_32argb (uint8 **ppData, int R, int G, int B, int A)
uint32 Compose_32bgra (int R, int G, int B, int A)
void Decompose_32bgra (uint32 pixel, int *R, int *G, int *B, int *A)
void Get_32bgra (uint8 **ppData, int *R, int *G, int *B, int *A)
void Put_32bgra (uint8 **ppData, int R, int G, int B, int A)
uint32 Compose_32abgr (int R, int G, int B, int A)
void Decompose_32abgr (uint32 pixel, int *R, int *G, int *B, int *A)
void Get_32abgr (uint8 **ppData, int *R, int *G, int *B, int *A)
void Put_32abgr (uint8 **ppData, int R, int G, int B, int A)

Variables

const gePixelFormat_OperationsgePixelFormat_Operations_Array = gePixelFormat_Operations_Array_Def
const gePixelFormat_Operations gePixelFormat_Operations_Array_Def []


Define Documentation

#define isinrange x,
lo,
hi   )     ( (x)>=(lo) && (x)<=(hi) )
 

Definition at line 41 of file pixelformat.c.

#define RGB_to_Gray R,
G,
B   )     max(max(R,G),B)
 

Definition at line 254 of file pixelformat.c.

Referenced by Compose_8bitGray(), and Put_8bitGray().

#define SHIFTL val,
shift   )     ( (shift) >= 0 ? ((val)<<(shift)) : ((val)>>(-(shift))) )
 

Definition at line 43 of file pixelformat.c.

#define SHIFTR val,
shift   )     ( (shift) >= 0 ? ((val)>>(shift)) : ((val)<<(-(shift))) )
 

Definition at line 44 of file pixelformat.c.


Function Documentation

uint32 Compose_1555 int  R,
int  G,
int  B,
int  A
 

Definition at line 474 of file pixelformat.c.

References A, B, G, R, and uint32.

00475 {
00476         assert( (R&0xFF) == R && (G&0xFF) == G && (B&0xFF) == B && (A&0xFF) == A );
00477         return  ((A>>7)<<15) + ((R>>3)<<10) + ((G>>3)<<5) + ((B>>3)) ;
00478 }

uint32 Compose_24bgr int  R,
int  G,
int  B,
int  A
 

Definition at line 543 of file pixelformat.c.

References B, G, R, and uint32.

00544 {
00545         assert( (R&0xFF) == R && (G&0xFF) == G && (B&0xFF) == B );
00546         return  (B<<16) + (G<<8) + R;
00547 }

uint32 Compose_24rgb int  R,
int  G,
int  B,
int  A
 

Definition at line 510 of file pixelformat.c.

References B, G, R, and uint32.

00511 {
00512         assert( (R&0xFF) == R && (G&0xFF) == G && (B&0xFF) == B );
00513         return  (R<<16) + (G<<8) + B;
00514 }

uint32 Compose_32abgr int  R,
int  G,
int  B,
int  A
 

Definition at line 796 of file pixelformat.c.

References A, B, G, R, and uint32.

00797 {
00798         assert( (R&0xFF) == R && (G&0xFF) == G && (B&0xFF) == B && (A&0xFF) == A );
00799         return  (A<<24) + (B<<16) + (G<<8) + (R);
00800 }

uint32 Compose_32argb int  R,
int  G,
int  B,
int  A
 

Definition at line 736 of file pixelformat.c.

References A, B, G, R, and uint32.

00737 {
00738         assert( (R&0xFF) == R && (G&0xFF) == G && (B&0xFF) == B && (A&0xFF) == A );
00739         return  (A<<24) + (R<<16) + (G<<8) + (B);
00740 }

uint32 Compose_32bgra int  R,
int  G,
int  B,
int  A
 

Definition at line 766 of file pixelformat.c.

References A, B, G, R, and uint32.

00767 {
00768         assert( (R&0xFF) == R && (G&0xFF) == G && (B&0xFF) == B && (A&0xFF) == A );
00769         return  (B<<24) + (G<<16) + (R<<8) + A;
00770 }

uint32 Compose_32bgrx int  R,
int  G,
int  B,
int  A
 

Definition at line 642 of file pixelformat.c.

References B, G, R, and uint32.

00643 {
00644         assert( (R&0xFF) == R && (G&0xFF) == G && (B&0xFF) == B );
00645         return  (B<<24) + (G<<16) + (R<<8);
00646 }

uint32 Compose_32rgba int  R,
int  G,
int  B,
int  A
 

Definition at line 706 of file pixelformat.c.

References A, B, G, R, and uint32.

00707 {
00708         assert( (R&0xFF) == R && (G&0xFF) == G && (B&0xFF) == B && (A&0xFF) == A );
00709         return  (R<<24) + (G<<16) + (B<<8) + A;
00710 }

uint32 Compose_32rgbx int  R,
int  G,
int  B,
int  A
 

Definition at line 580 of file pixelformat.c.

References B, G, R, and uint32.

00581 {
00582         assert( (R&0xFF) == R && (G&0xFF) == G && (B&0xFF) == B );
00583         return  (R<<24) + (G<<16) + (B<<8);
00584 }

uint32 Compose_32xbgr int  R,
int  G,
int  B,
int  A
 

Definition at line 673 of file pixelformat.c.

References B, G, R, and uint32.

00674 {
00675         assert( (R&0xFF) == R && (G&0xFF) == G && (B&0xFF) == B );
00676         return  (B<<16) + (G<<8) + (R);
00677 }

uint32 Compose_32xrgb int  R,
int  G,
int  B,
int  A
 

Definition at line 611 of file pixelformat.c.

References B, G, R, and uint32.

00612 {
00613         assert( (R&0xFF) == R && (G&0xFF) == G && (B&0xFF) == B );
00614         return  (R<<16) + (G<<8) + (B);
00615 }

uint32 Compose_4444 int  R,
int  G,
int  B,
int  A
 

Definition at line 441 of file pixelformat.c.

References A, B, G, R, and uint32.

00442 {
00443         assert( (R&0xFF) == R && (G&0xFF) == G && (B&0xFF) == B && (A&0xFF) == A );
00444         return  ((A>>4)<<12) + ((R>>4)<<8) + ((G>>4)<<4) + (B>>4);
00445 }

uint32 Compose_555bgr int  R,
int  G,
int  B,
int  A
 

Definition at line 337 of file pixelformat.c.

References B, G, R, and uint32.

00338 {
00339         assert( (R&0xFF) == R && (G&0xFF) == G && (B&0xFF) == B );
00340         return  ( ((B>>3)<<10) + ((G>>3)<<5) + ((R>>3)) );
00341 }

uint32 Compose_555rgb int  R,
int  G,
int  B,
int  A
 

Definition at line 304 of file pixelformat.c.

References B, G, R, and uint32.

00305 {
00306         assert( (R&0xFF) == R && (G&0xFF) == G && (B&0xFF) == B );
00307         return  ( ((R>>3)<<10) + ((G>>3)<<5) + ((B>>3)) );
00308 }

uint32 Compose_565bgr int  R,
int  G,
int  B,
int  A
 

Definition at line 406 of file pixelformat.c.

References B, G, R, and uint32.

00407 {
00408         assert( (R&0xFF) == R && (G&0xFF) == G && (B&0xFF) == B );
00409         return  ( ((B>>3)<<11) + ((G>>2)<<5) + ((R>>3)) );
00410 }

uint32 Compose_565rgb int  R,
int  G,
int  B,
int  A
 

Definition at line 373 of file pixelformat.c.

References B, G, R, and uint32.

00374 {
00375         assert( (R&0xFF) == R && (G&0xFF) == G && (B&0xFF) == B );
00376         return  ( ((R>>3)<<11) + ((G>>2)<<5) + ((B>>3)) );
00377 }

uint32 Compose_8bitGray int  R,
int  G,
int  B,
int  A
 

Definition at line 256 of file pixelformat.c.

References B, G, R, RGB_to_Gray, and uint32.

00257 {
00258 return (uint32)RGB_to_Gray(R,G,B);
00259 }

uint32 Compose_nada int  R,
int  G,
int  B,
int  A
 

Definition at line 285 of file pixelformat.c.

References uint32.

00286 {
00287 return 0;
00288 }

void Decompose_1555 uint32  Pixel,
int *  R,
int *  G,
int *  B,
int *  A
 

Definition at line 480 of file pixelformat.c.

References A, B, G, and R.

00481 {
00482         *R = ((Pixel & 0x7C00)>>7) + 4;
00483         *G = ((Pixel & 0x03E0)>>2) + 4;
00484         *B = ((Pixel & 0x001F)<<3) + 4;
00485         *A = (Pixel>>15)<<7;
00486 }

void Decompose_24bgr uint32  Pixel,
int *  R,
int *  G,
int *  B,
int *  A
 

Definition at line 549 of file pixelformat.c.

References A, B, G, and R.

00550 {
00551         *A = 255;
00552         *B = (Pixel>>16)&0xFF;
00553         *G = (Pixel>>8)&0xFF;
00554         *R = (Pixel)&0xFF;
00555 }

void Decompose_24rgb uint32  Pixel,
int *  R,
int *  G,
int *  B,
int *  A
 

Definition at line 516 of file pixelformat.c.

References A, B, G, and R.

00517 {
00518         *A = 255;
00519         *R = (Pixel>>16)&0xFF;
00520         *G = (Pixel>>8)&0xFF;
00521         *B = (Pixel)&0xFF;
00522 }

void Decompose_32abgr uint32  pixel,
int *  R,
int *  G,
int *  B,
int *  A
 

Definition at line 802 of file pixelformat.c.

References A, B, G, and R.

00803 {
00804         *A = (pixel>>24)&0xFF;
00805         *B = (pixel>>16)&0xFF;
00806         *G = (pixel>> 8)&0xFF;
00807         *R = (pixel    )&0xFF;
00808 }

void Decompose_32argb uint32  pixel,
int *  R,
int *  G,
int *  B,
int *  A
 

Definition at line 742 of file pixelformat.c.

References A, B, G, and R.

00743 {
00744         *A = (pixel>>24)&0xFF;
00745         *R = (pixel>>16)&0xFF;
00746         *G = (pixel>> 8)&0xFF;
00747         *B = (pixel    )&0xFF;
00748 }

void Decompose_32bgra uint32  pixel,
int *  R,
int *  G,
int *  B,
int *  A
 

Definition at line 772 of file pixelformat.c.

References A, B, G, and R.

00773 {
00774         *B = (pixel>>24)&0xFF;
00775         *G = (pixel>>16)&0xFF;
00776         *R = (pixel>> 8)&0xFF;
00777         *A = (pixel    )&0xFF;
00778 }

void Decompose_32bgrx uint32  Pixel,
int *  R,
int *  G,
int *  B,
int *  A
 

Definition at line 648 of file pixelformat.c.

References A, B, G, and R.

00649 {
00650         *A = 255;
00651         *B = (Pixel>>24)&0xFF;
00652         *G = (Pixel>>16)&0xFF;
00653         *R = (Pixel>> 8)&0xFF;
00654 }

void Decompose_32rgba uint32  pixel,
int *  R,
int *  G,
int *  B,
int *  A
 

Definition at line 712 of file pixelformat.c.

References A, B, G, and R.

00713 {
00714         *R = (pixel>>24)&0xFF;
00715         *G = (pixel>>16)&0xFF;
00716         *B = (pixel>> 8)&0xFF;
00717         *A = (pixel    )&0xFF;
00718 }

void Decompose_32rgbx uint32  Pixel,
int *  R,
int *  G,
int *  B,
int *  A
 

Definition at line 586 of file pixelformat.c.

References A, B, G, and R.

00587 {
00588         *A = 255;
00589         *R = (Pixel>>24)&0xFF;
00590         *G = (Pixel>>16)&0xFF;
00591         *B = (Pixel>> 8)&0xFF;
00592 }

void Decompose_32xbgr uint32  Pixel,
int *  R,
int *  G,
int *  B,
int *  A
 

Definition at line 679 of file pixelformat.c.

References A, B, G, and R.

00680 {
00681         *A = 255;
00682         *B = (Pixel>>16)&0xFF;
00683         *G = (Pixel>> 8)&0xFF;
00684         *R = (Pixel   )&0xFF;
00685 }

void Decompose_32xrgb uint32  Pixel,
int *  R,
int *  G,
int *  B,
int *  A
 

Definition at line 617 of file pixelformat.c.

References A, B, G, and R.

00618 {
00619         *A = 255;
00620         *R = (Pixel>>16)&0xFF;
00621         *G = (Pixel>> 8)&0xFF;
00622         *B = (Pixel   )&0xFF;
00623 }

void Decompose_4444 uint32  Pixel,
int *  R,
int *  G,
int *  B,
int *  A
 

Definition at line 447 of file pixelformat.c.

References A, B, G, and R.

00448 {
00449         *A = ((Pixel & 0xF000)>>8);
00450         *R = ((Pixel & 0x0F00)>>4) + 8;
00451         *G = ((Pixel & 0x00F0)   ) + 8;
00452         *B = ((Pixel & 0x000F)<<4) + 8;
00453 }

void Decompose_555bgr uint32  Pixel,
int *  R,
int *  G,
int *  B,
int *  A
 

Definition at line 343 of file pixelformat.c.

References A, B, G, and R.

00344 {
00345         *B = ((Pixel & 0x7C00)>>7) + 4;
00346         *G = ((Pixel & 0x03E0)>>2) + 4;
00347         *R = ((Pixel & 0x001F)<<3) + 4;
00348         *A = 255;
00349 }

void Decompose_555rgb uint32  Pixel,
int *  R,
int *  G,
int *  B,
int *  A
 

Definition at line 310 of file pixelformat.c.

References A, B, G, and R.

00311 {
00312         *R = ((Pixel & 0x7C00)>>7) + 4;
00313         *G = ((Pixel & 0x03E0)>>2) + 4;
00314         *B = ((Pixel & 0x001F)<<3) + 4;
00315         *A = 255;
00316 }

void Decompose_565bgr uint32  Pixel,
int *  R,
int *  G,
int *  B,
int *  A
 

Definition at line 412 of file pixelformat.c.

References A, B, G, and R.

00413 {
00414         *B = ((Pixel & 0xF800)>>8) + 4;
00415         *G = ((Pixel & 0x07E0)>>3) + 2;
00416         *R = ((Pixel & 0x001F)<<3) + 4;
00417         *A = 255;
00418 }

void Decompose_565rgb uint32  Pixel,
int *  R,
int *  G,
int *  B,
int *  A
 

Definition at line 379 of file pixelformat.c.

References A, B, G, and R.

00380 {
00381         *R = ((Pixel & 0xF800)>>8) + 4;
00382         *G = ((Pixel & 0x07E0)>>3) + 2;
00383         *B = ((Pixel & 0x001F)<<3) + 4;
00384         *A = 255;
00385 }

void Decompose_8bitGray uint32  Pixel,
int *  R,
int *  G,
int *  B,
int *  A
 

Definition at line 261 of file pixelformat.c.

References A, B, G, and R.

00262 {
00263         *R = *G = *B = (int)Pixel;
00264         *A = 255;
00265 }

void Decompose_nada uint32  Pixel,
int *  R,
int *  G,
int *  B,
int *  A
 

Definition at line 290 of file pixelformat.c.

00291 {
00292 }

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 }

void Get_1555 uint8 **  ppData,
int *  R,
int *  G,
int *  B,
int *  A
 

Definition at line 488 of file pixelformat.c.

References A, B, G, R, and uint16.

00489 {
00490 uint16 Pixel;
00491         Pixel = *((uint16 *)*ppData);
00492         (*ppData) += 2;
00493         *R = ((Pixel & 0x7C00)>>7) + 4;
00494         *G = ((Pixel & 0x03E0)>>2) + 4;
00495         *B = ((Pixel & 0x001F)<<3) + 4;
00496         *A = (Pixel>>15)<<7;
00497 }

void Get_24bgr uint8 **  ppData,
int *  R,
int *  G,
int *  B,
int *  A
 

Definition at line 557 of file pixelformat.c.

References A, B, G, R, and uint8.

00558 {
00559 uint8 * ptr = *ppData;
00560         *B = ptr[0];
00561         *G = ptr[1];
00562         *R = ptr[2];
00563         *A = 255;
00564         *ppData = ptr + 3;
00565 }

void Get_24rgb uint8 **  ppData,
int *  R,
int *  G,
int *  B,
int *  A
 

Definition at line 524 of file pixelformat.c.

References A, B, G, R, and uint8.

00525 {
00526 uint8 * ptr = *ppData;
00527         *R = ptr[0];
00528         *G = ptr[1];
00529         *B = ptr[2];
00530         *A = 255;
00531         *ppData = ptr + 3;
00532 }

void Get_32abgr uint8 **  ppData,
int *  R,
int *  G,
int *  B,
int *  A
 

Definition at line 810 of file pixelformat.c.

References A, B, G, and R.

00811 {
00812         *R = **ppData; (*ppData) += 1;
00813         *G = **ppData; (*ppData) += 1;
00814         *B = **ppData; (*ppData) += 1;
00815         *A = **ppData; (*ppData) += 1;
00816 }

void Get_32argb uint8 **  ppData,
int *  R,
int *  G,
int *  B,
int *  A
 

Definition at line 750 of file pixelformat.c.

References A, B, G, and R.

00751 {
00752         *B = **ppData; (*ppData) += 1;
00753         *G = **ppData; (*ppData) += 1;
00754         *R = **ppData; (*ppData) += 1;
00755         *A = **ppData; (*ppData) += 1;
00756 }

void Get_32bgra uint8 **  ppData,
int *  R,
int *  G,
int *  B,
int *  A
 

Definition at line 780 of file pixelformat.c.

References A, B, G, and R.

00781 {
00782         *A = **ppData; (*ppData) += 1;
00783         *R = **ppData; (*ppData) += 1;
00784         *G = **ppData; (*ppData) += 1;
00785         *B = **ppData; (*ppData) += 1;
00786 }

void Get_32bgrx uint8 **  ppData,
int *  R,
int *  G,
int *  B,
int *  A
 

Definition at line 656 of file pixelformat.c.

References A, B, G, and R.

00657 {
00658         (*ppData) += 1;
00659         *R = **ppData; (*ppData) += 1;
00660         *G = **ppData; (*ppData) += 1;
00661         *B = **ppData; (*ppData) += 1;
00662         *A = 255;
00663 }

void Get_32rgba uint8 **  ppData,
int *  R,
int *  G,
int *  B,
int *  A
 

Definition at line 720 of file pixelformat.c.

References A, B, G, and R.

00721 {
00722         *A = **ppData; (*ppData) += 1;
00723         *B = **ppData; (*ppData) += 1;
00724         *G = **ppData; (*ppData) += 1;
00725         *R = **ppData; (*ppData) += 1;
00726 }

void Get_32rgbx uint8 **  ppData,
int *  R,
int *  G,
int *  B,
int *  A
 

Definition at line 594 of file pixelformat.c.

References A, B, G, and R.

00595 {
00596         (*ppData) += 1;
00597         *B = **ppData; (*ppData) += 1;
00598         *G = **ppData; (*ppData) += 1;
00599         *R = **ppData; (*ppData) += 1;
00600         *A = 255;
00601 }

void Get_32xbgr uint8 **  ppData,
int *  R,
int *  G,
int *  B,
int *  A
 

Definition at line 687 of file pixelformat.c.

References A, B, G, and R.

00688 {
00689         *R = **ppData; (*ppData) += 1;
00690         *G = **ppData; (*ppData) += 1;
00691         *B = **ppData; (*ppData) += 1;
00692         (*ppData) += 1;
00693         *A = 255;
00694 }

void Get_32xrgb uint8 **  ppData,
int *  R,
int *  G,
int *  B,
int *  A
 

Definition at line 625 of file pixelformat.c.

References A, B, G, and R.

00626 {
00627         *B = **ppData; (*ppData) += 1;
00628         *G = **ppData; (*ppData) += 1;
00629         *R = **ppData; (*ppData) += 1;
00630         (*ppData) += 1;
00631         *A = 255;
00632 }

void Get_4444 uint8 **  ppData,
int *  R,
int *  G,
int *  B,
int *  A
 

Definition at line 455 of file pixelformat.c.

References A, B, G, R, and uint16.

00456 {
00457 uint16 Pixel;
00458         Pixel = *((uint16 *)*ppData);
00459         (*ppData) += 2;
00460         *A = ((Pixel & 0xF000)>>8);
00461         *R = ((Pixel & 0x0F00)>>4) + 8;
00462         *G = ((Pixel & 0x00F0)   ) + 8;
00463         *B = ((Pixel & 0x000F)<<4) + 8;
00464 }

void Get_555bgr uint8 **  ppData,
int *  R,
int *  G,
int *  B,
int *  A
 

Definition at line 351 of file pixelformat.c.

References A, B, G, R, and uint16.

00352 {
00353 uint16 Pixel;
00354         Pixel = *((uint16 *)*ppData);
00355         (*ppData) += 2;
00356         *B = ((Pixel & 0x7C00)>>7) + 4;
00357         *G = ((Pixel & 0x03E0)>>2) + 4;
00358         *R = ((Pixel & 0x001F)<<3) + 4;
00359         *A = 255;
00360 }

void Get_555rgb uint8 **  ppData,
int *  R,
int *  G,
int *  B,
int *  A
 

Definition at line 318 of file pixelformat.c.

References A, B, G, R, and uint16.

00319 {
00320 uint16 Pixel;
00321         Pixel = *((uint16 *)*ppData);
00322         (*ppData) += 2;
00323         *R = ((Pixel & 0x7C00)>>7) + 4;
00324         *G = ((Pixel & 0x03E0)>>2) + 4;
00325         *B = ((Pixel & 0x001F)<<3) + 4;
00326         *A = 255;
00327 }

void Get_565bgr uint8 **  ppData,
int *  R,
int *  G,
int *  B,
int *  A
 

Definition at line 420 of file pixelformat.c.

References A, B, G, R, and uint16.

00421 {
00422 uint16 Pixel;
00423         Pixel = *((uint16 *)*ppData);
00424         (*ppData) += 2;
00425         *B = ((Pixel & 0xF800)>>8) + 4;
00426         *G = ((Pixel & 0x07E0)>>3) + 2;
00427         *R = ((Pixel & 0x001F)<<3) + 4;
00428         *A = 255;
00429 }

void Get_565rgb uint8 **  ppData,
int *  R,
int *  G,
int *  B,
int *  A
 

Definition at line 387 of file pixelformat.c.

References A, B, G, R, and uint16.

00388 {
00389 uint16 Pixel;
00390         Pixel = *((uint16 *)*ppData);
00391         (*ppData) += 2;
00392         *R = ((Pixel & 0xF800)>>8) + 4;
00393         *G = ((Pixel & 0x07E0)>>3) + 2;
00394         *B = ((Pixel & 0x001F)<<3) + 4;
00395         *A = 255;
00396 }

void Get_8bitGray uint8 **  ppData,
int *  R,
int *  G,
int *  B,
int *  A
 

Definition at line 267 of file pixelformat.c.

References A, B, G, R, and V.

00268 {
00269 int V;
00270         V = **ppData;
00271         (*ppData) += 1;
00272         *R = *G = *B = V; *A = 255;
00273 }

void Get_nada uint8 **  ppData,
int *  R,
int *  G,
int *  B,
int *  A
 

Definition at line 294 of file pixelformat.c.

00295 {
00296 }

uint32 GetPixel_16bit uint8 **  ppData  ) 
 

Definition at line 205 of file pixelformat.c.

References uint16, and uint32.

00206 {
00207 uint32 pel;
00208         pel = *((uint16 *)(*ppData));
00209         (*ppData) += 2;
00210 return pel;
00211 }

uint32 GetPixel_24bit uint8 **  ppData  ) 
 

Definition at line 219 of file pixelformat.c.

References uint32.

00220 {
00221 uint32 pel;
00222         pel  = (*ppData)[0] <<16;
00223         pel += (*ppData)[1] << 8;
00224         pel += (*ppData)[2];
00225         (*ppData) += 3;
00226 return pel;
00227 }

uint32 GetPixel_32bit uint8 **  ppData  ) 
 

Definition at line 237 of file pixelformat.c.

References uint32.

00238 {
00239 uint32 pel;
00240         pel = *((uint32 *)(*ppData));
00241         (*ppData) += 4;
00242 return pel;
00243 }

uint32 GetPixel_8bit uint8 **  ppData  ) 
 

Definition at line 191 of file pixelformat.c.

References uint32, and uint8.

00192 {
00193 uint32 pel;
00194         pel = *((uint8 *)(*ppData));
00195         (*ppData) += 1;
00196 return pel;
00197 }

int NumBitsOn uint32  val  )  [static]
 

Definition at line 144 of file pixelformat.c.

References count, and uint32.

Referenced by geBitmap_ChooseDriverFormat(), geBitmap_FixDriverFlags(), and gePixelFormat_HasGoodAlpha().

00145 {
00146 uint32 count = 0;
00147         while(val)
00148         {
00149                 count += val&1;
00150                 val >>= 1;
00151         }
00152 return count;
00153 }

void Put_1555 uint8 **  ppData,
int  R,
int  G,
int  B,
int  A
 

Definition at line 499 of file pixelformat.c.

References A, B, G, R, and uint16.

00500 {
00501 uint16 Pixel;
00502         Pixel = ((A>>7)<<15) + ( ((R>>3)<<10) + ((G>>3)<<5) + ((B>>3)) );
00503         *((uint16 *)*ppData) = Pixel;
00504         (*ppData) += 2;
00505 }

void Put_24bgr uint8 **  ppData,
int  R,
int  G,
int  B,
int  A
 

Definition at line 567 of file pixelformat.c.

References B, G, R, and uint8.

00568 {
00569 uint8 * ptr = *ppData;
00570         ptr[0] = B;
00571         ptr[1] = G;
00572         ptr[2] = R;
00573         *ppData = ptr + 3;
00574 }

void Put_24rgb uint8 **  ppData,
int  R,
int  G,
int  B,
int  A
 

Definition at line 534 of file pixelformat.c.

References B, G, R, and uint8.

00535 {
00536 uint8 * ptr = *ppData;
00537         ptr[0] = R;
00538         ptr[1] = G;
00539         ptr[2] = B;
00540         *ppData = ptr + 3;
00541 }

void Put_32abgr uint8 **  ppData,
int  R,
int  G,
int  B,
int  A
 

Definition at line 818 of file pixelformat.c.

References A, B, G, and R.

00819 {
00820         **ppData = R; (*ppData) += 1;
00821         **ppData = G; (*ppData) += 1;
00822         **ppData = B; (*ppData) += 1;
00823         **ppData = A; (*ppData) += 1;
00824 }

void Put_32argb uint8 **  ppData,
int  R,
int  G,
int  B,
int  A
 

Definition at line 758 of file pixelformat.c.

References A, B, G, and R.

00759 {
00760         **ppData = B; (*ppData) += 1;
00761         **ppData = G; (*ppData) += 1;
00762         **ppData = R; (*ppData) += 1;
00763         **ppData = A; (*ppData) += 1;
00764 }

void Put_32bgra uint8 **  ppData,
int  R,
int  G,
int  B,
int  A
 

Definition at line 788 of file pixelformat.c.

References A, B, G, and R.

00789 {
00790         **ppData = A; (*ppData) += 1;
00791         **ppData = R; (*ppData) += 1;
00792         **ppData = G; (*ppData) += 1;
00793         **ppData = B; (*ppData) += 1;
00794 }

void Put_32bgrx uint8 **  ppData,
int  R,
int  G,
int  B,
int  A
 

Definition at line 665 of file pixelformat.c.

References B, G, and R.

00666 {
00667         (*ppData) += 1;
00668         **ppData = R; (*ppData) += 1;
00669         **ppData = G; (*ppData) += 1;
00670         **ppData = B; (*ppData) += 1;
00671 }

void Put_32rgba uint8 **  ppData,
int  R,
int  G,
int  B,
int  A
 

Definition at line 728 of file pixelformat.c.

References A, B, G, and R.

00729 {
00730         **ppData = A; (*ppData) += 1;
00731         **ppData = B; (*ppData) += 1;
00732         **ppData = G; (*ppData) += 1;
00733         **ppData = R; (*ppData) += 1;
00734 }

void Put_32rgbx uint8 **  ppData,
int  R,
int  G,
int  B,
int  A
 

Definition at line 603 of file pixelformat.c.

References B, G, and R.

00604 {
00605         (*ppData) += 1;
00606         **ppData = B; (*ppData) += 1;
00607         **ppData = G; (*ppData) += 1;
00608         **ppData = R; (*ppData) += 1;
00609 }

void Put_32xbgr uint8 **  ppData,
int  R,
int  G,
int  B,
int  A
 

Definition at line 696 of file pixelformat.c.

References B, G, and R.

00697 {
00698         **ppData = R; (*ppData) += 1;
00699         **ppData = G; (*ppData) += 1;
00700         **ppData = B; (*ppData) += 1;
00701         (*ppData) += 1;
00702 }

void Put_32xrgb uint8 **  ppData,
int  R,
int  G,
int  B,
int  A
 

Definition at line 634 of file pixelformat.c.

References B, G, and R.

00635 {
00636         **ppData = B; (*ppData) += 1;
00637         **ppData = G; (*ppData) += 1;
00638         **ppData = R; (*ppData) += 1;
00639         (*ppData) += 1;
00640 }

void Put_4444 uint8 **  ppData,
int  R,
int  G,
int  B,
int  A
 

Definition at line 466 of file pixelformat.c.

References A, B, G, R, and uint16.

00467 {
00468 uint16 Pixel;
00469         Pixel = ((A>>4)<<12) + ((R>>4)<<8) + ((G>>4)<<4) + (B>>4);
00470         *((uint16 *)*ppData) = Pixel;
00471         (*ppData) += 2;
00472 }

void Put_555bgr uint8 **  ppData,
int  R,
int  G,
int  B,
int  A
 

Definition at line 362 of file pixelformat.c.

References B, G, R, and uint16.

00363 {
00364 uint16 Pixel;
00365         Pixel = ( ((B>>3)<<10) + ((G>>3)<<5) + ((R>>3)) );
00366         *((uint16 *)*ppData) = Pixel;
00367         (*ppData) += 2;
00368 }

void Put_555rgb uint8 **  ppData,
int  R,
int  G,
int  B,
int  A
 

Definition at line 329 of file pixelformat.c.

References B, G, R, and uint16.

00330 {
00331 uint16 Pixel;
00332         Pixel = ( ((R>>3)<<10) + ((G>>3)<<5) + ((B>>3)) );
00333         *((uint16 *)*ppData) = Pixel;
00334         (*ppData) += 2;
00335 }

void Put_565bgr uint8 **  ppData,
int  R,
int  G,
int  B,
int  A
 

Definition at line 431 of file pixelformat.c.

References B, G, R, and uint16.

00432 {
00433 uint16 Pixel;
00434         Pixel = ( ((B>>3)<<11) + ((G>>2)<<5) + ((R>>3)) );
00435         *((uint16 *)*ppData) = Pixel;
00436         (*ppData) += 2;
00437 }

void Put_565rgb uint8 **  ppData,
int  R,
int  G,
int  B,
int  A
 

Definition at line 398 of file pixelformat.c.

References B, G, R, and uint16.

00399 {
00400 uint16 Pixel;
00401         Pixel = ( ((R>>3)<<11) + ((G>>2)<<5) + ((B>>3)) );
00402         *((uint16 *)*ppData) = Pixel;
00403         (*ppData) += 2;
00404 }

void Put_8bitGray uint8 **  ppData,
int  R,
int  G,
int  B,
int  A
 

Definition at line 275 of file pixelformat.c.

References B, G, R, RGB_to_Gray, and V.

00276 {
00277 int V;
00278         V = RGB_to_Gray(R,G,B);
00279         **ppData = V;
00280         (*ppData) += 1;
00281 }

void Put_nada uint8 **  ppData,
int  R,
int  G,
int  B,
int  A
 

Definition at line 298 of file pixelformat.c.

00299 {
00300 }

void PutPixel_16bit uint8 **  ppData,
uint32  Pixel
 

Definition at line 213 of file pixelformat.c.

References uint16.

00214 {
00215         *((uint16 *)(*ppData)) = (uint16)Pixel;
00216         (*ppData) += 2;
00217 }

void PutPixel_24bit uint8 **  ppData,
uint32  Pixel
 

Definition at line 229 of file pixelformat.c.

References uint8.

00230 {
00231         (*ppData)[0] = (uint8)(Pixel>>16);
00232         (*ppData)[1] = (uint8)(Pixel>>8);
00233         (*ppData)[2] = (uint8)(Pixel);
00234         (*ppData) += 3;
00235 }

void PutPixel_32bit uint8 **  ppData,
uint32  Pixel
 

Definition at line 245 of file pixelformat.c.

References uint32.

00246 {
00247         *((uint32 *)(*ppData)) = (uint32)Pixel;
00248         (*ppData) += 4;
00249 }

void PutPixel_8bit uint8 **  ppData,
uint32  Pixel
 

Definition at line 199 of file pixelformat.c.

References uint8.

00200 {
00201         *((uint8 *)(*ppData)) = (uint8)Pixel;
00202         (*ppData) += 1;
00203 }


Variable Documentation

const gePixelFormat_Operations * gePixelFormat_Operations_Array = gePixelFormat_Operations_Array_Def
 

Definition at line 866 of file pixelformat.c.

Referenced by gePixelFormat_BytesPerPel(), gePixelFormat_ComposePixel(), gePixelFormat_DecomposePixel(), gePixelFormat_Description(), gePixelFormat_GetColor(), gePixelFormat_GetOperations(), gePixelFormat_GetPixel(), gePixelFormat_HasAlpha(), gePixelFormat_HasGoodAlpha(), gePixelFormat_HasPalette(), gePixelFormat_IsRaw(), gePixelFormat_PutColor(), and gePixelFormat_PutPixel().

const gePixelFormat_Operations gePixelFormat_Operations_Array_Def[] [static]
 

Definition at line 829 of file pixelformat.c.


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