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  fpreal getGlobalTime() override;
25  fpreal getSampleRate() override;
26  fpreal getStartTime() override;
27  fpreal getEndTime() override;
28 
29  //
30  const char *getName() override;
31  void getFrameName(
32  int frame,
33  UT_String &name) override;
34  void getFullName(UT_String &name) override;
35  int doesImageExist(
36  int frame,
37  bool adjust = true) override;
38 
39  int equals(const TIL_ImageSource *) override;
40 
41  int open(short &key,
42  int reset = 0,
43  fpreal t = TIL_GLOBAL_TIME) override;
44  void close(short key) override;
45 
46  bool isNetwork() override;
47 
48  bool isConstantSequence() const override
49  { return true; }
50  const TIL_Sequence *getSequence(fpreal t) override;
51 
52  int getID() const override { return myID; }
53  UT_TokenString *getID(fpreal t, int xres, int yres,
54  const TIL_Plane &plane,
55  int array_index) override;
56 
57  void getImageBounds(const TIL_Plane &plane,
58  int array_index,
59  fpreal t, int xres, int yres,
60  int &x1, int &y1,
61  int &x2, int &y2) override;
62 
64  TIL_CookRegionList &regions) override
65  {}
66 
67  int getImage(
69  fpreal t, int xres, int yres,
70  const TIL_Plane &plane,
71  int array_index,
72  int xstart, int ystart,
73  int xend, int yend, float gamma,
74  bool include_alpha =false,
75  bool is_interactive=false,
76  int fxres = 0, int fyres = 0) override;
77 
78  void getInfo(UT_WorkBuffer &infotext) override;
79 
80  int writeImage(const char *filename,
81  const IMG_TileOptions *finfo,
82  const TIL_Sequence *, int step =1,
83  const char *uselut = 0,
84  float gamma = 1.0F,
85  void (*info)(void*, const char*)=0,
86  void *data=0,
87  bool suppress_summary_dialog=false,
88  bool adjust_color_space = true,
89  bool overwrite = false) override;
90 
91  int writeImage(const char *filename,
92  const IMG_TileOptions *finfo,
93  int xres, int yres,
94  const char *color,
95  const char *alpha,
96  int start, int end, int step =1,
97  const char *uselut = 0,
98  float gamma = 1.0F,
99  void (*info)(void*, const char*)=0,
100  void *data=0,
101  bool suppress_summary_dialog=false,
102  bool adjust_color_space = true,
103  bool overwrite = false) override;
104 
105  size_t getVersion() override;
106  int isFrameLocked(fpreal t) override;
107  int isAnythingLocked() override;
108  int isPlaneLocked(
109  const TIL_Plane *,
110  fpreal t) override;
111  const TIL_Plane *getPreviewPlane(int index) override;
112 
113 
114  virtual int canModifyImage() { return 1; }
115  virtual int useHandles() { return 1; }
116 
117  COP2_Node *getCop() const { return isValid()?myCop:0; }
118  COP2_Node *getCop() { return isValid()?myCop:0; }
119 
120  bool isSlowOperation() const override
121  { return isValid() ? myCop->isSlowOperation():false; }
122 
124  fpreal t, bool shift_only=false,
125  const TIL_Sequence *ref = 0) override;
126  int getFrameShift(
127  int fr, bool shift_only=false,
128  const TIL_Sequence *ref = 0) override;
129 
130  bool getColorCurves(const char *planename,
131  int array, fpreal t,
132  TIL_ColorCurves &curves,
133  UT_String &first,
134  bool allnodes, int comp=-1,
135  bool natural_range = true,
136  float start = 0.0f,
137  float end = 1.0f,
138  int evalpoints = 0) override;
139 
140  bool allowUserSelection() const override
141  { return false; }
142 
144  const char *planename,
145  int array_index) override;
146 
148  UT_WorkBuffer &buf) const override;
149 
150  int64 getMemoryUsage(bool inclusive) const override;
151 protected:
152  ~COP2_ImageSource() override;
153 private:
154 
155  COP2_Node *myCop;
156  int myID;
157  UT_TokenString *myLastToken;
158 };
159 
160 
161 #endif
GT_API const UT_StringHolder filename
GLenum GLint ref
Definition: glew.h:1845
COP2_Node * getCop() const
GLuint const GLchar * name
Definition: glew.h:1814
virtual bool getPreferredViewingPlane(UT_WorkBuffer &buf) const
GLclampf GLclampf GLclampf alpha
Definition: glew.h:1520
virtual fpreal getStartTime()=0
virtual const TIL_Sequence * getSequence(fpreal t)=0
GLuint index
Definition: glew.h:1814
virtual int isAnythingLocked()
bool isConstantSequence() const override
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
GLuint GLfloat GLfloat GLfloat x1
Definition: glew.h:12681
virtual fpreal getGlobalTime()=0
const GLint * first
Definition: glew.h:1528
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)
GLboolean reset
Definition: glew.h:4959
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
GLenum GLsizei GLenum GLenum const void * image
Definition: glew.h:4943
int getID() const override
bool isValid() const
virtual const TIL_Plane * getPreviewPlane(int)
GLclampf f
Definition: glew.h:3499
#define TIL_GLOBAL_TIME
virtual int useHandles()
GLint GLenum GLsizei GLint GLsizei const void * data
Definition: glew.h:1379
virtual int doesImageExist(int, bool=true)
GLuint GLuint end
Definition: glew.h:1253
virtual int getFrameShift(int fr, bool=false, const TIL_Sequence *=0)
void getCookRegions(TIL_CookRegionList &regions) override
virtual void close(short)
long long int64
Definition: SYS_Types.h:116
virtual int isFrameLocked(fpreal)
virtual fpreal getEndTime()=0
GLuint color
Definition: glew.h:7902
GLuint start
Definition: glew.h:1253
IFDmantra py
Definition: HDK_Image.dox:266
#define COP2_API
Definition: COP2_API.h:10
virtual TIL_ImageSource * selectParentSource(int px, int py, const char *planename, int array_index)
fpreal64 fpreal
Definition: SYS_Types.h:277
GLuint GLfloat GLfloat GLfloat GLfloat y1
Definition: glew.h:12681
virtual int64 getMemoryUsage(bool inclusive) const =0
virtual size_t getVersion()
GLenum array
Definition: glew.h:9066
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)
GLenum GLuint GLsizei const GLchar * buf
Definition: glew.h:2580
GLdouble GLdouble t
Definition: glew.h:1398
virtual int canModifyImage()
virtual const char * getName()=0
bool isSlowOperation() const override
bool allowUserSelection() const override
virtual void getFrameName(int frame, UT_String &name)