CqOctree.h
上传用户:gzboli
上传日期:2013-04-10
资源大小:471k
文件大小:2k
- // CqOctree.h: interface for the CCqOctree class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_CQOCTREE_H__84037701_A3AA_462E_9A3F_137652C5B6DC__INCLUDED_)
- #define AFX_CQOCTREE_H__84037701_A3AA_462E_9A3F_137652C5B6DC__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- // structure use internally
- // store the necessary info of a node in octree
- 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
- }NODE;
- // Function prototypes
- //Global use, define it in dibapi.h
- //HPALETTE CreateOctreePalette (HDIB hDIB, UINT nMaxColors, UINT nColorBits)
- //HPALETTE CreateOctreePalette (LPSTR lpDIB, UINT nMaxColors, UINT nColorBits)
- //Local use only
- void AddColor (NODE**, BYTE, BYTE, BYTE, UINT, UINT, UINT*, NODE**);
- NODE* CreateNode (UINT, UINT, UINT*, NODE**);
- void ReduceTree (UINT, UINT*, NODE**);
- void DeleteTree (NODE**);
- void GetPaletteColors (NODE*, PALETTEENTRY*, UINT*);
- int GetRightShiftCount (DWORD);
- int GetLeftShiftCount (DWORD);
- #endif // !defined(AFX_CQOCTREE_H__84037701_A3AA_462E_9A3F_137652C5B6DC__INCLUDED_)