Files
Work/mdiwin/CONVEX.HPP
2024-08-07 09:16:27 -04:00

62 lines
1.1 KiB
C++
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#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