// DSDib.h: interface for the CDSDib class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_DSDIB_H__94CF36E1_E085_11D2_BC52_0020182948A1__INCLUDED_)
#define AFX_DSDIB_H__94CF36E1_E085_11D2_BC52_0020182948A1__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

#define  UPTO_DWORD(x)   (((x) & 0xfffffffc) + ((x) & 0x03 ? 4 : 0))

class CDSDib  
{
public:
   enum EDibColorMode {dcmNoParm=-1, dcm2=0, dcm8, dcm16, dcm24, dcm32}; 

	CDSDib();
   CDSDib(UINT nWidth, UINT nHeight, EDibColorMode mode);
	virtual ~CDSDib();

   BOOL            Create(UINT nWidth, UINT nheight, EDibColorMode mode);
   void            Free();

   BOOL            StretchDibBits();
//   BOOL            FillSolid(COLORREF rgb);
   void            FillBlack()               { if (m_pBitmapBits) ZeroMemory(m_pBitmapBits, m_nBytes); }

   UINT            GetWidth()                { return m_nWidth; }
   UINT            GetInternalWidth()        { return m_nInternalWidth; }
   UINT            GetHeight()               { return m_nHeight; }

   EDibColorMode   GetMode();
   int             PaletteSize(EDibColorMode mode = dcmNoParm);

   // public handles

   BYTE           *m_hDib;            // start of allocated memory
   BYTE           *m_pBitmapBits;     // pointer to start of bits


   UINT            m_nWidth;
   UINT            m_nHeight;
   UINT            m_nInternalWidth;
   UINT            m_nBytes;
   UINT            m_nHdrBytes;  // BITMAPINFOHEADER + palette
};

#endif // !defined(AFX_DSDIB_H__94CF36E1_E085_11D2_BC52_0020182948A1__INCLUDED_)
