I'm out of my element here, but anyway. Could you possibly scale the image up 
to twice the size and then do the stretching?

As a final step, scale it back down with a filter offset to keep only the odd 
or even pixels.

Cheers,
Elias Ericsson Rydberg

28 nov 2013 kl. 01:09 skrev Bryan Dunkley <[email protected]>:

> 
> I have tried making the "stretched" part -1 and this shows that it isn't 
> doing every pixel as I thought. So the way i'm doing things is wrong I just 
> don't know how to fix it.
> I'm stuck. Ive looked at the IDistort.cpp and it uses a sample instead of a 
> tile look up. The problem is how do I "stretch" a value using the sample so 
> that it doesn't leave "gaps".
> 
> On 26 November 2013 12:00, <[email protected]> wrote:
>> Send Nuke-dev mailing list submissions to
>>         [email protected]
>> 
>> To subscribe or unsubscribe via the World Wide Web, visit
>>         http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev
>> or, via email, send a message with subject or body 'help' to
>>         [email protected]
>> 
>> You can reach the person managing the list at
>>         [email protected]
>> 
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of Nuke-dev digest..."
>> 
>> 
>> Today's Topics:
>> 
>>    1. Re: Re: Nuke-dev Digest, Vol 80, Issue 12 (Bo Zhou)
>> 
>> 
>> ----------------------------------------------------------------------
>> 
>> Message: 1
>> Date: Tue, 26 Nov 2013 09:59:21 +0800
>> From: Bo Zhou <[email protected]>
>> Subject: Re: [Nuke-dev] Re: Nuke-dev Digest, Vol 80, Issue 12
>> To: Nuke plug-in development discussion
>>         <[email protected]>
>> Message-ID: <[email protected]>
>> Content-Type: text/plain; charset="utf-8"
>> 
>> Hi,
>> 
>> Did you tried to generate the whole filtered image, and later output to
>> scanline in order to debug your algorithm ?
>> 
>> On 2013/11/26 9:54, Bryan Dunkley wrote:
>> > Hi Ivan,
>> >
>> > Well spotted, this was indeed outputing only 0 and 1. I changed that
>> > now that to a float to get the desired values.
>> >
>> > Its still very steppy tho. even with cubic interpolation...almost
>> > looks like it skips a pixel between two pixel positions.
>> >
>> >
>> > On 26 November 2013 01:49, <[email protected]
>> > <mailto:[email protected]>> wrote:
>> >
>> >     Send Nuke-dev mailing list submissions to
>> >     [email protected]
>> >     <mailto:[email protected]>
>> >
>> >     To subscribe or unsubscribe via the World Wide Web, visit
>> >     http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev
>> >     or, via email, send a message with subject or body 'help' to
>> >     [email protected]
>> >     <mailto:[email protected]>
>> >
>> >     You can reach the person managing the list at
>> >     [email protected]
>> >     <mailto:[email protected]>
>> >
>> >     When replying, please edit your Subject line so it is more specific
>> >     than "Re: Contents of Nuke-dev digest..."
>> >
>> >
>> >     Today's Topics:
>> >
>> >        1. pixel stretch: interpolation. (Bryan Dunkley)
>> >        2. Re: pixel stretch: interpolation. (Ivan Busquets)
>> >
>> >
>> >     ----------------------------------------------------------------------
>> >
>> >     Message: 1
>> >     Date: Tue, 26 Nov 2013 01:18:27 +0000
>> >     From: Bryan Dunkley <[email protected]
>> >     <mailto:[email protected]>>
>> >     Subject: [Nuke-dev] pixel stretch: interpolation.
>> >     To: [email protected]
>> >     <mailto:[email protected]>
>> >     Message-ID:
>> >
>> >     <caaygu29wuyisvatqbut1wpqhe9rvwrydk1qf2etrgo5+6cc...@mail.gmail.com 
>> > <mailto:caaygu29wuyisvatqbut1wpqhe9rvwrydk1qf2etrgo5%[email protected]>>
>> >     Content-Type: text/plain; charset="iso-8859-1"
>> >
>> >     Skipped content of type multipart/alternative-------------- next
>> >     part --------------
>> >     A non-text attachment was scrubbed...
>> >     Name: spread_artifact.jpg
>> >     Type: image/jpeg
>> >     Size: 14376 bytes
>> >     Desc: not available
>> >     Url :
>> >     
>> > http://support.thefoundry.co.uk/cgi-bin/mailman/private/nuke-dev/attachments/20131126/9baebf05/spread_artifact-0001.jpg
>> >
>> >     ------------------------------
>> >
>> >     Message: 2
>> >     Date: Mon, 25 Nov 2013 17:24:13 -0800
>> >     From: Ivan Busquets <[email protected]
>> >     <mailto:[email protected]>>
>> >     Subject: Re: [Nuke-dev] pixel stretch: interpolation.
>> >     To: Nuke plug-in development discussion
>> >             <[email protected]
>> >     <mailto:[email protected]>>
>> >     Message-ID:
>> >
>> >     <CAGQmGOBQTFq=lpn4atnyb1sb+vpopjboj_dv4bqrjfmtgai...@mail.gmail.com 
>> > <mailto:lpn4atnyb1sb%[email protected]>>
>> >     Content-Type: text/plain; charset="iso-8859-1"
>> >
>> >     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] <mailto:[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]
>> >     <mailto:[email protected]>,
>> >     http://forums.thefoundry.co.uk/
>> >     > http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev
>> >     >
>> >     >
>> >     -------------- next part --------------
>> >     An HTML attachment was scrubbed...
>> >     URL:
>> >     
>> > http://support.thefoundry.co.uk/cgi-bin/mailman/private/nuke-dev/attachments/20131125/044c07b9/attachment.htm
>> >
>> >     ------------------------------
>> >
>> >     _______________________________________________
>> >     Nuke-dev mailing list
>> >     [email protected]
>> >     <mailto:[email protected]>,
>> >     http://forums.thefoundry.co.uk/
>> >     http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev
>> >
>> >
>> >     End of Nuke-dev Digest, Vol 80, Issue 12
>> >     ****************************************
>> >
>> >
>> >
>> >
>> > --
>> > Bryan 'Fox' Dunkley
>> > Compositor / Python, C++ Developer
>> >
>> > tel: +44 755 268 2117
>> > website: www.slyfoxfx.com <http://www.slyfoxfx.com>
>> > linkedin: http://www.linkedin.com/pub/bryan-dunkley/26/b21/bab
>> >
>> >
>> > _______________________________________________
>> > Nuke-dev mailing list
>> > [email protected], http://forums.thefoundry.co.uk/
>> > http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev
>> 
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL: 
>> http://support.thefoundry.co.uk/cgi-bin/mailman/private/nuke-dev/attachments/20131126/d8f4dba4/attachment.html
>> 
>> ------------------------------
>> 
>> _______________________________________________
>> Nuke-dev mailing list
>> [email protected], http://forums.thefoundry.co.uk/
>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev
>> 
>> 
>> End of Nuke-dev Digest, Vol 80, Issue 14
>> ****************************************
> 
> 
> 
> -- 
> Bryan 'Fox' Dunkley
> Compositor / Python, C++ Developer
> 
> tel: +44 755 268 2117
> website: www.slyfoxfx.com
> linkedin: http://www.linkedin.com/pub/bryan-dunkley/26/b21/bab
> _______________________________________________
> 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

Reply via email to