Merged New Inventory Project into main branch

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1871 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
lalien
2008-03-08 15:15:25 +00:00
parent e16d166277
commit 43ca24dda8
649 changed files with 93359 additions and 82507 deletions
+27 -27
View File
@@ -2,42 +2,42 @@
#define __QUANTIZE_H_
typedef struct _NODE {
BOOL bIsLeaf; // TRUE if node has no children
UINT nPixelCount; // Number of pixels represented by this leaf
UINT nRedSum; // Sum of red components
UINT nGreenSum; // Sum of green components
UINT nBlueSum; // Sum of blue components
struct _NODE* pChild[8]; // Pointers to child nodes
struct _NODE* pNext; // Pointer to next reducible node
BOOL bIsLeaf; // TRUE if node has no children
UINT nPixelCount; // Number of pixels represented by this leaf
UINT nRedSum; // Sum of red components
UINT nGreenSum; // Sum of green components
UINT nBlueSum; // Sum of blue components
struct _NODE* pChild[8]; // Pointers to child nodes
struct _NODE* pNext; // Pointer to next reducible node
} NODE;
class CQuantizer
{
protected:
NODE* m_pTree;
UINT m_nLeafCount;
NODE* m_pReducibleNodes[9];
UINT m_nMaxColors;
UINT m_nColorBits;
NODE* m_pTree;
UINT m_nLeafCount;
NODE* m_pReducibleNodes[9];
UINT m_nMaxColors;
UINT m_nColorBits;
public:
CQuantizer (UINT nMaxColors, UINT nColorBits);
virtual ~CQuantizer ();
BOOL ProcessImage (BYTE *pData, int iWidth, int iHeight );
UINT GetColorCount ();
void GetColorTable (RGBQUAD* prgb);
CQuantizer (UINT nMaxColors, UINT nColorBits);
virtual ~CQuantizer ();
BOOL ProcessImage (BYTE *pData, int iWidth, int iHeight );
UINT GetColorCount ();
void GetColorTable (RGBQUAD* prgb);
protected:
int GetLeftShiftCount (DWORD dwVal);
int GetRightShiftCount (DWORD dwVal);
void AddColor (NODE** ppNode, BYTE r, BYTE g, BYTE b, UINT nColorBits,
UINT nLevel, UINT* pLeafCount, NODE** pReducibleNodes);
NODE* CreateNode (UINT nLevel, UINT nColorBits, UINT* pLeafCount,
NODE** pReducibleNodes);
void ReduceTree (UINT nColorBits, UINT* pLeafCount,
NODE** pReducibleNodes);
void DeleteTree (NODE** ppNode);
void GetPaletteColors (NODE* pTree, RGBQUAD* prgb, UINT* pIndex);
int GetLeftShiftCount (DWORD dwVal);
int GetRightShiftCount (DWORD dwVal);
void AddColor (NODE** ppNode, BYTE r, BYTE g, BYTE b, UINT nColorBits,
UINT nLevel, UINT* pLeafCount, NODE** pReducibleNodes);
NODE* CreateNode (UINT nLevel, UINT nColorBits, UINT* pLeafCount,
NODE** pReducibleNodes);
void ReduceTree (UINT nColorBits, UINT* pLeafCount,
NODE** pReducibleNodes);
void DeleteTree (NODE** ppNode);
void GetPaletteColors (NODE* pTree, RGBQUAD* prgb, UINT* pIndex);
};
#endif