算法的总体流程如图2所示。
图2. 算法流程图
为实现以上算法,为CDib类添加了以下6个函数:
BOOL CDib::WritePart(const CPoint& m_LU, const CPoint& m_RB, CFile* pFile)
int CDib::RowByte(WORD biBitCount, int n_RowWidth)
BOOL CDib::GetParam(WORD biBitCount, const CPoint& m_LU, const CPoint& m_RB, int& n_StartByte, int& n_StartBit, int& n_EndByte, int& n_EndBit, int& n_OriRowByte, int& n_DesRowByte)
BOOL CDib::CopyRow(LPBYTE m_lpSrc, LPBYTE m_lpDes, int n_CopyByte,
int n_StartBit, int n_EndBit, int n_DesRowByte)
BYTE CDib::GetConstBYTE(short n)
BOOL CDib::ArrayLeftBitMove(LPBYTE lp_Array, int n_Size, short s_Move)
|