00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __TIL_TileMPlay_H__
00021 #define __TIL_TileMPlay_H__
00022
00023 #include "TIL_API.h"
00024 class TIL_Sequence;
00025 class TIL_Tile;
00026 class UT_NetPacket;
00027 class UT_NetSocket;
00028
00029 #include <UT/UT_IntArray.h>
00030 #include <UT/UT_Lock.h>
00031 #include <UT/UT_SysClone.h>
00032 #include <UT/UT_StopWatch.h>
00033 #include <IMG/IMG_TileDevice.h>
00034
00035 class TIL_API TIL_TileMPlay : public IMG_TileDevice
00036 {
00037 public:
00038 TIL_TileMPlay(int middle, bool isflipbook);
00039 virtual ~TIL_TileMPlay();
00040
00041 virtual int open(const IMG_TileOptions &finfo,
00042 int xres, int yres, int twidth, int theight,
00043 fpreal aspect);
00044
00045 virtual int openMulti(IMG_TileOptionList &flist,
00046 int xres, int yres,
00047 int twidth, int theight, fpreal aspect);
00048
00049 virtual void setWhitePoint(fpreal w);
00050
00051 virtual void writeCustomTag(const char *tagname, int size,
00052 const char **values);
00053
00054 virtual int writeTile(const void *data, unsigned x0, unsigned x1,
00055 unsigned y0, unsigned y1);
00056 virtual void flush();
00057 virtual int close();
00058
00059
00060 int openDeep(const char *filename,
00061 const TIL_Sequence &info,
00062 int tilex, int tiley,
00063 bool startnew=false,
00064 const IMG_TileOptions *finfo=0);
00065
00066 int writeDeepTile(int plane_index, const void *data,
00067 int x0, int x1, int y0, int y1);
00068 void setStatusMsg(const char *msg);
00069
00070 bool isOpen() const { return mySocket && myPacket; }
00071 bool checkInterrupt() { drainSocket(); return isOpen(); }
00072
00073 virtual bool getMouseClickPosition(int &x, int &y) const;
00074
00075 void setMouseClickPosition(int x, int y)
00076 { myMouse[0] =x; myMouse[1] =y; }
00077
00078 void streakEdges(int x1, int y1, int x2, int y2,
00079 int plane = -1);
00080
00081 bool wasRemoteQuitRequested() { return myQuitFlag; }
00082
00083
00084 static void getLockFile(UT_WorkBuffer &buf, bool isflipbook);
00085
00086 virtual void terminateOnConnectionLost(bool);
00087
00088 virtual bool wantsHoudiniPort() const { return true; }
00089
00090 static void enableColorCorrection(bool enable);
00091 static void setColorCorrectionLUT(bool enable, const char *lut);
00092 static void setColorCorrectionGamma(bool enable, fpreal gamma);
00093 private:
00094 int openSocket(int port);
00095 void drainSocket();
00096 void clean();
00097
00098 private:
00099 void sendTileOptions(const IMG_TileOptions &options);
00100
00101 TIL_Sequence *mySequence;
00102 UT_Lock myWriteLock;
00103 bool myIsFlipbook;
00104 UT_IntArray myPlaneIndex;
00105 UT_IntArray myPlaneSize;
00106
00107 UT_NetSocket *mySocket;
00108 UT_NetPacket *myPacket;
00109 int myBPP, myMiddle;
00110 int myMouse[2];
00111 bool myQuitFlag;
00112 UT_StopWatch myFlushTimer;
00113 int myQueuedSize;
00114 };
00115
00116 #endif