DIB.INL
资源名称:DXGuide.zip [点击查看]
上传用户:wymy58
上传日期:2007-01-07
资源大小:2086k
文件大小:1k
源码类别:
DirextX编程
开发平台:
Visual C++
- // Copyright (C) 1999 DXGuide. All Rights Reserved.
- // File: DIB.inl
- // Inlines for CDIB
- inline bool CDIB::IsValid(void) const
- {
- return (m_pBMI != NULL);
- }
- inline int CDIB::GetBitsPerPixel(void) const
- {
- ASSERT(m_pBMI != NULL);
- return m_pBMI->bmiHeader.biBitCount;
- }
- inline void CDIB::GetRect(RECT* pRect) const
- {
- pRect->top = pRect->left = 0;
- pRect->bottom = GetHeight();
- pRect->right = GetWidth();
- }
- inline int CDIB::GetNumClrEntries(void) const
- {
- ASSERT(m_pBMI != NULL);
- return NumDIBColorEntries(m_pBMI);
- }
- inline RGBQUAD* CDIB::GetClrTabAddress(void) const
- {
- ASSERT(m_pBMI != NULL);
- return (LPRGBQUAD)(((BYTE*)(m_pBMI)) + sizeof(BITMAPINFOHEADER));
- }
- // This function gets the size required to store the DIB's
- // palette by multiplying the number of colors by the size of
- // an RGBQUAD
- inline DWORD CDIB::GetPaletteSize(void) const
- {
- return GetNumClrEntries() * sizeof(RGBQUAD);
- }
- inline const BITMAPINFO* CDIB::GetBitmapInfoAddress(void) const
- {
- return m_pBMI;
- }