00001 /* 00002 * Copyright (c) 2012 00003 * Side Effects Software Inc. All rights reserved. 00004 * 00005 * Redistribution and use of Houdini Development Kit samples in source and 00006 * binary forms, with or without modification, are permitted provided that the 00007 * following conditions are met: 00008 * 1. Redistributions of source code must retain the above copyright notice, 00009 * this list of conditions and the following disclaimer. 00010 * 2. The name of Side Effects Software may not be used to endorse or 00011 * promote products derived from this software without specific prior 00012 * written permission. 00013 * 00014 * THIS SOFTWARE IS PROVIDED BY SIDE EFFECTS SOFTWARE `AS IS' AND ANY EXPRESS 00015 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 00016 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN 00017 * NO EVENT SHALL SIDE EFFECTS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, 00018 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00019 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 00020 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00021 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00022 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 00023 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00024 * 00025 *---------------------------------------------------------------------------- 00026 * A sample of a pixel operation. Pixel operations are those OPs which use the 00027 * values from their plane and pixel location only to determine the output. For 00028 * example, HSV and Gamma are Pixel Operations, whereas Blur (since it accesses 00029 * neighbouring pixels) and Premultiply (since it requires both color and alpha 00030 * planes) are not. 00031 * 00032 * Pixel Operations, when placed in series, are combined into 1 operation. 00033 */ 00034 #ifndef _COP2_PIXEL_ADD_H_ 00035 #define _COP2_PIXEL_ADD_H_ 00036 00037 class RU_PixelFunction; 00038 00039 #include <COP2/COP2_PixelOp.h> 00040 00041 namespace HDK_Sample { 00042 00043 class COP2_PixelAdd : public COP2_PixelOp 00044 { 00045 public: 00046 00047 static OP_Node *myConstructor(OP_Network*, const char *, 00048 OP_Operator *); 00049 static OP_TemplatePair myTemplatePair; 00050 static OP_VariablePair myVariablePair; 00051 static PRM_Template myTemplateList[]; 00052 static CH_LocalVariable myVariableList[]; 00053 static const char * myInputLabels[]; 00054 00055 protected: 00056 /// This is the only function we need to override for a pixel function. 00057 /// It returns our pixel function, which must be derived from 00058 /// RU_PixelFunction. 00059 virtual RU_PixelFunction *addPixelFunction(const TIL_Plane *, int, 00060 float t, int, int, 00061 int thread); 00062 00063 private: 00064 COP2_PixelAdd(OP_Network *parent, const char *name, 00065 OP_Operator *entry); 00066 virtual ~COP2_PixelAdd(); 00067 00068 /// An optional method which returns a short description of what this node 00069 /// does in the OP info popup. 00070 virtual const char *getOperationInfo(); 00071 00072 float ADD(int comp, float t) 00073 { return evalFloat("addend",comp,t); } 00074 }; 00075 00076 } // End HDK_Sample namespace 00077 00078 #endif
1.5.9