HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PXL_DeepSampleFilter.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: PXL_DeepSampleFilter.h (PXL Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __PXL_DeepSampleFilter__
12 #define __PXL_DeepSampleFilter__
13 
14 #include "PXL_API.h"
15 #include "PXL_Forward.h"
16 #include <UT/UT_IntrusivePtr.h>
17 #include <UT/UT_NonCopyable.h>
18 #include <UT/UT_StringHolder.h>
19 
20 /// This sample filter creates a new PXL_DeepsampleList from a source deep
21 /// sample list.
22 ///
23 /// Multiple filters can be chained together and applied after the
25  : public UT_IntrusiveRefCounter<PXL_DeepSampleFilter>
26 {
27 public:
29  virtual ~PXL_DeepSampleFilter();
30 
32 
33  /// Return the tuple size of the filtered result. This may be called
34  /// before the channel list is defined. It should return 0 if the channel
35  /// will be filtered out of the resulting samples.
36  ///
37  /// By default, the tuple size will remain unchanged.
38  virtual int filteredTupleSize(const char *name, int src_size) const;
39 
40  /// Update the channel list. This should call the protected setChannels().
41  /// It returns the channel list output by this filter.
43  const PXL_DeepChannelListPtr &ch)
44  {
45  doUpdateChannels(ch);
46  return myChannels;
47  }
48 
49  /// Modify the incoming sample list to create a new sample list
50  virtual PXL_DeepSampleListPtr filter(const PXL_DeepSampleListPtr &l) const = 0;
51 
52  /// Return the channel list after the filter has run
53  const PXL_DeepChannelListPtr &channels() const { return myChannels; }
54 
55  // Create a null filter. This passes through the channels and sample lists
56  static PXL_DeepSampleFilterPtr nullFilter();
57 
58  // Create filter to convert opacity to monochrome
60  monochrome(const UT_StringHolder &opac = UT_StringRef("Of"));
61 
62  // Create a filter to pre-composite samples
64  precomposite(const UT_StringHolder &opac = UT_StringRef("Of"));
65 
66  // Create a filter to uncomposite samples
68  uncomposite(const UT_StringHolder &opac = UT_StringRef("Of"));
69 
70 protected:
71  virtual void doUpdateChannels(const PXL_DeepChannelListPtr &ch) = 0;
72 
74  { myChannels = c; }
75 
76 protected:
78 };
79 
80 #endif
const PXL_DeepChannelListPtr & channels() const
Return the channel list after the filter has run.
PXL_DeepChannelListPtr myChannels
A reference counter base class for use with UT_IntrusivePtr.
#define PXL_API
Definition: PXL_API.h:10
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
GLuint const GLchar * name
Definition: glcorearb.h:786
const PXL_DeepChannelListPtr & updateChannels(const PXL_DeepChannelListPtr &ch)
void setChannels(const PXL_DeepChannelListPtr &c)
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glcorearb.h:1297