/* flip - pageflipper for TIFF animations * Copyright (C) 1999 Mark B. Allan (mba@reptilelabour.com) * * "flip" is free software; you can redistribute it and/or use * it and/or modify it under the terms of the "Artistic License" */ #ifndef TiffFlip_h #define TiffFlip_h #include #include #include #include #include #include #include class TiffFlip : public QWidget { Q_OBJECT public: TiffFlip(QWidget *parent = 0, const char* name = 0); ~TiffFlip(); int LoadImages(const char* filename, int maxFrames = 10000, int z = 1); inline int GetNumFrames() { return numFrames; } inline int GetMaxFrames() { return maxFrames; } inline int GetWidth() { return (int)width; } inline int GetHeight() { return (int)height; } inline bool isLoading() { return timer.isActive(); } inline int getFileHeight() { return origHeight; } inline int getFileWidth() { return origWidth; } inline int getOrigWidth() { return origWidth; } inline int getOrigHeight() { return origHeight; } inline const char *getBaseString() { return baseString; } inline void setCurMinFrame(int in) { curMinFrame = in; } inline void setCurMaxFrame(int in) { curMaxFrame = in; } inline int getCurMinFrame() { return curMinFrame; } inline int getCurMaxFrame() { return curMaxFrame; } void Reset(); void SetDisplayZoom(int); bool checkMem(); bool getMemUsage(float* mem, float* swap); void checkProcessMemory(); void showMemInfo(bool status); public slots: void SetFrame (int); void abortLoad(); signals: void Done(int, bool done); void LoadingFrame(int); protected: void drawPixmap(); void paintEvent(QPaintEvent * ); void LoadSingleImage(); void LoadFinished(); void OutOfMemory(); private slots: void LoadController(); private: QWMatrix m; int loadZoom; int displayZoom; QTimer timer; QPixmap **pixlist; int frame; int numFrames; int maxFrames; int loadFrame; int startFrame; QString baseString; QString dotTif; uint width; uint height; uint origWidth; uint origHeight; int curMinFrame; int curMaxFrame; int flipPID; bool doMemCheck; float begSwap; float begMem; float curSwap; float curMem; float swapThresh; QLabel *memLabel; QLabel *swapLabel; QString memString; QString swapString; }; #endif // TiffFlip_h