HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TIL_NullFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2024
3  * Side Effects Software Inc. All rights reserved.
4  *
5  * Redistribution and use of Houdini Development Kit samples in source and
6  * binary forms, with or without modification, are permitted provided that the
7  * following conditions are met:
8  * 1. Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  * 2. The name of Side Effects Software may not be used to endorse or
11  * promote products derived from this software without specific prior
12  * written permission.
13  *
14  * THIS SOFTWARE IS PROVIDED BY SIDE EFFECTS SOFTWARE `AS IS' AND ANY EXPRESS
15  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
17  * NO EVENT SHALL SIDE EFFECTS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
18  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
19  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
20  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
21  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
22  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
23  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24  *
25  */
26 
27 #ifndef __TIL_NullFilter__
28 #define __TIL_NullFilter__
29 
30 #include <PXL/PXL_Raster.h>
31 #include <TIL/TIL_RasterFilter.h>
32 #include <UT/UT_Debug.h>
33 
34 #ifdef _WIN32
35 # ifndef WIN32_LEAN_AND_MEAN
36 # define WIN32_LEAN_AND_MEAN
37 # endif
38 # include<windows.h>
39 #endif
40 
41 /// Sample code to install a pass-through Image Filter into Houdini
42 ///
43 /// These filters can be used in:
44 /// - Karma Image Filters
45 /// - The AI Denoise COP
46 /// - The @c idenoise application
47 /// For example, after the code is build, the filters should appear when
48 /// running <tt>idenoise -l</tt>.
49 ///
50 /// To make this example, you can run: @code
51 /// hcustom -i ~/houdini/dso/img_filter TIL_NullFilter.C
52 /// @endcode
53 ///
54 /// To test the filter, you can try: @code
55 /// % idenoise -d null_filter --options '{"verbose":1,"test":3.2}"' Mandril.pic x.exr
56 /// % idenoise -d null_filter --normal N --extra_aovs P --options '{"verbose":1}"' Snail.pic x.exr
57 /// @endcode
58 
59 class TIL_NullFilter final : public TIL_RasterFilter
60 {
61 public:
63  ~TIL_NullFilter() override;
64 
65  /// @{
66  /// Overridden methods from the base class
67  const char *className() const override { return "TIL_NullFilter"; }
68  bool setOptions(const UT_Options &argstr) override;
69  bool apply(PXL_Raster *raster) override;
70  void reset() override;
71  /// @}
72 
73  /// Since the filters run in a few milliseconds, they can be considered
74  /// interactive.
75  bool isInteractive() const override { return true; }
76 
77 private:
78  bool myVerbose;
79 };
80 
81 #endif
bool setOptions(const UT_Options &argstr) override
bool apply(PXL_Raster *raster) override
~TIL_NullFilter() override
const char * className() const override
HUSD_API const char * raster()
void reset() override
A map of string to various well defined value types.
Definition: UT_Options.h:84
bool isInteractive() const override