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;
172 float myGamma = 1.0f;
178 bool myOCIOForward =
true;
179 bool myHoudiniAdjust =
true;
184 void bumpRefCount(
int i);
192 virtual fpreal getGlobalTime() =0;
193 virtual fpreal getSampleRate() =0;
194 virtual fpreal getStartTime() =0;
195 virtual fpreal getEndTime() =0;
202 int getImageIndexFromTime(
fpreal t);
203 int getFrameFromTime(
fpreal t);
232 virtual const char *
getName() = 0;
254 bool skip_postprocessor =
false)
256 if (myPostprocessor && myPostprocessor->isEnabled() &&
258 return myPostprocessor->getSequence(t, options);
260 return getSourceSequence(t, options);
275 return getSequence(t, getDefaultOptions(), skip_postprocessor);
291 bool skip_postprocessor =
false)
293 if (myPostprocessor && myPostprocessor->isEnabled() &&
295 myPostprocessor->getImageBounds(
296 plane, array_index, t, xres, yres, options, x1, y1, x2, y2);
298 getSourceImageBounds(
299 plane, array_index, t, xres, yres, options, x1, y1, x2, y2);
302 virtual void getSourceImageBounds(
const TIL_Plane &plane,
320 virtual int getID()
const = 0;
328 int xstart,
int ystart,
329 int xend,
int yend,
float gamma,
331 bool include_alpha =
false,
332 bool is_interactive =
false,
333 int fxres = 0,
int fyres = 0,
334 bool skip_postprocessor =
false)
336 if (myPostprocessor && myPostprocessor->isEnabled() &&
338 return myPostprocessor->getImage(
339 image, t, xres, yres, plane, array_index, xstart, ystart, xend,
340 yend, gamma, options, include_alpha, is_interactive, fxres,
343 return getSourceImage(
344 image, t, xres, yres, plane, array_index, xstart, ystart, xend,
345 yend, gamma, options, include_alpha, is_interactive, fxres,
353 int xstart,
int ystart,
354 int xend,
int yend,
float gamma,
356 bool include_alpha =
false,
357 bool is_interactive =
false,
368 virtual int writeImage(
const char *
filename,
372 const ColorSpace &cspace,
373 void (*info)(
void*,
const char*),
375 bool suppress_summary_dialog,
378 virtual int writeImage(
const char *filename,
384 const ColorSpace &cspace,
385 void (*info)(
void*,
const char*),
387 bool suppress_summary_dialog,
390 virtual void writeImageComplete(
int successcount,
404 fpreal )
const {
return false; }
407 virtual void setMouseLocation(
int mx,
int my,
408 float radius = 64.0
f);
413 virtual bool getColorCurves(
const char *planename,
417 bool allnodes,
int comp=-1,
418 bool natural_range =
true,
426 const char *planename,
431 virtual bool hasPixelScript(
int slot)
const;
432 virtual bool runPixelScript(
int px,
int py,
int slot);
436 virtual bool isStereoscopicSource(
fpreal t)
const;
437 virtual int getLeftPlaneIndex(
fpreal t)
const;
438 virtual const char *getLeftPlaneName(
fpreal t)
const;
439 virtual int getRightPlaneIndex(
fpreal t)
const;
440 virtual const char *getRightPlaneName(
fpreal t)
const;
443 virtual int64 getMemoryUsage(
bool inclusive)
const = 0;
446 virtual const IMG_Metadata *getMetadata(
int frame)
const = 0;
486 template <
typename T,
typename... Args>
490 std::is_convertible_v<T*, TIL_ImageSourcePostprocessor*>,
491 "T must inherit from the TIL_ImageSourcePostprocessor interface.");
492 myPostprocessor = UTmakeUnique<T>(*
this, std::forward<Args>(
args)...);
493 return static_cast<T*
>(myPostprocessor.get());
500 {
return myPostprocessor.get(); }
504 {
return myPostprocessor.get(); }
527 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.
*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)