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_Cop2ImageSource.h (COP2 library, C++)
7  *
8  * COMMENTS:
9  * This is the derived class for a cop2 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,
83  const ColorSpace &cspace,
84  void (*info)(void*, const char*),
85  void *data,
86  bool suppress_summary_dialog,
87  bool overwrite) override;
88 
89  int writeImage(const char *filename,
90  const IMG_TileOptions *finfo,
91  int xres, int yres,
92  const char *color,
93  const char *alpha,
94  int start, int end, int step,
95  const ColorSpace &cspace,
96  void (*info)(void*, const char*),
97  void *data,
98  bool suppress_summary_dialog,
99  bool overwrite) override;
100 
101  size_t getVersion() override;
102  int isFrameLocked(fpreal t) override;
103  int isAnythingLocked() override;
104  int isPlaneLocked(
105  const TIL_Plane *,
106  fpreal t) override;
107  const TIL_Plane *getPreviewPlane(int index) override;
108 
109 
110  virtual int canModifyImage() { return 1; }
111  virtual int useHandles() { return 1; }
112 
113  COP2_Node *getCop2() const { return isValid()?myCop2:0; }
114  COP2_Node *getCop2() { return isValid()?myCop2:0; }
115 
116  bool isSlowOperation() const override
117  { return isValid() ? myCop2->isSlowOperation():false; }
118 
120  fpreal t, bool shift_only=false,
121  const TIL_Sequence *ref = 0) override;
122  int getFrameShift(
123  int fr, bool shift_only=false,
124  const TIL_Sequence *ref = 0) override;
125 
126  bool getColorCurves(const char *planename,
127  int array, fpreal t,
128  TIL_ColorCurves &curves,
129  UT_String &first,
130  bool allnodes, int comp=-1,
131  bool natural_range = true,
132  float start = 0.0f,
133  float end = 1.0f,
134  int evalpoints = 0) override;
135 
136  bool allowUserSelection() const override
137  { return false; }
138 
140  const char *planename,
141  int array_index) override;
142 
144  UT_WorkBuffer &buf) const override;
145 
146  int64 getMemoryUsage(bool inclusive) const override;
147 
148  OP_Node* getOp() const override
149  { return myCop2; }
150 
151 protected:
152  ~COP2_ImageSource() override;
153 private:
154 
155  COP2_Node *myCop2;
156  int myID;
157  UT_TokenString *myLastToken;
158 };
159 
160 
161 #endif
GLint first
Definition: glcorearb.h:405
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2540
GT_API const UT_StringHolder filename
virtual bool getPreferredViewingPlane(UT_WorkBuffer &buf) const
virtual fpreal getStartTime()=0
virtual const TIL_Sequence * getSequence(fpreal t)=0
COP2_Node * getCop2()
GLuint start
Definition: glcorearb.h:475
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
virtual fpreal getGlobalTime()=0
virtual int isPlaneLocked(const TIL_Plane *, fpreal)
GLenum GLenum GLsizei void * image
Definition: glad.h:5132
virtual int equals(const TIL_ImageSource *)=0
virtual fpreal getFrameTime(fpreal t, bool=false, const TIL_Sequence *=0)
OP_Node * getOp() const override
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
GLdouble GLdouble x2
Definition: glad.h:2349
int getID() const override
bool isValid() const
GLfloat f
Definition: glcorearb.h:1926
GLboolean reset
Definition: glad.h:5138
virtual const TIL_Plane * getPreviewPlane(int)
GLint ref
Definition: glcorearb.h:124
#define TIL_GLOBAL_TIME
virtual int useHandles()
virtual int doesImageExist(int, bool=true)
GLuint GLuint end
Definition: glcorearb.h:475
GLdouble y1
Definition: glad.h:2349
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
GLfloat GLfloat GLfloat alpha
Definition: glcorearb.h:112
virtual int isFrameLocked(fpreal)
GLuint const GLchar * name
Definition: glcorearb.h:786
virtual fpreal getEndTime()=0
GLdouble t
Definition: glad.h:2397
IFDmantra py
Definition: HDK_Image.dox:266
#define COP2_API
Definition: COP2_API.h:10
COP2_Node * getCop2() const
virtual TIL_ImageSource * selectParentSource(int px, int py, const char *planename, int array_index)
GLuint color
Definition: glcorearb.h:1261
fpreal64 fpreal
Definition: SYS_Types.h:277
GLuint index
Definition: glcorearb.h:786
virtual int64 getMemoryUsage(bool inclusive) const =0
virtual size_t getVersion()
virtual int writeImage(const char *filename, const IMG_TileOptions *finfo, const TIL_Sequence *, int step, const ColorSpace &cspace, void(*info)(void *, const char *), void *data, bool suppress_summary_dialog, bool overwrite)
class OCIOEXPORT ColorSpace
virtual bool isNetwork()
virtual int open(short &, int=0, fpreal=TIL_GLOBAL_TIME)
GLdouble GLdouble GLdouble y2
Definition: glad.h:2349
virtual void getInfo(UT_WorkBuffer &infotext)
virtual int canModifyImage()
virtual const char * getName()=0
Definition: format.h:895
bool isSlowOperation() const override
bool allowUserSelection() const override
virtual void getFrameName(int frame, UT_String &name)