00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef __TIL_CopResolver__
00028 #define __TIL_CopResolver__
00029
00030 #include "TIL_API.h"
00031 #include <UT/UT_PtrArray.h>
00032 #include <UT/UT_WorkBuffer.h>
00033 #include <IMG/IMG_FileTypes.h>
00034 #include "TIL_Defines.h"
00035
00036 #define TIL_DEFAULT_COLOR_PLANE "(Default Color)"
00037 #define TIL_DEFAULT_ALPHA_PLANE "(Default Alpha)"
00038 #define TIL_NO_PLANE "(None)"
00039
00040 class TIL_Raster;
00041 class UT_String;
00042
00043 class TIL_API TIL_CopResolver
00044 {
00045 public:
00046 TIL_CopResolver();
00047 virtual ~TIL_CopResolver();
00048
00049 static void setResolver(TIL_CopResolver *resolver);
00050 static TIL_CopResolver *getResolver();
00051
00052
00053 static TIL_Raster *getRaster(const char *fullpath,
00054 int &opid);
00055
00056 static void doneWithRaster(const TIL_Raster *r);
00057
00058
00059
00060 static int getIdFrame(const char *fullpath, int &id,
00061 float &frame);
00062 static void splitFile(const char *fullpath,
00063 UT_String &name,
00064 int &xres,int &yres,
00065 float &quality);
00066
00067
00068
00069 static int getNodeId(const char *net, const char *node);
00070 static void getNodeRes(const char *net, const char *node,
00071 int &xres, int &yres);
00072
00073 static int getNodeId(const char *fullpath);
00074 static void getNodeRes(const char *fullpath,
00075 int &xres, int &yres);
00076
00077 static void getFileRes(const char *file,
00078 int &xres, int &yres);
00079
00080 static int splitPath(const char *cpath, int &id,
00081 float &frame,
00082 UT_WorkBuffer &color, int &cindex,
00083 UT_WorkBuffer &alpha, int &aindex,
00084 int &xres, int &yres);
00085
00086
00087 static void buildColorMenu(const char *net,
00088 const char *node,
00089 UT_PtrArray<char *> &items);
00090
00091 static void buildAlphaMenu(const char *net,
00092 const char *node,
00093 UT_PtrArray<char *> &items);
00094
00095 static bool canResolve(const char *fullpath);
00096
00097
00098
00099 virtual int resolveId(const char *fullpath) = 0;
00100
00101 virtual TIL_Raster *resolveRaster(int id) = 0;
00102 virtual TIL_Raster *resolveRasterFrame(int id, float frame,
00103 int xres=0, int yres=0) = 0;
00104 virtual TIL_Raster *resolveRasterPlane(int id, float frame,
00105 const char *color, int cindex,
00106 const char *alpha, int aindex,
00107 int xres=0, int yres = 0,
00108 TIL_DataFormat f =
00109 TILE_MAX_DATA_FORMAT) = 0;
00110
00111
00112 virtual bool resolveIsPossible(const char *fullpath) = 0;
00113
00114 virtual TIL_Raster *getFileRaster(const char *file,
00115 IMG_DataType type = IMG_DT_ANY,
00116 int xres = 0, int yres = 0);
00117 virtual TIL_Raster *getNodeRaster(const char *fullpath,
00118 const char *cmenu, const char *amenu,
00119 bool override_frame = false,
00120 int frame = 1,
00121 TIL_DataFormat f =
00122 TILE_MAX_DATA_FORMAT);
00123
00124 virtual void getRes(int id, int &xres, int &yres);
00125
00126 virtual void buildPlaneMenu(const char *net, const char *node,
00127 UT_PtrArray<char *> &items);
00128
00129 virtual void returnRaster(const TIL_Raster *raster);
00130
00131
00132 virtual int isOpBased();
00133
00134 protected:
00135
00136
00137
00138 int splitPath(const char *fullpath,
00139 UT_String &name, float &frame);
00140 };
00141
00142 #endif