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  bool doesImageExist(
36  int frame,
37  bool adjust = true) override;
38 
39  bool equals(const TIL_ImageSource *) const override;
40 
41  bool 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; }
51  fpreal t,
52  const UT_Options &options) override;
53 
54  int getID() const override { return myID; }
55  UT_TokenString *getID(fpreal t, int xres, int yres,
56  const TIL_Plane &plane,
57  int array_index,
58  const UT_Options &options) override;
59 
61  const TIL_Plane &plane,
62  int array_index,
63  fpreal t, int xres, int yres,
64  const UT_Options &options,
65  int &x1, int &y1,
66  int &x2, int &y2) override;
67 
69  TIL_CookRegionList &regions) override
70  {}
71 
72  int getSourceImage(
74  fpreal t, int xres, int yres,
75  const TIL_Plane &plane,
76  int array_index,
77  int xstart, int ystart,
78  int xend, int yend, float gamma,
79  const UT_Options &,
80  bool include_alpha =false,
81  bool is_interactive=false,
82  int fxres = 0, int fyres = 0) override;
83 
84  void getInfo(UT_WorkBuffer &infotext) override;
85 
86  int writeImage(const char *filename,
87  const IMG_TileOptions *finfo,
88  const TIL_Sequence *, int step,
89  const ColorSpace &cspace,
90  void (*info)(void*, const char*),
91  void *data,
92  bool suppress_summary_dialog,
93  bool overwrite) override;
94 
95  int writeImage(const char *filename,
96  const IMG_TileOptions *finfo,
97  int xres, int yres,
98  const char *color,
99  const char *alpha,
100  int start, int end, int step,
101  const ColorSpace &cspace,
102  void (*info)(void*, const char*),
103  void *data,
104  bool suppress_summary_dialog,
105  bool overwrite) override;
106 
107  size_t getVersion() override;
108  bool isFrameLocked(fpreal t) const override;
109  bool isAnythingLocked() const override;
110  bool isPlaneLocked(
111  const TIL_Plane *,
112  fpreal t) const override;
113  const TIL_Plane *getPreviewPlane(int index) override;
114 
115 
116  virtual bool canModifyImage() { return true; }
117  virtual bool useHandles() { return true; }
118 
119  COP2_Node *getCop2() const { return isValid()?myCop2:0; }
120  COP2_Node *getCop2() { return isValid()?myCop2:0; }
121 
122  bool isSlowOperation() const override
123  { return isValid() ? myCop2->isSlowOperation():false; }
124 
126  fpreal t, bool shift_only=false,
127  const TIL_Sequence *ref = 0) override;
128  int getFrameShift(
129  int fr, bool shift_only=false,
130  const TIL_Sequence *ref = 0) override;
131 
132  bool getColorCurves(const char *planename,
133  int array, fpreal t,
134  TIL_ColorCurves &curves,
135  UT_String &first,
136  bool allnodes, int comp=-1,
137  bool natural_range = true,
138  float start = 0.0f,
139  float end = 1.0f,
140  int evalpoints = 0) override;
141 
142  bool allowUserSelection() const override
143  { return false; }
144 
146  const char *planename,
147  int array_index) override;
148 
150  UT_WorkBuffer &buf) const override;
151 
152  int64 getMemoryUsage(bool inclusive) const override;
153 
154  const IMG_Metadata *getMetadata(int frame) const override;
155 
156  OP_Node* getOp() const override
157  { return myCop2; }
158 
159 protected:
160  ~COP2_ImageSource() override;
161 private:
162 
163  COP2_Node *myCop2;
164  int myID;
165  UT_TokenString *myLastToken;
166 };
167 
168 
169 #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
bool isConstantSequence() const override
virtual void getSourceImageBounds(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 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 bool equals(const TIL_ImageSource *) const =0
GLenum GLenum GLsizei void * image
Definition: glad.h:5132
virtual fpreal getFrameTime(fpreal t, bool=false, const TIL_Sequence *=0)
OP_Node * getOp() const override
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
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
GLuint const GLchar * name
Definition: glcorearb.h:786
virtual fpreal getEndTime()=0
virtual bool isPlaneLocked(const TIL_Plane *, fpreal) const
virtual bool useHandles()
virtual bool isFrameLocked(fpreal) const
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)
virtual bool canModifyImage()
GLuint color
Definition: glcorearb.h:1261
fpreal64 fpreal
Definition: SYS_Types.h:278
GLuint index
Definition: glcorearb.h:786
virtual const TIL_Sequence * getSourceSequence(fpreal t, const UT_Options &options)=0
Return a completed TIL_Sequence structure without postprocessing.
virtual const IMG_Metadata * getMetadata(int frame) const =0
virtual bool open(short &, int=0, fpreal=TIL_GLOBAL_TIME)
virtual int64 getMemoryUsage(bool inclusive) const =0
virtual size_t getVersion()
Map of metadata items.
Definition: IMG_Metadata.h:217
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()
GLdouble GLdouble GLdouble y2
Definition: glad.h:2349
virtual bool isAnythingLocked() const
virtual void getInfo(UT_WorkBuffer &infotext)
virtual const char * getName()=0
Definition: format.h:1821
bool isSlowOperation() const override
bool allowUserSelection() const override
virtual int getSourceImage(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
virtual bool doesImageExist(int, bool=true)
virtual void getFrameName(int frame, UT_String &name)