RenderMan  26.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RixDisplayFilter.h
Go to the documentation of this file.
1 /*
2 # ------------------------------------------------------------------------------
3 #
4 # Copyright (c) 2020 Pixar. All rights reserved.
5 #
6 # The information in this file (the "Software") is provided for the exclusive
7 # use of the software licensees of Pixar ("Licensees"). Licensees have the
8 # right to incorporate the Software into other products for use by other
9 # authorized software licensees of Pixar, without fee. Except as expressly
10 # permitted herein, the Software may not be disclosed to third parties, copied
11 # or duplicated in any form, in whole or in part, without the prior written
12 # permission of Pixar.
13 #
14 # The copyright notices in the Software and this entire statement, including the
15 # above license grant, this restriction and the following disclaimer, must be
16 # included in all copies of the Software, in whole or in part, and all permitted
17 # derivative works of the Software, unless such copies or derivative works are
18 # solely in the form of machine-executable object code generated by a source
19 # language processor.
20 #
21 # PIXAR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
22 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL PIXAR BE
23 # LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
24 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
25 # OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
26 # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. IN NO CASE WILL
27 # PIXAR'S TOTAL LIABILITY FOR ALL DAMAGES ARISING OUT OF OR IN CONNECTION WITH
28 # THE USE OR PERFORMANCE OF THIS SOFTWARE EXCEED $50.
29 #
30 # Pixar
31 # 1200 Park Ave
32 # Emeryville CA 94608
33 #
34 # ------------------------------------------------------------------------------
35 */
36 
37 #ifndef RixDisplayFilter_h
38 #define RixDisplayFilter_h
39 
40 #include "RixIntegrator.h" // for RixChannelId
41 #include "RixInterfaces.h" // for RixContext
42 #include "RixShading.h" // for RixShadingPlugin, etc
43 #include "prmanapi.h" // for PRMANEXPORT
44 #include "RiTypesHelper.h" // for RtColorRGB
45 
47 
53 
55 {
56 public:
57  int GetInterface() const override { return k_RixDisplayFilter; }
58 
63 
64  virtual void Filter(
66  void* instanceData) = 0;
67 
68 protected:
70  ~RixDisplayFilter() override {}
71 };
72 
73 // clang-format off
74 #define RIX_DISPLAYFILTERCREATE \
75  extern "C" PRMANEXPORT RixDisplayFilter* CreateRixDisplayFilter(RtConstString hint)
76 
77 #define RIX_DISPLAYFILTERDESTROY \
78  extern "C" PRMANEXPORT void DestroyRixDisplayFilter(RixDisplayFilter* filter)
79 // clang-format on
80 
82 {
83 public:
86 
87  int xmin;
88  int xmax;
89  int ymin;
90  int ymax;
91 
95 
96  virtual bool Read(RixChannelId id, int x, int y, RtColorRGB &value) const = 0;
97  virtual bool Read(RixChannelId id, int x, int y, float &value) const = 0;
98  virtual bool Read(RixChannelId id, int x, int y, int &value) const = 0;
99 
100  virtual bool Write(RixChannelId id, int x, int y, RtColorRGB value) = 0;
101  virtual bool Write(RixChannelId id, int x, int y, float value) = 0;
102  virtual bool Write(RixChannelId id, int x, int y, int value) = 0;
103 
110 
111  virtual bool ReadRegion(RixChannelId id,
112  int regionMinX, int regionMaxX,
113  int regionMinY, int regionMaxY,
114  RtColorRGB *values) const = 0;
115  virtual bool ReadRegion(RixChannelId id,
116  int regionMinX, int regionMaxX,
117  int regionMinY, int regionMaxY,
118  float *values) const = 0;
119 
126  virtual bool IsEnabled(
127  void const* instance,
128  void** instanceData) const = 0;
129 
130 protected:
133 };
134 
135 #endif