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, const UT_Options &options) 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,
56  const UT_Options &options) override;
57 
58  void getImageBounds(const TIL_Plane &plane,
59  int array_index,
60  fpreal t, int xres, int yres,
61  const UT_Options &options,
62  int &x1, int &y1,
63  int &x2, int &y2) override;
64 
66  TIL_CookRegionList &regions) override
67  {}
68 
69  int getImage(
71  fpreal t, int xres, int yres,
72  const TIL_Plane &plane,
73  int array_index,
74  int xstart, int ystart,
75  int xend, int yend, float gamma,
76  const UT_Options &,
77  bool include_alpha =false,
78  bool is_interactive=false,
79  int fxres = 0, int fyres = 0) override;
80 
81  void getInfo(UT_WorkBuffer &infotext) override;
82 
83  int writeImage(const char *filename,
84  const IMG_TileOptions *finfo,
85  const TIL_Sequence *, int step,
86  const ColorSpace &cspace,
87  void (*info)(void*, const char*),
88  void *data,
89  bool suppress_summary_dialog,
90  bool overwrite) override;
91 
92  int writeImage(const char *filename,
93  const IMG_TileOptions *finfo,
94  int xres, int yres,
95  const char *color,
96  const char *alpha,
97  int start, int end, int step,
98  const ColorSpace &cspace,
99  void (*info)(void*, const char*),
100  void *data,
101  bool suppress_summary_dialog,
102  bool overwrite) override;
103 
104  size_t getVersion() override;
105  int isFrameLocked(fpreal t) override;
106  int isAnythingLocked() override;
107  int isPlaneLocked(
108  const TIL_Plane *,
109  fpreal t) override;
110  const TIL_Plane *getPreviewPlane(int index) override;
111 
112 
113  virtual int canModifyImage() { return 1; }
114  virtual int useHandles() { return 1; }
115 
116  COP2_Node *getCop2() const { return isValid()?myCop2:0; }
117  COP2_Node *getCop2() { return isValid()?myCop2:0; }
118 
119  bool isSlowOperation() const override
120  { return isValid() ? myCop2->isSlowOperation():false; }
121 
123  fpreal t, bool shift_only=false,
124  const TIL_Sequence *ref = 0) override;
125  int getFrameShift(
126  int fr, bool shift_only=false,
127  const TIL_Sequence *ref = 0) override;
128 
129  bool getColorCurves(const char *planename,
130  int array, fpreal t,
131  TIL_ColorCurves &curves,
132  UT_String &first,
133  bool allnodes, int comp=-1,
134  bool natural_range = true,
135  float start = 0.0f,
136  float end = 1.0f,
137  int evalpoints = 0) override;
138 
139  bool allowUserSelection() const override
140  { return false; }
141 
143  const char *planename,
144  int array_index) override;
145 
147  UT_WorkBuffer &buf) const override;
148 
149  int64 getMemoryUsage(bool inclusive) const override;
150 
151  OP_Node* getOp() const override
152  { return myCop2; }
153 
154 protected:
155  ~COP2_ImageSource() override;
156 private:
157 
158  COP2_Node *myCop2;
159  int myID;
160  UT_TokenString *myLastToken;
161 };
162 
163 
164 #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
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 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 void getImageBounds(const TIL_Plane &plane, int array_index, fpreal t, int xres, int yres, const UT_Options &options, int &x1, int &y1, int &x2, int &y2)
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 const TIL_Sequence * getSequence(fpreal t, const UT_Options &options)=0
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
A map of string to various well defined value types.
Definition: UT_Options.h:84
#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)
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, const UT_Options &, bool include_alpha=false, bool is_interactive=false, int fxres=0, int fyres=0)=0
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)