HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
COP2_ImageSource.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: COP2_CopImageSource.h (COP2 library, C++)
7  *
8  * COMMENTS:
9  * This is the derived class for a cop image source for TIL.
10  */
11 #ifndef COP2_IMAGESOURCE_H
12 #define COP2_IMAGESOURCE_H
13 
14 #include "COP2_API.h"
15 #include <TIL/TIL_ImageSource.h>
16 #include "COP2_Node.h"
17 
19 {
20 public:
22 
23  // global stuff...
24  virtual fpreal getGlobalTime();
25  virtual fpreal getSampleRate();
26  virtual fpreal getStartTime();
27  virtual fpreal getEndTime();
28 
29  //
30  virtual const char *getName();
31  virtual void getFrameName(int frame, UT_String &name);
32  virtual void getFullName(UT_String &name);
33  virtual int doesImageExist(int frame, bool adjust = true);
34 
35  virtual int equals(const TIL_ImageSource *);
36 
37  virtual int open(short &key,
38  int reset = 0,
40  virtual void close(short key);
41 
42  virtual bool isNetwork();
43 
44  virtual bool isConstantSequence() const { return true; }
45  virtual const TIL_Sequence *getSequence(fpreal t);
46 
47  virtual int getID() const { return myID; }
48  virtual UT_TokenString *getID(fpreal t, int xres, int yres,
49  const TIL_Plane &plane,
50  int array_index);
51 
52  virtual void getImageBounds(const TIL_Plane &plane,
53  int array_index,
54  fpreal t, int xres, int yres,
55  int &x1, int &y1,
56  int &x2, int &y2);
57 
58  virtual void getCookRegions(TIL_CookRegionList &regions)
59  {}
60 
61  virtual int getImage(TIL_Raster *image,
62  fpreal t, int xres, int yres,
63  const TIL_Plane &plane,
64  int array_index,
65  int xstart, int ystart,
66  int xend, int yend, float gamma,
67  bool include_alpha =false,
68  bool is_interactive=false,
69  int fxres = 0, int fyres = 0);
70 
71  virtual void getInfo(UT_WorkBuffer &infotext);
72 
73  virtual int writeImage(const char *filename,
74  const IMG_TileOptions *finfo,
75  const TIL_Sequence *, int step =1,
76  const char *uselut = 0,
77  float gamma = 1.0F,
78  void (*info)(void*, const char*)=0,
79  void *data=0,
80  bool suppress_summary_dialog=false,
81  bool adjust_color_space = true,
82  bool overwrite = false);
83 
84  virtual int writeImage(const char *filename,
85  const IMG_TileOptions *finfo,
86  int xres, int yres,
87  const char *color,
88  const char *alpha,
89  int start, int end, int step =1,
90  const char *uselut = 0,
91  float gamma = 1.0F,
92  void (*info)(void*, const char*)=0,
93  void *data=0,
94  bool suppress_summary_dialog=false,
95  bool adjust_color_space = true,
96  bool overwrite = false);
97 
98  virtual size_t getVersion();
99  virtual int isFrameLocked(fpreal t);
100  virtual int isAnythingLocked();
101  virtual int isPlaneLocked(const TIL_Plane *, fpreal t);
102  virtual const TIL_Plane *getPreviewPlane(int index);
103 
104 
105  virtual int canModifyImage() { return 1; }
106  virtual int useHandles() { return 1; }
107 
108  COP2_Node *getCop() const { return isValid()?myCop:0; }
109  COP2_Node *getCop() { return isValid()?myCop:0; }
110 
111  virtual bool isSlowOperation() const
112  { return isValid() ? myCop->isSlowOperation():false; }
113 
114  virtual fpreal getFrameTime(fpreal t, bool shift_only=false,
115  const TIL_Sequence * /*ref*/ =0);
116  virtual int getFrameShift(int fr, bool shift_only=false,
117  const TIL_Sequence * /*ref*/ =0);
118 
119  virtual bool getColorCurves(const char *planename,
120  int array, fpreal t,
121  TIL_ColorCurves &curves,
122  UT_String &first,
123  bool allnodes, int comp=-1,
124  bool natural_range = true,
125  float start = 0.0f,
126  float end = 1.0f,
127  int evalpoints = 0);
128 
129  virtual bool allowUserSelection() const { return false; }
130 
131  virtual TIL_ImageSource *selectParentSource(int px, int py,
132  const char *planename,
133  int array_index);
134 
135  virtual bool getPreferredViewingPlane(UT_WorkBuffer &buf) const;
136 
137  virtual int64 getMemoryUsage(bool inclusive) const;
138 protected:
139  virtual ~COP2_ImageSource();
140 private:
141 
142  COP2_Node *myCop;
143  int myID;
144  UT_TokenString *myLastToken;
145 };
146 
147 
148 #endif
GLint first
Definition: glcorearb.h:404
GT_API const UT_StringHolder filename
COP2_Node * getCop() const
virtual bool getPreferredViewingPlane(UT_WorkBuffer &buf) const
virtual fpreal getStartTime()=0
virtual bool isConstantSequence() const
virtual const TIL_Sequence * getSequence(fpreal t)=0
GLuint start
Definition: glcorearb.h:474
virtual int isAnythingLocked()
GLuint color
Definition: glcorearb.h:1260
virtual bool getColorCurves(const char *planename, int array, fpreal t, TIL_ColorCurves &curves, UT_String &first, bool allnodes, int comp=-1, bool natural_range=true, float start=0.0f, float end=1.0f, int evalpoints=0)
virtual void getImageBounds(const TIL_Plane &plane, int array_index, fpreal t, int xres, int yres, int &x1, int &y1, int &x2, int &y2)
virtual void getFullName(UT_String &name)=0
virtual int getID() const =0
virtual fpreal getGlobalTime()=0
virtual int isPlaneLocked(const TIL_Plane *, fpreal)
virtual int equals(const TIL_ImageSource *)=0
virtual fpreal getFrameTime(fpreal t, bool=false, const TIL_Sequence *=0)
virtual bool isSlowOperation() const
virtual int getImage(TIL_Raster *image, fpreal t, int xres, int yres, const TIL_Plane &plane, int array_index, int xstart, int ystart, int xend, int yend, float gamma, bool include_alpha=false, bool is_interactive=false, int fxres=0, int fyres=0)=0
virtual fpreal getSampleRate()=0
png_bytepp image
Definition: png.h:1849
long long int64
Definition: SYS_Types.h:107
bool isValid() const
GLfloat f
Definition: glcorearb.h:1925
virtual void getCookRegions(TIL_CookRegionList &regions)
virtual const TIL_Plane * getPreviewPlane(int)
virtual int getID() const
#define TIL_GLOBAL_TIME
virtual int useHandles()
virtual int doesImageExist(int, bool=true)
GLuint GLuint end
Definition: glcorearb.h:474
virtual int getFrameShift(int fr, bool=false, const TIL_Sequence *=0)
virtual void close(short)
GLfloat GLfloat GLfloat alpha
Definition: glcorearb.h:111
virtual int isFrameLocked(fpreal)
GLboolean * data
Definition: glcorearb.h:130
virtual fpreal getEndTime()=0
GLuint const GLchar * name
Definition: glcorearb.h:785
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2539
IFDmantra py
Definition: HDK_Image.dox:266
double fpreal
Definition: SYS_Types.h:270
#define COP2_API
Definition: COP2_API.h:10
virtual TIL_ImageSource * selectParentSource(int px, int py, const char *planename, int array_index)
GLuint index
Definition: glcorearb.h:785
virtual int64 getMemoryUsage(bool inclusive) const =0
virtual size_t getVersion()
virtual bool allowUserSelection() const
virtual int writeImage(const char *filename, const IMG_TileOptions *finfo, const TIL_Sequence *, int step=1, const char *uselut=0, float gamma=1.0F, void(*info)(void *, const char *)=0, void *data=0, bool suppress_summary_dialog=false, bool adjust_color_space=true, bool overwrite=false)
virtual bool isNetwork()
virtual int open(short &, int=0, fpreal=TIL_GLOBAL_TIME)
COP2_Node * getCop()
virtual void getInfo(UT_WorkBuffer &infotext)
virtual int canModifyImage()
virtual const char * getName()=0
virtual void getFrameName(int frame, UT_String &name)