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
00042
00043
00044
00045 void noNewMPlay(bool enable);
00046
00047 virtual int open(const IMG_TileOptions &finfo,
00048 int xres, int yres, int twidth, int theight,
00049 fpreal aspect);
00050
00051 virtual int openMulti(IMG_TileOptionList &flist,
00052 int xres, int yres,
00053 int twidth, int theight, fpreal aspect);
00054
00055 virtual void setWhitePoint(fpreal w);
00056
00057 virtual void writeCustomTag(const char *tagname, int size,
00058 const char **values);
00059
00060 virtual int writeTile(const void *data, unsigned x0, unsigned x1,
00061 unsigned y0, unsigned y1);
00062 virtual void flush();
00063 virtual int close();
00064
00065
00066 int openDeep(const char *filename,
00067 const TIL_Sequence &info,
00068 int tilex, int tiley,
00069 bool startnew=false,
00070 const IMG_TileOptions *finfo=0);
00071
00072 int writeDeepTile(int plane_index, const void *data,
00073 int x0, int x1, int y0, int y1);
00074 void setStatusMsg(const char *msg);
00075
00076 bool isOpen() const { return mySocket && myPacket; }
00077 bool checkInterrupt() { drainSocket(); return isOpen(); }
00078
00079 virtual bool getMouseClickPosition(int &x, int &y) const;
00080
00081 void setMouseClickPosition(int x, int y)
00082 { myMouse[0] =x; myMouse[1] =y; }
00083
00084 void streakEdges(int x1, int y1, int x2, int y2,
00085 int plane = -1);
00086
00087 bool wasRemoteQuitRequested() { return myQuitFlag; }
00088
00089
00090 static void getLockFile(UT_WorkBuffer &buf, bool isflipbook,
00091 const char *label);
00092
00093 virtual void terminateOnConnectionLost(bool);
00094
00095 virtual bool wantsHoudiniPort() const { return true; }
00096
00097 static void enableColorCorrection(bool enable);
00098 static void setColorCorrectionLUT(bool enable, const char *lut);
00099 static void setColorCorrectionGamma(bool enable, fpreal gamma);
00100 private:
00101 int openSocket(int port, const char *label);
00102 void drainSocket();
00103 void clean();
00104
00105 private:
00106 void sendTileOptions(const IMG_TileOptions &options);
00107
00108 TIL_Sequence *mySequence;
00109 UT_Lock myWriteLock;
00110 bool myIsFlipbook;
00111 UT_IntArray myPlaneIndex;
00112 UT_IntArray myPlaneSize;
00113
00114 UT_NetSocket *mySocket;
00115 UT_NetPacket *myPacket;
00116 int myBPP, myMiddle;
00117 int myMouse[2];
00118 bool myQuitFlag;
00119 UT_StopWatch myFlushTimer;
00120 int myQueuedSize;
00121 bool myNoNewMPlayFlag;
00122 };
00123
00124 #endif