HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CHOP_Blend.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018
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  * Blends inputs 2,3,4... using the weights in input 1.
27  */
28 
29 #ifndef __CHOP_Blend__
30 #define __CHOP_Blend__
31 
32 #include <CHOP/CHOP_Node.h>
33 #include <UT/UT_VectorTypes.h>
34 
35 #define ARG_BLEND_DIFFERENCE (myParmBase +0)
36 #define ARG_BLEND_FIRST_WEIGHT (myParmBase +1)
37 
38 namespace HDK_Sample {
39 
40 class CHOP_Blend : public CHOP_Node
41 {
42 public:
43 
44 
45  static OP_Node *myConstructor(OP_Network*, const char *,
46  OP_Operator *);
51 
52  OP_ERROR cookMyChop(OP_Context &context);
53  virtual bool updateParmsFlags();
54 
55 protected:
56 
57  CHOP_Blend(OP_Network *net,
58  const char *name,
59  OP_Operator *op);
60  virtual ~CHOP_Blend();
61 
62 private:
63 
64  int GETDIFFERENCE()
65  { return evalInt(ARG_BLEND_DIFFERENCE,0,0); }
66 
67  int FIRST_WEIGHT()
68  { return evalInt(ARG_BLEND_FIRST_WEIGHT,0,0); }
69 
70  int findFirstAvailableTracks(OP_Context &context);
71  int findInputClips(OP_Context &context, const CL_Clip *blendclip);
72 
73  const CL_Clip *getCacheInputClip(int j);
74 
75 
76  UT_IntArray myAvailableTracks;
77  UT_FprealArray myTotalArray;
78  UT_ValArray<const CL_Clip *> myInputClip;
79 
80 };
81 
82 } // End HDK_Sample namespace
83 
84 #endif
85 
OP_ERROR cookMyChop(OP_Context &context)
Definition: CHOP_Blend.C:126
virtual bool updateParmsFlags()
Definition: CHOP_Blend.C:73
UT_ErrorSeverity
Definition: UT_Error.h:25
CHOP_Blend(OP_Network *net, const char *name, OP_Operator *op)
Definition: CHOP_Blend.C:104
static OP_Node * myConstructor(OP_Network *, const char *, OP_Operator *)
Definition: CHOP_Blend.C:94
static OP_TemplatePair myTemplatePair
Definition: CHOP_Blend.h:47
static OP_VariablePair myVariablePair
Definition: CHOP_Blend.h:48
static CH_LocalVariable myVariableList[]
Definition: CHOP_Blend.h:50
GLuint const GLchar * name
Definition: glcorearb.h:785
#define ARG_BLEND_DIFFERENCE
Definition: CHOP_Blend.h:35
#define ARG_BLEND_FIRST_WEIGHT
Definition: CHOP_Blend.h:36
static PRM_Template myTemplateList[]
Definition: CHOP_Blend.h:49
exint evalInt(int pi, int vi, fpreal t) const