00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef COP2_IMAGESOURCE_H
00020 #define COP2_IMAGESOURCE_H
00021
00022 #include "COP2_API.h"
00023 #include <TIL/TIL_ImageSource.h>
00024 #include "COP2_Node.h"
00025
00026 class COP2_API COP2_ImageSource : public TIL_ImageSource
00027 {
00028 public:
00029 COP2_ImageSource(COP2_Node *);
00030
00031
00032 virtual float getGlobalTime();
00033 virtual float getSampleRate();
00034 virtual float getStartTime();
00035 virtual float getEndTime();
00036
00037
00038 virtual const char *getName();
00039 virtual void getFrameName(int frame, UT_String &name);
00040 virtual void getFullName(UT_String &name);
00041 virtual int doesImageExist(int frame, bool adjust = true);
00042
00043 virtual int equals(const TIL_ImageSource *);
00044
00045 virtual int open(short &key,
00046 int reset = 0,
00047 float t = TIL_GLOBAL_TIME);
00048 virtual void close(short key);
00049
00050 virtual bool isNetwork();
00051
00052 virtual bool isConstantSequence() const { return true; }
00053 virtual const TIL_Sequence *getSequence(float t);
00054
00055 virtual int getID() const { return myID; }
00056 virtual UT_TokenString *getID(float t, int xres, int yres,
00057 const TIL_Plane &plane,
00058 int array_index);
00059
00060 virtual void getImageBounds(const TIL_Plane &plane,
00061 int array_index,
00062 float t, int xres, int yres,
00063 int &x1, int &y1,
00064 int &x2, int &y2);
00065
00066 virtual int getImage(TIL_Raster *image,
00067 float t, int xres, int yres,
00068 const TIL_Plane &plane,
00069 int array_index,
00070 int xstart, int ystart,
00071 int xend, int yend, float gamma,
00072 bool include_alpha =false,
00073 bool is_interactive=false,
00074 int fxres = 0, int fyres = 0);
00075
00076 virtual void getInfo(UT_WorkBuffer &infotext);
00077
00078 virtual int writeImage(const char *filename,
00079 const IMG_TileOptions *finfo,
00080 const TIL_Sequence *, int step =1,
00081 const char *uselut = 0,
00082 float gamma = 1.0F,
00083 void (*info)(void*, const char*)=0,
00084 void *data=0,
00085 bool suppress_summary_dialog=false);
00086
00087 virtual int writeImage(const char *filename,
00088 const IMG_TileOptions *finfo,
00089 int xres, int yres,
00090 const char *color,
00091 const char *alpha,
00092 int start, int end, int step =1,
00093 const char *uselut = 0,
00094 float gamma = 1.0F,
00095 void (*info)(void*, const char*)=0,
00096 void *data=0,
00097 bool suppress_summary_dialog=false);
00098
00099 virtual unsigned long getVersion();
00100 virtual int isFrameLocked(float t);
00101 virtual int isAnythingLocked();
00102 virtual int isPlaneLocked(const TIL_Plane *, float t);
00103 virtual const TIL_Plane *getPreviewPlane(int index);
00104
00105
00106 virtual int canModifyImage() { return 1; }
00107 virtual int useHandles() { return 1; }
00108
00109 COP2_Node *getCop() const { return isValid()?myCop:0; }
00110 COP2_Node *getCop() { return isValid()?myCop:0; }
00111
00112 virtual bool isSlowOperation() const
00113 { return isValid() ? myCop->isSlowOperation():false; }
00114
00115 virtual float getFrameTime(float t, bool shift_only=false,
00116 const TIL_Sequence * =0);
00117 virtual int getFrameShift(int fr, bool shift_only=false,
00118 const TIL_Sequence * =0);
00119
00120 virtual bool getColorCurves(const char *planename,
00121 int array, float t,
00122 TIL_ColorCurves &curves,
00123 UT_String &first,
00124 bool allnodes, int comp=-1,
00125 bool natural_range = true,
00126 float start = 0.0f,
00127 float end = 1.0f,
00128 int evalpoints = 0);
00129
00130 virtual bool allowUserSelection() const { return false; }
00131
00132 virtual TIL_ImageSource *selectParentSource(int px, int py,
00133 const char *planename,
00134 int array_index);
00135
00136 protected:
00137 virtual ~COP2_ImageSource();
00138 private:
00139
00140 COP2_Node *myCop;
00141 int myID;
00142 UT_TokenString *myLastToken;
00143 };
00144
00145
00146 #endif