#ifndef _SHEAR_HPP_ #define _SHEAR_HPP_ #include #include class Shear { public: Shear(void); ~Shear(); HGLOBAL performShear(WORD &width,WORD &height,double hFraction,double gFraction,UHUGE *lpImage); private: void calculateDimensions(WORD width,WORD height,double hFactor,double gFactor); void cartesianPoint(POINT &imagePoint)const; void imagePoint(POINT &cartesianPoint)const; void setPoint(int x,int y,POINT &point)const; WORD mSourceWidth; WORD mSourceHeight; WORD mxSourceHalf; WORD mySourceHalf; WORD mDestWidth; WORD mDestHeight; WORD mxDestHalf; WORD myDestHalf; }; inline Shear::Shear(void) { } inline Shear::~Shear() { } inline void Shear::cartesianPoint(POINT &imagePoint)const { imagePoint.x-=mxSourceHalf; imagePoint.y=mSourceHeight-(mySourceHalf+imagePoint.y)+1; } inline void Shear::imagePoint(POINT &cartesianPoint)const { double tempyFactor; cartesianPoint.x+=mxDestHalf; tempyFactor=(((double)mDestHeight/2.00)-1.00); cartesianPoint.y=mDestHeight-(cartesianPoint.y+tempyFactor); } inline void Shear::setPoint(int x,int y,POINT &point)const { point.x=x; point.y=y; } #endif