43 using namespace HDK_Sample;
51 PRM_Name(
"boostval",
"Overexposure Boost"),
117 COP2_MultiInputWipe::COP2_MultiInputWipe(
OP_Network *parent,
128 namespace HDK_Sample {
153 int xres,
int ,
int ,
int )
164 fademode =
evalInt(
"fademode", 0, t);
182 boost =
evalFloat(
"boostval", 0, t) * 0.5f;
206 int ix1, ix2, iy1, iy2;
228 if(ix1 < x1) x1 = ix1;
229 if(ix2 > x2) x2 = ix2;
230 if(iy1 < y1) y1 = iy1;
231 if(iy2 > y2) y2 = iy2;
296 int xstart,
int ystart)
320 inputseq->
getRes(ixres,iyres);
323 ixres == xres && iyres == yres &&
339 float t,
int xstart,
int ystart,
341 int block,
bool *
mask,
bool *blocked)
346 bool iblocked =
false;
351 tiles =
passInputTile(0,context, plane, array_index, t, xstart,
352 ystart, block, &iblocked, mask);
356 tiles =
passInputTile(1, context, plane, array_index, t, xstart,
357 ystart, block, &iblocked, mask);
363 if(!tiles && iblocked && blocked)
388 tilelist->
myX1 - arad,
389 tilelist->
myY1 - arad,
390 tilelist->
myX2 + arad,
394 boostAndBlur(tilelist, aregion, data->
myFaderA,
405 tilelist->
myX1 - brad,
406 tilelist->
myY1 - brad,
407 tilelist->
myX2 + brad,
411 boostAndBlur(tilelist, bregion, data->
myFaderB,
428 float fade,
float boost,
int rad,
float blur,
431 int ti,
x,
y, i,
j, idx;
439 bool alloced =
false;
442 const float iblur = fade / ((1.0f + blur) * (1.0
f + blur));
443 const float edge = 1.0f - (rad - blur * 0.5f);
449 stride = w + rad * 2;
459 for(y=0; y<(h+rad*2) * stride; y++)
470 dest =
new float[w*
h];
493 memset(dest, 0,
sizeof(
float)*w*h);
497 for(idx=0, y=0; y<
h; y++)
499 for(x=0; x<
w; x++, idx++)
505 for(i=-rad; i<=rad; i++)
507 vedge = (i == -rad || i == rad) ? edge : 1.0
f;
509 hsum = scan[-rad] * edge;
511 hsum += scan[rad] * edge;
513 for(j=-rad+1; j<rad; j++)
522 dest[idx] += sum * iblur;
544 "HDK Multi Input Wipe",
typedef int(APIENTRYP RE_PFNGLXSWAPINTERVALSGIPROC)(int)
TIL_TileList * passInputTile(int input_index, COP2_Context &context, const TIL_Plane *plane, int array_index, float t, int xstart, int ystart, int block, bool *blocked, bool *mask, COP2_Node *fromTile=0)
void writeFPtoTile(TIL_TileList *tilelist, float *&src, int index)
PRM_API const PRM_Type PRM_FLT
bool isTileAlignedWithInput(int input, COP2_Context &context, int tilex, int tiley, COP2_Node *with_node=0)
OP_ERROR error() override
#define FOR_EACH_UNCOOKED_TILE(list, tile, i)
PRM_API const PRM_Type PRM_ORD
fpreal evalFloat(int pi, int vi, fpreal t) const
void setImageBounds(int x1, int y1, int x2, int y2)
void getRes(int &x, int &y) const
bool addOperator(OP_Operator *op, std::ostream *err=nullptr)
static OP_VariablePair myVariablePair
const TIL_Sequence * inputInfo(int input)
virtual unsigned nInputs() const
void * getImageData(int index)
bool expandNeededArea(int pixels_left, int pixels_down, int pixels_right, int pixels_up)
const char * getName() const
GLint GLenum GLboolean GLsizei stride
float getXScaleFactor(int xres) const
#define PLANE_MAX_VECTOR_SIZE
COP2_ContextData * data()
GLuint const GLchar * name
bool getInputBounds(int input, COP2_Context &context, int &x1, int &y1, int &x2, int &y2)
GLenum GLenum GLsizei void * table
PRM_API const PRM_Type PRM_SWITCHER
COP2_CookAreaInfo * makeOutputAreaDependOnMyPlane(int input, COP2_CookAreaInfo &output_area, const COP2_CookAreaList &input_areas, COP2_CookAreaList &needed_areas)
void releaseRegion(TIL_Region *, int output=0)
PRM_API PRM_Default PRMoneDefaults[]
PRM_API PRM_Name PRMswitcherName
GLfloat GLfloat GLfloat GLfloat h
TIL_Region * inputRegion(int input_index, COP2_Context &context, const TIL_Plane *plane, int array_index, float t, int xstart, int ystart, int xend, int yend, TIL_RegionExtend hold=TIL_BLACK, int share=1, void *regionmem[PLANE_MAX_VECTOR_SIZE]=0, bool correct_aspect=true, bool correct_bounds=true, int scan_alignment=0)
COP2_Context * getNodeContextData()
static OP_TemplatePair myTemplatePair
bool getTileInFP(TIL_TileList *tilelist, float *&dest, int index, void *dtile=0)
void clearToBlack(bool markconstant=true)
void setFormat(TIL_DataFormat format)
GLubyte GLubyte GLubyte GLubyte w
const TIL_Plane * myPlane
exint evalInt(int pi, int vi, fpreal t) const
ImageBuf OIIO_API add(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
GLdouble GLdouble GLdouble y2
TIL_Plane * getPlane(int index)
exint getImageIndex(double t, int clamp_range=1, int round_off=SEQUENCE_NEAREST) const
PRM_API PRM_Default PRMzeroDefaults[]
SYS_API fpreal32 SYSceil(fpreal32 val)
GA_API const UT_StringHolder area
void setScoped(int enable)
bool isCompatible(const TIL_Plane &) const