Hey Bryan, I haven't actually checked this, but looking at this line:
((float*)(modifiedRow[z]))[ current_value] = lerp(value,d_value,(i/stretch)); Wouldn't (i/stretch) always return an integer? And therefore your lerp function is going to be "steppy"? On Mon, Nov 25, 2013 at 5:18 PM, Bryan Dunkley <[email protected]>wrote: > > Hi Guys, > > I'm having trouble with my pixel stretch plugin, I've tried linear and > cubic interpolation to get from one value to another over a given number of > pixels. linear interpolation should get this done. > I basically want a smoother blend from the start value to the end value. > > attached is an image of the result I currently get. > > any help would be great thanks. Bryan > > for (;X<r;X++) > { > float shift = (multiplier*distortionValue[X]); > int stretch = int(shift)*-1; > > foreach (z, channels) > { > for (int i=0; i <= stretch; i++) > { > if ((X-stretch) < X) //check for out of bounding box > { > break; > } > else > { > float value = tile[z][y][X]; > float d_value = tile[z][y][X+stretch]; > > int current_value = (X-stretch)+i; > > if (stretch != 0) > { > //LINEAR INTERPOLATION > //((float*)(modifiedRow[z]))[current_value] = > lerp(value,d_value,(i/stretch)); > } > else > { > ((float*)(modifiedRow[z]))[current_value] = value; > } > } > } > } > } > > _______________________________________________ > Nuke-dev mailing list > [email protected], http://forums.thefoundry.co.uk/ > http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev > >
_______________________________________________ Nuke-dev mailing list [email protected], http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev
