doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CDIB Class Reference

#include <CDIB.h>

Public Types

enum  BitmapType { BMP, GIF, TIFF }
 

Public Member Functions

 CDIB (HANDLE hDib=NULL, int nBits=8)
 
virtual ~CDIB ()
 
CDIBoperator= (CDIB &dib)
 
BOOL IsValid ()
 
void UseGamma (float fg, BOOL bUse=TRUE)
 
BOOL CreateFromHandle (HANDLE hDib, int nBits)
 
BOOL Create (int width, int height, int bits=24)
 
BOOL Create (BITMAPINFOHEADER &bmInfo)
 
BOOL CopyDIB (CDIB &dib)
 
BOOL OpenDIB (CString &fileName)
 
BOOL SaveDIB (CString &fileName, BitmapType type)
 
void ReplaceColor (unsigned char oldColor, unsigned char newColor)
 
HANDLE GetDIBits (int nStartX=-1, int nStartY=-1, int nCx=-1, int nCy=-1)
 
CBitmap * GetBitmap (CDC &dc)
 
CBitmap * GetTempBitmap (CDC &dc)
 
DWORD GetDIBSize ()
 
int GetPaletteSize (BITMAPINFOHEADER &bmInfo)
 
int GetPaletteSize ()
 
int CountColors ()
 
int EnumColors (BYTE *colors)
 
void InitDIB (COLORREF color)
 
void CopyLine (int source, int dest)
 
void DestroyDIB ()
 
void SetPalette (unsigned char *palette)
 
void SetPalette (RGBQUAD *pRGB)
 
COLORREF PaletteColor (int index)
 
void SetPixel (int x, int y, COLORREF color)
 
void SetPixel8 (int x, int y, unsigned char color)
 
COLORREF GetPixel (int x, int y)
 
void GetPixel (UINT x, UINT y, int &pixel)
 
void BitBlt (HDC hDest, int nXDest, int nYDest, int nWidth, int nHeight, int xSrc, int ySrc)
 
void BitBlt (int nXDest, int nYDest, int nWidth, int nHeight, CDIB &dibSrc, int nSrcX, int nSrcY, BYTE *colors=NULL)
 
void StretchBlt (HDC hDest, int nXDest, int nYDest, int nDWidth, int nDHeight, int xSrc, int ySrc, int nSWidth, int nSHeight)
 
void StretchBlt (int nXDest, int nYDest, int nDWidth, int nDHeight, CDIB &dibSrc, int xSrc, int ySrc, int nSWidth, int nSHeight)
 
void ExpandBlt (int nXDest, int nYDest, int xRatio, int yRatio, CDIB &dibSrc, int xSrc, int ySrc, int nSWidth, int nSHeight)
 
void SetFlags (int flag)
 
int Height ()
 
int Width ()
 
unsigned char * GetLinePtr (int line)
 
int GetBitCount ()
 
BOOL Make8Bit (CDIB &dib)
 
BOOL SwitchFromOne (CDIB &dib)
 
BOOL SwitchFromFour (CDIB &dib)
 
BOOL SwitchFrom24 (CDIB &dib)
 
BOOL SwitchPalette (CDIB &dib)
 
int ClosestColor (RGBQUAD *pRgb)
 
LPBITMAPINFO GetBitmapInfo ()
 

Static Public Member Functions

static unsigned int Distance (RGBQUAD &rgb1, RGBQUAD &rgb2)
 

Protected Member Functions

HANDLE DIBHandle ()
 
BOOL OpenBMP (CString &csFileName)
 
BOOL OpenGIF (CString &csFileName)
 
BOOL OpenTIFF (CString &csFileName)
 
BOOL SaveBMP (CString &csFileName)
 
BOOL SaveGIF (CString &csFileName)
 
BOOL SaveTIFF (CString &csFileName)
 
void CreateGammaCurve ()
 
void Expand (int nXDest, int nYDest, int xRatio, int yRatio, CDIB &dibSrc, int xSrc, int ySrc, int nSWidth, int nSHeight)
 

Protected Attributes

unsigned char * m_pBits
 
PBITMAPINFO m_pInfo
 
RGBQUAD * m_pRGB
 
voidm_pVoid
 
BYTE ** m_pLinePtr
 
int height
 
int bytes
 
int width
 
int m_nBits
 
int m_nFlags
 
BOOL m_bUseGamma
 
float m_fGamma
 
float m_fOldGamma
 
unsigned char Gamma [256]
 
RGBQUAD CacheQuad [256]
 
char CachePtr [256]
 

Detailed Description

Definition at line 35 of file CDIB.h.

Member Enumeration Documentation

Enumerator
BMP 
GIF 
TIFF 

Definition at line 37 of file CDIB.h.

Constructor & Destructor Documentation

CDIB::CDIB ( HANDLE  hDib = NULL,
int  nBits = 8 
)

Definition at line 54 of file CDIB.cpp.

CDIB::~CDIB ( )
virtual

Definition at line 66 of file CDIB.cpp.

Member Function Documentation

void CDIB::BitBlt ( HDC  hDest,
int  nXDest,
int  nYDest,
int  nWidth,
int  nHeight,
int  xSrc,
int  ySrc 
)

Definition at line 320 of file CDIB.cpp.

void CDIB::BitBlt ( int  nXDest,
int  nYDest,
int  nWidth,
int  nHeight,
CDIB dibSrc,
int  nSrcX,
int  nSrcY,
BYTE *  colors = NULL 
)

Definition at line 466 of file CDIB.cpp.

int CDIB::ClosestColor ( RGBQUAD *  pRgb)

Definition at line 814 of file CDIB.cpp.

BOOL CDIB::CopyDIB ( CDIB dib)

Definition at line 548 of file CDIB.cpp.

void CDIB::CopyLine ( int  source,
int  dest 
)

Definition at line 279 of file CDIB.cpp.

int CDIB::CountColors ( )

Definition at line 939 of file CDIB.cpp.

BOOL CDIB::Create ( int  width,
int  height,
int  bits = 24 
)

Definition at line 80 of file CDIB.cpp.

BOOL CDIB::Create ( BITMAPINFOHEADER &  bmInfo)

Definition at line 100 of file CDIB.cpp.

BOOL CDIB::CreateFromHandle ( HANDLE  hDib,
int  nBits 
)

Definition at line 622 of file CDIB.cpp.

void CDIB::CreateGammaCurve ( )
protected

Definition at line 668 of file CDIB.cpp.

void CDIB::DestroyDIB ( )

Definition at line 71 of file CDIB.cpp.

HANDLE CDIB::DIBHandle ( )
protected

Definition at line 601 of file CDIB.cpp.

unsigned int CDIB::Distance ( RGBQUAD &  rgb1,
RGBQUAD &  rgb2 
)
static

Definition at line 849 of file CDIB.cpp.

int CDIB::EnumColors ( BYTE *  colors)

Definition at line 962 of file CDIB.cpp.

void CDIB::Expand ( int  nXDest,
int  nYDest,
int  xRatio,
int  yRatio,
CDIB dibSrc,
int  xSrc,
int  ySrc,
int  nSWidth,
int  nSHeight 
)
protected

Definition at line 341 of file CDIB.cpp.

void CDIB::ExpandBlt ( int  nXDest,
int  nYDest,
int  xRatio,
int  yRatio,
CDIB dibSrc,
int  xSrc,
int  ySrc,
int  nSWidth,
int  nSHeight 
)

Definition at line 331 of file CDIB.cpp.

int CDIB::GetBitCount ( )
inline

Definition at line 82 of file CDIB.h.

CBitmap * CDIB::GetBitmap ( CDC &  dc)

Definition at line 247 of file CDIB.cpp.

LPBITMAPINFO CDIB::GetBitmapInfo ( )
inline

Definition at line 89 of file CDIB.h.

HANDLE CDIB::GetDIBits ( int  nStartX = -1,
int  nStartY = -1,
int  nCx = -1,
int  nCy = -1 
)

Definition at line 580 of file CDIB.cpp.

DWORD CDIB::GetDIBSize ( )

Definition at line 596 of file CDIB.cpp.

unsigned char * CDIB::GetLinePtr ( int  line)

Definition at line 540 of file CDIB.cpp.

int CDIB::GetPaletteSize ( BITMAPINFOHEADER &  bmInfo)

Definition at line 171 of file CDIB.cpp.

int CDIB::GetPaletteSize ( )

Definition at line 165 of file CDIB.cpp.

COLORREF CDIB::GetPixel ( int  x,
int  y 
)

Definition at line 216 of file CDIB.cpp.

void CDIB::GetPixel ( UINT  x,
UINT  y,
int pixel 
)

Definition at line 679 of file CDIB.cpp.

CBitmap * CDIB::GetTempBitmap ( CDC &  dc)

Definition at line 230 of file CDIB.cpp.

int CDIB::Height ( )
inline

Definition at line 79 of file CDIB.h.

void CDIB::InitDIB ( COLORREF  color)

Definition at line 290 of file CDIB.cpp.

BOOL CDIB::IsValid ( void  )
inline

Definition at line 46 of file CDIB.h.

BOOL CDIB::Make8Bit ( CDIB dib)

Definition at line 688 of file CDIB.cpp.

BOOL CDIB::OpenBMP ( CString &  csFileName)
protected

Definition at line 909 of file CDIB.cpp.

BOOL CDIB::OpenDIB ( CString &  fileName)

Definition at line 858 of file CDIB.cpp.

BOOL CDIB::OpenGIF ( CString &  csFileName)
protected
BOOL CDIB::OpenTIFF ( CString &  csFileName)
protected
CDIB & CDIB::operator= ( CDIB dib)

Definition at line 574 of file CDIB.cpp.

COLORREF CDIB::PaletteColor ( int  index)

Definition at line 985 of file CDIB.cpp.

void CDIB::ReplaceColor ( unsigned char  oldColor,
unsigned char  newColor 
)

Definition at line 559 of file CDIB.cpp.

BOOL CDIB::SaveBMP ( CString &  csFileName)
protected

Definition at line 890 of file CDIB.cpp.

BOOL CDIB::SaveDIB ( CString &  fileName,
BitmapType  type 
)

Definition at line 872 of file CDIB.cpp.

BOOL CDIB::SaveGIF ( CString &  csFileName)
protected
BOOL CDIB::SaveTIFF ( CString &  csFileName)
protected
void CDIB::SetFlags ( int  flag)
inline

Definition at line 78 of file CDIB.h.

void CDIB::SetPalette ( unsigned char *  palette)

Definition at line 132 of file CDIB.cpp.

void CDIB::SetPalette ( RGBQUAD *  pRGB)

Definition at line 156 of file CDIB.cpp.

void CDIB::SetPixel ( int  x,
int  y,
COLORREF  color 
)

Definition at line 187 of file CDIB.cpp.

void CDIB::SetPixel8 ( int  x,
int  y,
unsigned char  color 
)

Definition at line 201 of file CDIB.cpp.

void CDIB::StretchBlt ( HDC  hDest,
int  nXDest,
int  nYDest,
int  nDWidth,
int  nDHeight,
int  xSrc,
int  ySrc,
int  nSWidth,
int  nSHeight 
)

Definition at line 325 of file CDIB.cpp.

void CDIB::StretchBlt ( int  nXDest,
int  nYDest,
int  nDWidth,
int  nDHeight,
CDIB dibSrc,
int  xSrc,
int  ySrc,
int  nSWidth,
int  nSHeight 
)

Definition at line 387 of file CDIB.cpp.

BOOL CDIB::SwitchFrom24 ( CDIB dib)

Definition at line 992 of file CDIB.cpp.

BOOL CDIB::SwitchFromFour ( CDIB dib)

Definition at line 759 of file CDIB.cpp.

BOOL CDIB::SwitchFromOne ( CDIB dib)

Definition at line 736 of file CDIB.cpp.

BOOL CDIB::SwitchPalette ( CDIB dib)

Definition at line 789 of file CDIB.cpp.

void CDIB::UseGamma ( float  fg,
BOOL  bUse = TRUE 
)

Definition at line 659 of file CDIB.cpp.

int CDIB::Width ( )
inline

Definition at line 80 of file CDIB.h.

Member Data Documentation

int CDIB::bytes
protected

Definition at line 109 of file CDIB.h.

char CDIB::CachePtr[256]
protected

Definition at line 118 of file CDIB.h.

RGBQUAD CDIB::CacheQuad[256]
protected

Definition at line 117 of file CDIB.h.

unsigned char CDIB::Gamma[256]
protected

Definition at line 116 of file CDIB.h.

int CDIB::height
protected

Definition at line 108 of file CDIB.h.

BOOL CDIB::m_bUseGamma
protected

Definition at line 113 of file CDIB.h.

float CDIB::m_fGamma
protected

Definition at line 114 of file CDIB.h.

float CDIB::m_fOldGamma
protected

Definition at line 115 of file CDIB.h.

int CDIB::m_nBits
protected

Definition at line 111 of file CDIB.h.

int CDIB::m_nFlags
protected

Definition at line 112 of file CDIB.h.

unsigned char* CDIB::m_pBits
protected

Definition at line 103 of file CDIB.h.

PBITMAPINFO CDIB::m_pInfo
protected

Definition at line 104 of file CDIB.h.

BYTE** CDIB::m_pLinePtr
protected

Definition at line 107 of file CDIB.h.

RGBQUAD* CDIB::m_pRGB
protected

Definition at line 105 of file CDIB.h.

void* CDIB::m_pVoid
protected

Definition at line 106 of file CDIB.h.

int CDIB::width
protected

Definition at line 110 of file CDIB.h.


The documentation for this class was generated from the following files: