62 lines
1.1 KiB
C++
62 lines
1.1 KiB
C++
#ifndef _CONVEX_HPP_
|
||
#define _CONVEX_HPP_
|
||
#include <mdiwin/windows.hpp>
|
||
#include <mdiwin/types.hpp>
|
||
|
||
class Convex
|
||
{
|
||
public:
|
||
Convex(void);
|
||
~Convex(void);
|
||
HGLOBAL performConvex(WORD &width,WORD &height,UHUGE *lpImage);
|
||
void cancelThread(void);
|
||
WORD isCancelled(void)const;
|
||
private:
|
||
void cartesianPoint(POINT &imagePoint)const;
|
||
void imagePoint(POINT &cartesianPoint)const;
|
||
void setPoint(int x,int y,POINT &somePoint)const;
|
||
void reportTime(void)const;
|
||
WORD yieldTask(void)const;
|
||
HGLOBAL emergencyCleanup(HGLOBAL hGlobalSource,HGLOBAL hGlobal)const;
|
||
|
||
WORD mIsInThread;
|
||
WORD mWidth;
|
||
WORD mHeight;
|
||
WORD mxHalf;
|
||
WORD myHalf;
|
||
};
|
||
|
||
inline
|
||
void Convex::cartesianPoint(POINT &imagePoint)const
|
||
{
|
||
imagePoint.x-=mxHalf;
|
||
imagePoint.y=(mHeight-1)-(myHalf+imagePoint.y);
|
||
}
|
||
|
||
inline
|
||
void Convex::imagePoint(POINT &cartesianPoint)const
|
||
{
|
||
cartesianPoint.x+=mxHalf;
|
||
cartesianPoint.y=(mHeight-1)-(myHalf+cartesianPoint.y);
|
||
}
|
||
|
||
inline
|
||
void Convex::setPoint(int x,int y,POINT &point)const
|
||
{
|
||
point.x=x;
|
||
point.y=y;
|
||
}
|
||
|
||
inline
|
||
void Convex::cancelThread(void)
|
||
{
|
||
mIsInThread=FALSE;
|
||
}
|
||
|
||
inline
|
||
WORD Convex::isCancelled(void)const
|
||
{
|
||
return !mIsInThread;
|
||
}
|
||
#endif
|
||
|