00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __COP2_Levels__
00020 #define __COP2_Levels__
00021
00022 #define ARG_LEVELS_GAMMA (myParmBase + 2)
00023 #define ARG_LEVELS_GAMMA_RED (myParmBase + 6)
00024 #define ARG_LEVELS_GAMMA_GREEN (myParmBase + 10)
00025 #define ARG_LEVELS_GAMMA_BLUE (myParmBase + 14)
00026 #define ARG_LEVELS_GAMMA_A (myParmBase + 18)
00027 #define ARG_LEVELS_GAMMA_W (myParmBase + 22)
00028
00029 #define ARG_LEVELS_INPUT (myParmBase + 1)
00030 #define ARG_LEVELS_RED_INPUT (myParmBase + 5)
00031 #define ARG_LEVELS_GREEN_INPUT (myParmBase + 9)
00032 #define ARG_LEVELS_BLUE_INPUT (myParmBase + 13)
00033 #define ARG_LEVELS_ALPHA_INPUT (myParmBase + 17)
00034 #define ARG_LEVELS_W_INPUT (myParmBase + 21)
00035
00036 #define ARG_LEVELS_OUTPUT (myParmBase + 4)
00037 #define ARG_LEVELS_RED_OUTPUT (myParmBase + 8)
00038 #define ARG_LEVELS_GREEN_OUTPUT (myParmBase + 12)
00039 #define ARG_LEVELS_BLUE_OUTPUT (myParmBase + 16)
00040 #define ARG_LEVELS_ALPHA_OUTPUT (myParmBase + 20)
00041 #define ARG_LEVELS_W_OUTPUT (myParmBase + 24)
00042
00043 #include "COP2_PixelOp.h"
00044
00045 class COP2_API COP2_Levels : public COP2_PixelOp
00046 {
00047 public:
00048
00049 static OP_Node *myConstructor(OP_Network*, const char *,
00050 OP_Operator *);
00051 static OP_TemplatePair myTemplatePair;
00052 static OP_VariablePair myVariablePair;
00053 static PRM_Template myTemplateList[];
00054 static CH_LocalVariable myVariableList[];
00055 static const char * myInputLabels[];
00056
00057 static const float theGammaMax;
00058 static const float theGammaMin;
00059 static const char* theName;
00060 static const char* theEnglish;
00061
00062 virtual const char *className() const;
00063
00064 protected:
00065 virtual RU_PixelFunction *addPixelFunction(const TIL_Plane *plane,
00066 int array_index, float t,
00067 int xres, int yres,
00068 int thread);
00069
00070 static int editHist(void *, int, float,
00071 const PRM_Template *);
00072 private:
00073 COP2_Levels(OP_Network *parent, const char *name,
00074 OP_Operator *entry);
00075 virtual ~COP2_Levels();
00076
00077 virtual const char *getOperationInfo();
00078
00079 float GAMMA(float t)
00080 { return evalFloat(ARG_LEVELS_GAMMA,0,t); }
00081
00082 float GAMMA_RED(float t)
00083 { return evalFloat(ARG_LEVELS_GAMMA_RED,0,t); }
00084 float GAMMA_GREEN(float t)
00085 { return evalFloat(ARG_LEVELS_GAMMA_GREEN,0,t); }
00086 float GAMMA_BLUE(float t)
00087 { return evalFloat(ARG_LEVELS_GAMMA_BLUE,0,t); }
00088 float GAMMA_W(float t)
00089 { return evalFloat(ARG_LEVELS_GAMMA_W,0,t); }
00090 float GAMMA_ALPHA(float t)
00091 { return evalFloat(ARG_LEVELS_GAMMA_A,0,t); }
00092
00093 void INPUT_MAP(float t, float &range_min, float &range_max)
00094 { loadMapParm(ARG_LEVELS_INPUT, t, range_min, range_max);
00095 }
00096
00097 void INPUT_RED_MAP(float t, float &range_min, float &range_max)
00098 { loadMapParm(ARG_LEVELS_RED_INPUT, t, range_min, range_max);
00099 }
00100
00101 void INPUT_GREEN_MAP(float t, float &range_min, float &range_max)
00102 { loadMapParm(ARG_LEVELS_GREEN_INPUT, t, range_min, range_max);
00103 }
00104
00105 void INPUT_BLUE_MAP(float t, float &range_min, float &range_max)
00106 { loadMapParm(ARG_LEVELS_BLUE_INPUT, t, range_min, range_max);
00107 }
00108
00109 void INPUT_ALPHA_MAP(float t, float &range_min, float &range_max)
00110 { loadMapParm(ARG_LEVELS_ALPHA_INPUT, t, range_min, range_max);
00111 }
00112
00113 void INPUT_W_MAP(float t, float &range_min, float &range_max)
00114 { loadMapParm(ARG_LEVELS_W_INPUT, t, range_min, range_max);
00115 }
00116
00117
00118 void OUTPUT_MAP(float t, float &range_min, float &range_max)
00119 { loadMapParm(ARG_LEVELS_OUTPUT, t, range_min, range_max);
00120 }
00121
00122 void OUTPUT_RED_MAP(float t, float &range_min, float &range_max)
00123 { loadMapParm(ARG_LEVELS_RED_OUTPUT, t, range_min, range_max);
00124 }
00125
00126 void OUTPUT_GREEN_MAP(float t, float &range_min, float &range_max)
00127 { loadMapParm(ARG_LEVELS_GREEN_OUTPUT, t, range_min, range_max);
00128 }
00129
00130 void OUTPUT_BLUE_MAP(float t, float &range_min, float &range_max)
00131 { loadMapParm(ARG_LEVELS_BLUE_OUTPUT, t, range_min, range_max);
00132 }
00133
00134 void OUTPUT_ALPHA_MAP(float t, float &range_min, float &range_max)
00135 { loadMapParm(ARG_LEVELS_ALPHA_OUTPUT, t, range_min, range_max);
00136 }
00137
00138 void OUTPUT_W_MAP(float t, float &range_min, float &range_max)
00139 { loadMapParm(ARG_LEVELS_W_OUTPUT, t, range_min, range_max);
00140 }
00141
00142 void loadMapParm(const int pi, float t,
00143 float& range_min, float& range_max);
00144
00145 int myParmBase;
00146
00147 static PRM_Name theNames[];
00148 static PRM_Range theGammaRange;
00149 static PRM_Range theLevelsRange;
00150 static PRM_Default theLevelsDef[];
00151 static PRM_Default theCompDefs[];
00152
00153 };
00154 #endif