#ifndef _SPACIAL_HPP_ #define _SPACIAL_HPP_ //#include #include //#include //#include #include #include #include class SpacialTransform { public: SpacialTransform(HPALETTE hPalette,UHUGE *hpImage,WORD width,WORD height,WORD sizeFactor); virtual ~SpacialTransform(); HGLOBAL resizeImage(void); void cancelThread(void); WORD isCancelled(void)const; private: enum {MaxColors=256}; UINT nextPixel(void); void putPixel(void); void loadPaletteEntries(void); void processTransform(void); LONG mRedAccumulator; LONG mGreenAccumulator; LONG mBlueAccumulator; WORD mSizeFactor; WORD mInverseFactor; UINT mInSegment; UINT mOutSegment; LONG mSrcWidth; LONG mSrcHeight; LONG mSrcExtent; LONG mDstWidth; LONG mDstHeight; LONG mDstExtent; LONG mCurrentRed; LONG mCurrentGreen; LONG mCurrentBlue; LONG mNextRed; LONG mNextGreen; LONG mNextBlue; LONG mNextPixelIndex; LONG mNextDestinationIndex; HGLOBAL mhGlobal; UHUGE *mhpImage; UHUGE *mhpDestinationImage; HPALETTE mhPalette; PALETTEENTRY mPaletteData[MaxColors]; WORD mIsInThread; Cache mSimpleCache; }; inline void SpacialTransform::loadPaletteEntries(void) { ::GetPaletteEntries(mhPalette,0,MaxColors,(PALETTEENTRY FAR *)&mPaletteData); } inline void SpacialTransform::cancelThread(void) { mIsInThread=FALSE; } inline WORD SpacialTransform::isCancelled(void)const { return !mIsInThread; } #endif