HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
COP2_PixelAdd.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  * A sample of a pixel operation. Pixel operations are those OPs which use the
27  * values from their plane and pixel location only to determine the output. For
28  * example, HSV and Gamma are Pixel Operations, whereas Blur (since it accesses
29  * neighbouring pixels) and Premultiply (since it requires both color and alpha
30  * planes) are not.
31  *
32  * Pixel Operations, when placed in series, are combined into 1 operation.
33  */
34 #ifndef _COP2_PIXEL_ADD_H_
35 #define _COP2_PIXEL_ADD_H_
36 
37 class RU_PixelFunction;
38 
39 #include <COP2/COP2_PixelOp.h>
40 
41 namespace HDK_Sample {
42 
44 {
45 public:
46 
47  static OP_Node *myConstructor(OP_Network*, const char *,
48  OP_Operator *);
53  static const char * myInputLabels[];
54 
55 protected:
56  /// This is the only function we need to override for a pixel function.
57  /// It returns our pixel function, which must be derived from
58  /// RU_PixelFunction.
60  float t, int, int,
61  int thread) override;
62 
63 private:
64  COP2_PixelAdd(OP_Network *parent, const char *name,
65  OP_Operator *entry);
66  ~COP2_PixelAdd() override;
67 
68  /// An optional method which returns a short description of what this node
69  /// does in the OP info popup.
70  const char *getOperationInfo() override;
71 
72  fpreal ADD(int comp, fpreal t)
73  { return evalFloat("addend",comp,t); }
74 };
75 
76 } // End HDK_Sample namespace
77 
78 #endif
static OP_Node * myConstructor(OP_Network *, const char *, OP_Operator *)
Definition: COP2_PixelAdd.C:76
static PRM_Template myTemplateList[]
Definition: COP2_PixelAdd.h:51
fpreal evalFloat(int pi, int vi, fpreal t) const
RU_PixelFunction * addPixelFunction(const TIL_Plane *, int, float t, int, int, int thread) override
static CH_LocalVariable myVariableList[]
Definition: COP2_PixelAdd.h:52
static const char * myInputLabels[]
Definition: COP2_PixelAdd.h:53
GLuint const GLchar * name
Definition: glcorearb.h:786
GLdouble t
Definition: glad.h:2397
**Note that the tasks the is the thread number *for the or if it s being executed by a non pool thread(this *can happen in cases where the whole pool is occupied and the calling *thread contributes to running the work load).**Thread pool.Have fun
static OP_TemplatePair myTemplatePair
Definition: COP2_PixelAdd.h:49
fpreal64 fpreal
Definition: SYS_Types.h:277
static OP_VariablePair myVariablePair
Definition: COP2_PixelAdd.h:50