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_StringHolder.h>
17 #include <UT/UT_IntrusivePtr.h>
18 
19 /// This sample filter creates a new PXL_DeepsampleList from a source deep
20 /// sample list.
21 ///
22 /// Multiple filters can be chained together and applied after the
24  : public UT_IntrusiveRefCounter<PXL_DeepSampleFilter>
25 {
26 public:
28  virtual ~PXL_DeepSampleFilter();
29 
30  /// Return the tuple size of the filtered result. This may be called
31  /// before the channel list is defined. It should return 0 if the channel
32  /// will be filtered out of the resulting samples.
33  ///
34  /// By default, the tuple size will remain unchanged.
35  virtual int filteredTupleSize(const char *name, int src_size) const;
36 
37  /// Update the channel list. This should call the protected setChannels().
38  /// It returns the channel list output by this filter.
40  const PXL_DeepChannelListPtr &ch)
41  {
42  doUpdateChannels(ch);
43  return myChannels;
44  }
45 
46  /// Modify the incoming sample list to create a new sample list
47  virtual PXL_DeepSampleListPtr filter(const PXL_DeepSampleListPtr &l) const = 0;
48 
49  /// Return the channel list after the filter has run
50  const PXL_DeepChannelListPtr &channels() const { return myChannels; }
51 
52  // Create a null filter. This passes through the channels and sample lists
53  static PXL_DeepSampleFilterPtr nullFilter();
54 
55  // Create filter to convert opacity to monochrome
57  monochrome(const UT_StringHolder &opac = UT_StringRef("Of"));
58 
59  // Create a filter to pre-composite samples
61  precomposite(const UT_StringHolder &opac = UT_StringRef("Of"));
62 
63  // Create a filter to uncomposite samples
65  uncomposite(const UT_StringHolder &opac = UT_StringRef("Of"));
66 
67 protected:
68  virtual void doUpdateChannels(const PXL_DeepChannelListPtr &ch) = 0;
69 
71  { myChannels = c; }
72 
73 protected:
75 };
76 
77 #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
GLuint const GLchar * name
Definition: glcorearb.h:785
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:1296