13 #ifndef TIL_IMAGESOURCE_H
14 #define TIL_IMAGESOURCE_H
27 #define TIL_GLOBAL_TIME (std::numeric_limits<fpreal>::infinity())
71 virtual void getImageBounds(
const TIL_Plane &plane,
76 int &
x2,
int &
y2) = 0;
82 int xstart,
int ystart,
83 int xend,
int yend,
float gamma,
87 int fxres,
int fyres) = 0;
93 virtual bool isEnabled()
const = 0;
126 setAutomatic(gamma, lut);
128 setManual(gamma, lut);
134 myHoudiniAdjust =
false;
142 myHoudiniAdjust =
true;
148 myMode = CS_OCIO_SPACE;
155 myMode = CS_OCIO_SPACE;
163 myMode = CS_OCIO_DISPLAY_VIEW;
164 myOCIODisplay = display;
166 myOCIOForward = forward;
175 float myGamma = 1.0f;
181 bool myOCIOForward =
true;
182 bool myHoudiniAdjust =
true;
187 void bumpRefCount(
int i);
195 virtual fpreal getGlobalTime() =0;
196 virtual fpreal getSampleRate() =0;
197 virtual fpreal getStartTime() =0;
198 virtual fpreal getEndTime() =0;
205 int getImageIndexFromTime(
fpreal t);
206 int getFrameFromTime(
fpreal t);
235 virtual const char *
getName() = 0;
259 bool skip_postprocessor =
false)
261 if (myPostprocessor && myPostprocessor->isEnabled() &&
263 return myPostprocessor->getSequence(t, options);
265 return getSourceSequence(t, options);
280 return getSequence(t, getDefaultOptions(), skip_postprocessor);
296 bool skip_postprocessor =
false)
298 if (myPostprocessor && myPostprocessor->isEnabled() &&
300 myPostprocessor->getImageBounds(
301 plane, array_index, t, xres, yres, options, x1, y1, x2, y2);
303 getSourceImageBounds(
304 plane, array_index, t, xres, yres, options, x1, y1, x2, y2);
307 virtual void getSourceImageBounds(
const TIL_Plane &plane,
325 virtual int getID()
const = 0;
333 int xstart,
int ystart,
334 int xend,
int yend,
float gamma,
336 bool include_alpha =
false,
337 bool is_interactive =
false,
338 int fxres = 0,
int fyres = 0,
339 bool skip_postprocessor =
false)
341 if (myPostprocessor && myPostprocessor->isEnabled() &&
343 return myPostprocessor->getImage(
344 image, t, xres, yres, plane, array_index, xstart, ystart, xend,
345 yend, gamma, options, include_alpha, is_interactive, fxres,
348 return getSourceImage(
349 image, t, xres, yres, plane, array_index, xstart, ystart, xend,
350 yend, gamma, options, include_alpha, is_interactive, fxres,
358 int xstart,
int ystart,
359 int xend,
int yend,
float gamma,
361 bool include_alpha =
false,
362 bool is_interactive =
false,
373 virtual int writeImage(
const char *
filename,
377 const ColorSpace &cspace,
378 void (*info)(
void*,
const char*),
380 bool suppress_summary_dialog,
383 virtual int writeImage(
const char *filename,
389 const ColorSpace &cspace,
390 void (*info)(
void*,
const char*),
392 bool suppress_summary_dialog,
395 virtual void writeImageComplete(
int successcount,
409 fpreal )
const {
return false; }
412 virtual void setMouseLocation(
int mx,
int my,
413 float radius = 64.0
f);
418 virtual bool getColorCurves(
const char *planename,
422 bool allnodes,
int comp=-1,
423 bool natural_range =
true,
431 const char *planename,
436 virtual bool hasPixelScript(
int slot)
const;
437 virtual bool runPixelScript(
int px,
int py,
int slot);
441 virtual bool isStereoscopicSource(
fpreal t)
const;
442 virtual int getLeftPlaneIndex(
fpreal t)
const;
443 virtual const char *getLeftPlaneName(
fpreal t)
const;
444 virtual int getRightPlaneIndex(
fpreal t)
const;
445 virtual const char *getRightPlaneName(
fpreal t)
const;
448 virtual int64 getMemoryUsage(
bool inclusive)
const = 0;
451 virtual const IMG_Metadata *getMetadata(
int frame)
const = 0;
491 template <
typename T,
typename... Args>
495 std::is_convertible_v<T*, TIL_ImageSourcePostprocessor*>,
496 "T must inherit from the TIL_ImageSourcePostprocessor interface.");
497 myPostprocessor = UTmakeUnique<T>(*
this, std::forward<Args>(
args)...);
498 return static_cast<T*
>(myPostprocessor.get());
505 {
return myPostprocessor.get(); }
509 {
return myPostprocessor.get(); }
532 bool isOpen()
const {
return myOpen; }
virtual bool isConstantSequence() const
virtual STY_StyleSheet * getStyleSheet(int x, int y)
GLenum GLuint GLenum GLsizei const GLchar * buf
virtual ~TIL_ImageSourcePostprocessor()
GT_API const UT_StringHolder filename
virtual bool getPreferredViewingPlane(UT_WorkBuffer &buf) const
const TIL_Sequence * getSequence(fpreal t, const UT_Options &options, bool skip_postprocessor=false)
Return a completed TIL_Sequence structure with postprocessing, if any.
virtual bool isArbitrarilyZoomable() const
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the and then *wait for them to all complete We provide a helper class
#define SYS_STATIC_ASSERT_MSG(expr, msg)
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 &options, bool include_alpha=false, bool is_interactive=false, int fxres=0, int fyres=0, bool skip_postprocessor=false)
const TIL_Sequence * getSequence(fpreal t, bool skip_postprocessor=false)
virtual void removeSequence()
virtual int getApparentFrame(int fr)
bool adjustColorSpace() const
TIL_ImageSource & getSource()
Get the source which this postprocessor is postprocessing.
virtual UT_StringHolder getTopRightCaption() const
virtual OP_Node * getOp() const
GLenum GLenum GLsizei void * image
virtual fpreal getFrameTime(fpreal t, bool=false, const TIL_Sequence *=0)
virtual void addFrame(int)
UT_StringHolder myOCIODest
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
UT_StringHolder myOCIOLook
UT_Array< TIL_CookRegion > TIL_CookRegionList
virtual bool allowUserSelection() const
UT_StringHolder myOCIODisplay
TIL_ImageSourcePostprocessor(TIL_ImageSource &source)
T * setPostprocessor(Args &&...args)
void setOCIO(const UT_StringHolder &dest, const UT_StringHolder &look=UT_StringHolder())
virtual const TIL_Plane * getPreviewPlane(int)
virtual bool getPriorityCircle(float ¢rex, float ¢rey, float &radius) const
virtual bool willProvideFetcher() const
PXL_API const char * getName(const ColorSpace *space)
Return the name of the color space.
virtual fpreal getRenderTime(int frame) const
GLsizei GLsizei GLchar * source
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
virtual int getFrameShift(int fr, bool=false, const TIL_Sequence *=0)
bool ocioAutomatic() const
virtual void close(short)
GLfloat GLfloat GLfloat alpha
virtual void onAutoUpdate()
GLuint const GLchar * name
virtual int getActualFrame(int frame)
virtual bool isPlaneLocked(const TIL_Plane *, fpreal) const
virtual bool isFrameLocked(fpreal) const
void setManual(float gamma, const UT_StringHolder &lut=UT_StringHolder())
virtual bool isSlowOperation() const
A map of string to various well defined value types.
cl_int getInfo(Func f, cl_uint name, T *param)
UT_StringHolder myOCIOView
virtual OP_Node * getMaterialNode(int x, int y)
void setAutomatic(float gamma, const UT_StringHolder &lut=UT_StringHolder())
virtual bool open(short &, int=0, fpreal=TIL_GLOBAL_TIME)
virtual UT_Options getDefaultOptions() const
virtual size_t getVersion()
virtual int64 getPeakMemUsage(int frame) const
**If you just want to fire and args
virtual bool canAddFrame()
virtual void bumpVersion(bool)
const TIL_ImageSourcePostprocessor * getPostprocessor() const
class OCIOEXPORT ColorSpace
GLdouble GLdouble GLdouble y2
void setAutomaticManual(bool convert_space, float gamma, const UT_StringHolder &lut)
virtual bool isAnythingLocked() const
virtual int getVersion() const
virtual void removeFrame(int)
virtual UT_StringHolder getBottomLeftCaption() const
UT_StringHolder myLUTFile
virtual bool getStyleSheetJSON(int x, int y, UT_StringHolder &str)
virtual bool isCachingNeeded(int) const
TIL_ImageSourcePostprocessor * getPostprocessor()
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, bool skip_postprocessor=false)
void setOCIODisplayView(const UT_StringHolder &display, const UT_StringHolder &view, bool forward=true)
virtual bool doesImageExist(int, bool=true)