RenderMan API  23.0
RixSampleFilter.h
Go to the documentation of this file.
1 /*
2 # ------------------------------------------------------------------------------
3 #
4 # Copyright (c) 1986-2019 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 
38 #ifndef RixSampleFilter_h
39 #define RixSampleFilter_h
40 
41 #include "RixIntegrator.h" // for RixChannelId, etc
42 #include "RixInterfaces.h" // for RixContext
43 #include "RixShading.h" // for RixShadingPlugin, etc
44 #include "prmanapi.h" // for PRMANEXPORT
45 #include "ri.h" // for RtConstPointer, RtColorRGB, etc
46 
48 
54 
56 {
57 public:
58  virtual int GetInterface() const override { return k_RixSampleFilter; }
59 
64 
65  virtual void Filter(
67  RtPointer instanceData) = 0;
68 
69 protected:
71  virtual ~RixSampleFilter() {}
72 };
73 
74 // clang-format off
75 #define RIX_SAMPLEFILTERCREATE \
76  extern "C" PRMANEXPORT RixSampleFilter* CreateRixSampleFilter(RtConstString hint)
77 
78 #define RIX_SAMPLEFILTERDESTROY \
79  extern "C" PRMANEXPORT void DestroyRixSampleFilter(RixSampleFilter* filter)
80 // clang-format on
81 
83 {
84 public:
87 
93 
94  RtPoint2 const* screen;
95 
100 
101  float const* shutter;
102 
106 
108 
111 
112  int numGrps;
114 
118 
119  float const* depths;
120  int const* originals;
121 
125 
126  virtual bool Read(RixChannelId id, int sample, RtColorRGB &value) const = 0;
127  virtual bool Read(RixChannelId id, int sample, float &value) const = 0;
128  virtual bool Read(RixChannelId id, int sample, int &value) const = 0;
129 
130  virtual bool Write(RixChannelId id, int sample, RtColorRGB value) = 0;
131  virtual bool Write(RixChannelId id, int sample, float value) = 0;
132  virtual bool Write(RixChannelId id, int sample, int value) = 0;
133 
140 
141  virtual bool ReadRegion(RixChannelId id,
142  int regionMinX, int regionMaxX,
143  int regionMinY, int regionMaxY,
144  RtColorRGB *values) const = 0;
145  virtual bool ReadRegion(RixChannelId id,
146  int regionMinX, int regionMaxX,
147  int regionMinY, int regionMaxY,
148  float *values) const = 0;
149 
153 
154  virtual int GetAttribute(int sample, RtUString const name,
155  void *result, int resultLen,
156  RixInterface::Type *resultType,
157  int *resultCount) const = 0;
158 
161 
162  virtual bool IsEnabled(
163  RtConstPointer instance,
164  RtPointer* instanceData) const = 0;
165 
166 protected:
169 };
170 
171 #endif
pxrcore::ColorRGB RtColorRGB
void * RtPointer
Definition: ri.h:69
RtPoint2 const * screen
virtual int GetInterface() const override
pxrcore::UString RtUString
#define k_RixShadingVersion
Definition: RixShading.h:97
void const * RtConstPointer
Definition: ri.h:86
int numAllSamples
With extras add by RixDisplayServices::AddSample()
RixShadingContext const ** shadeCtxs
unsigned int RixChannelId
Definition: RixIntegrator.h:55
virtual ~RixSampleFilter()
RtRayGeometry const * rays
virtual void Filter(RixSampleFilterContext &fCtx, RtPointer instanceData)=0