HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TIL_HuskDevice.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: TIL_HuskDevice.h (TIL Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __TIL_HuskDevice__
12 #define __TIL_HuskDevice__
13 
14 #include "TIL_API.h"
15 #include <UT/UT_Array.h>
16 #include <UT/UT_Rect.h>
17 #include <UT/UT_SharedPtr.h>
18 #include <UT/UT_Vector2.h>
19 #include <UT/UT_UniquePtr.h>
20 #include <UT/UT_NonCopyable.h>
21 
22 class PXL_Raster;
23 class IMG_FileParms;
24 class IMG_Stat;
25 class UT_Options;
26 
27 extern "C"
28 {
29  /// The DSO should call @c TIL_HuskDevice::setDefaultFactory() to override
30  /// the default husk display device.
32 }
33 
35 {
36 public:
38 
40  {
41  Factory() = default;
42  virtual ~Factory();
44 
45  virtual TIL_HuskDevicePtr create() const = 0;
46  };
47 
48  /// Register the default factory
49  static void setDefaultFactory(UT_UniquePtr<Factory> factory);
50 
51  /// Return the default device (may be a @c nullptr)
52  static TIL_HuskDevicePtr createDefault();
53 
54  TIL_HuskDevice() = default;
55  virtual ~TIL_HuskDevice();
57 
58  /// If supported, return the current pixel location where the user has
59  /// clicked the mouse. husk can pass this through to the render delegate.
60  ///
61  /// Returns @c false if not supported or if the position passed in is the
62  /// same as the last click.
63  virtual bool getMousePosition(UT_Vector2i &pos) const;
64 
65  /// Open a new device:
66  /// - @c stat contains the AOVs for the image (and contains metadata)
67  /// - @c parms contains additional file parameters
68  /// - @c creation_options contains creation options (like the frame range,
69  /// and mplay specific settings).
70  /// - @c update_options is a list of optional parameters containing stats
71  /// like `percentDone` or `renderStage`.
72  /// - @c display_scale is a scale to apply to the display of the rasters.
73  /// The scale will always be greater than 0 and less than or equal to 1.
74  /// - @c first_frame is set to true when this is the first frame of a
75  /// sequence (even if the sequence is on frame long).
76  virtual bool create(const IMG_Stat &stat,
77  const IMG_FileParms &parms,
78  const UT_Options &creation_options,
79  const UT_Options &update_options,
80  float display_scale,
81  bool first_frame) = 0;
82 
83  /// Update the display with the current rasters
84  /// - @c stat contains the AOVs for the image (and contains metadata)
85  /// - @c parms contains additional file parameters
86  /// - @c update_options is a list of optional parameters containing dynamic
87  /// stats like `percentDone` or `renderStage`.
88  /// - @c rasters is a list of the rasters to display
89  /// - @c active_buckets is a list of the active bucket regions that the
90  /// renderer provides to husk.
91  virtual void update(const UT_Array<PXL_Raster> &rasters,
92  const IMG_Stat &stat,
93  const IMG_FileParms &parms,
94  const UT_Options &update_options,
95  const UT_Array<UT_DimRect> &active_buckets) = 0;
96 };
97 
98 #endif
#define SYS_VISIBILITY_EXPORT
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
Definition: UT_UniquePtr.h:39
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
SYS_VISIBILITY_EXPORT void installHuskDisplay()
A map of string to various well defined value types.
Definition: UT_Options.h:84
GA_API const UT_StringHolder parms
File options for manipulating image data on load or save. This class allows you to modify the incomin...
Definition: IMG_FileParms.h:39
Contains the details of a specific image file, used by IMG_File. This class contains all the high-lev...
Definition: IMG_Stat.h:38
UT_UniquePtr< TIL_HuskDevice > TIL_HuskDevicePtr
#define TIL_API
Definition: TIL_API.h:10